• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/vcs

  • sources
  • kfour-appscomplete
  • kdevelop
  • kdevplatform
  • vcs
vcsstatusinfo.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * This file is part of KDevelop *
3  * Copyright 2007 Andreas Pakulat <[email protected]> *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU Library General Public License as *
7  * published by the Free Software Foundation; either version 2 of the *
8  * License, or (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU Library General Public *
16  * License along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 
21 #include "vcsstatusinfo.h"
22 
23 #include <QDebug>
24 #include <QUrl>
25 #include <QSharedData>
26 
27 namespace KDevelop
28 {
29 
30 class VcsStatusInfoPrivate : public QSharedData
31 {
32 public:
33  int state;
34  QUrl url;
35 };
36 
37 VcsStatusInfo::VcsStatusInfo()
38  : d( new VcsStatusInfoPrivate)
39 {
40  d->state = VcsStatusInfo::ItemUnknown;
41 }
42 
43 VcsStatusInfo::~VcsStatusInfo() = default;
44 
45 VcsStatusInfo::VcsStatusInfo( const VcsStatusInfo& rhs )
46  : d(rhs.d)
47 {
48 }
49 
50 VcsStatusInfo& VcsStatusInfo::operator=( const VcsStatusInfo& rhs)
51 {
52  d = rhs.d;
53  return *this;
54 }
55 
56 bool VcsStatusInfo::operator==( const KDevelop::VcsStatusInfo& rhs) const
57 {
58  return ( d->state == rhs.d->state && d->url == rhs.d->url );
59 }
60 
61 bool VcsStatusInfo::operator!=( const KDevelop::VcsStatusInfo& rhs) const
62 {
63  return !(operator==(rhs));
64 }
65 
66 void VcsStatusInfo::setUrl( const QUrl& url )
67 {
68  d->url = url;
69 }
70 
71 void VcsStatusInfo::setExtendedState( int newstate )
72 {
73  d->state = newstate;
74 }
75 
76 void VcsStatusInfo::setState( VcsStatusInfo::State state )
77 {
78  d->state = state;
79 }
80 
81 int VcsStatusInfo::extendedState() const
82 {
83  return d->state;
84 }
85 
86 QUrl VcsStatusInfo::url() const
87 {
88  return d->url;
89 }
90 
91 VcsStatusInfo::State VcsStatusInfo::state() const
92 {
93  return VcsStatusInfo::State(d->state);
94 }
95 
96 }
97 
98 QDebug operator<<(QDebug s, const KDevelop::VcsStatusInfo& statusInfo)
99 {
100  s.nospace() << statusInfo.state() << "@" << statusInfo.url();
101  return s.space();
102 }
KDevelop::VcsStatusInfo::operator=
VcsStatusInfo & operator=(const VcsStatusInfo &rhs)
Definition: vcsstatusinfo.cpp:67
QSharedData
KDevelop::VcsStatusInfo::VcsStatusInfo
VcsStatusInfo()
Definition: vcsstatusinfo.cpp:54
QUrl
QDebug::nospace
QDebug & nospace()
QDebug::space
QDebug & space()
QDebug
KDevelop::VcsStatusInfo::state
VcsStatusInfo::State state() const
Definition: vcsstatusinfo.cpp:108
KDevelop::VcsStatusInfo::operator!=
bool operator!=(const KDevelop::VcsStatusInfo &rhs) const
Definition: vcsstatusinfo.cpp:78
KDevelop::VcsStatusInfo::setExtendedState
void setExtendedState(int)
Definition: vcsstatusinfo.cpp:88
KDevelop::VcsStatusInfo::~VcsStatusInfo
virtual ~VcsStatusInfo()
KDevelop::VcsStatusInfo::extendedState
int extendedState() const
Definition: vcsstatusinfo.cpp:98
KDevelop::VcsStatusInfo::url
QUrl url() const
retrieves the url of this status information item
Definition: vcsstatusinfo.cpp:103
KDevelop::VcsStatusInfo::ItemUnknown
No VCS information about a file is known (or file is not under VCS control).
Definition: vcsstatusinfo.h:55
KDevelop::VcsStatusInfo::operator==
bool operator==(const KDevelop::VcsStatusInfo &rhs) const
Definition: vcsstatusinfo.cpp:73
KDevelop::VcsStatusInfo::setUrl
void setUrl(const QUrl &url)
Change the url of this status information item.
Definition: vcsstatusinfo.cpp:83
KDevelop::VcsStatusInfo::State
State
Status of a local file.
Definition: vcsstatusinfo.h:53
KDevelop
Definition: dvcsevent.h:33
KDevelop::VcsStatusInfo
Class that encapsulates status information for one local url.
Definition: vcsstatusinfo.h:47
operator<<
QDebug operator<<(QDebug s, const KDevelop::VcsStatusInfo &statusInfo)
Definition: vcsstatusinfo.cpp:98
vcsstatusinfo.h
KDevelop::VcsStatusInfo::setState
void setState(VcsStatusInfo::State)
Definition: vcsstatusinfo.cpp:93
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Jan 23 2021 09:41:52 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevplatform/vcs

Skip menu "kdevplatform/vcs"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal