kdevplatform/vcs
vcsfilechangesmodel.cpp
Go to the documentation of this file.
87 bool VcsFileChangesSortProxyModel::lessThan(const QModelIndex& source_left, const QModelIndex& source_right) const
89 const auto leftStatus = source_left.data(VcsFileChangesModel::StateRole).value<VcsStatusInfo::State>();
90 const auto rightStatus = source_right.data(VcsFileChangesModel::StateRole).value<VcsStatusInfo::State>();
152 int VcsFileChangesModel::updateState(QStandardItem *parent, const KDevelop::VcsStatusInfo &status)
162 QString path = ICore::self()->projectController()->prettyFileName(status.url(), KDevelop::IProjectController::FormatPlain);
172 item->setCheckState(status.state() == VcsStatusInfo::ItemUnknown ? Qt::Unchecked : Qt::Checked);
196 QStandardItem* VcsFileChangesModel::fileItemForUrl(QStandardItem* parent, const QUrl& url) const
bool removeRow(int row, const QModelIndex &parent)
VcsFileChangesModel(QObject *parent=nullptr, bool isCheckable=false)
Constructor for class.
Definition: vcsfilechangesmodel.cpp:139
QModelIndex indexFromItem(const QStandardItem *item) const
virtual QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits, QFlags< Qt::MatchFlag > flags) const
QUrl toUrl() const
QVariant fromValue(const T &value)
int row() const
QModelIndex sibling(int row, int column) const
~VcsFileChangesModel() override
Definition: vcsfilechangesmodel.cpp:148
Qt::CheckState checkState() const
int column() const
T value() const
This class holds and represents information about changes in files.
Definition: vcsfilechangesmodel.h:55
QIcon fromTheme(const QString &name, const QIcon &fallback)
static QString stateToString(KDevelop::VcsStatusInfo::State state)
Definition: vcsfilechangesmodel.cpp:40
special states for individual vcs implementations should use this as base.
Definition: vcsstatusinfo.h:61
void setAllChecked(bool checked)
Changes the check-state of all files to the given state.
Definition: vcsfilechangesmodel.cpp:213
void reserve(int alloc)
QVariant data(int role) const
virtual QVariant data(const QModelIndex &index, int role) const
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
QSet< T > toSet() const
Item was updated or it is already at up to date version.
Definition: vcsstatusinfo.h:56
void setIsCheckbable(bool checkable)
Definition: vcsfilechangesmodel.cpp:290
bool removeUrl(const QUrl &url)
Definition: vcsfilechangesmodel.cpp:304
QList< QUrl > checkedUrls() const
Returns list of currently checked urls.
Definition: vcsfilechangesmodel.h:75
QStandardItem * parent() const
QString toLocalFile() const
Item was added to the repository but not committed.
Definition: vcsstatusinfo.h:57
int row() const
QVariant data(const QModelIndex &index, int role) const override
Definition: vcsfilechangesmodel.cpp:188
No VCS information about a file is known (or file is not under VCS control).
Definition: vcsstatusinfo.h:55
int localeAwareCompare(const QString &other) const
QObject * child(const char *objName, const char *inheritsClass, bool recursiveSearch) const
static QIcon stateToIcon(KDevelop::VcsStatusInfo::State state)
Definition: vcsfilechangesmodel.cpp:61
bool isLocalFile() const
QStandardItem * invisibleRootItem() const
Definition: dvcsevent.h:33
iterator begin()
bool lessThan(const QModelIndex &rLeft, const QModelIndex &rRight) const override
Definition: vcsfilechangesmodel.cpp:87
Class that encapsulates status information for one local url.
Definition: vcsstatusinfo.h:47
VcsFileChangesSortProxyModel(QObject *parent=nullptr)
Definition: vcsfilechangesmodel.cpp:82
void updateState(const KDevelop::VcsStatusInfo &status)
Used to post update of status of some file.
Definition: vcsfilechangesmodel.h:115
void setCheckable(bool checkable)
iterator end()
QStandardItem * item(int row, int column) const
void setCheckState(Qt::CheckState state)
bool isCheckable() const
Definition: vcsfilechangesmodel.cpp:297
QObject * parent() const
Local version has conflicts that need to be resolved before commit.
Definition: vcsstatusinfo.h:60
QStandardItem * fileItemForUrl(QStandardItem *parent, const QUrl &url) const
Returns item for particular url.
Definition: vcsfilechangesmodel.cpp:196
QString toString() const
void checkUrls(QStandardItem *parent, const QList< QUrl > &urls) const
Checks the given urls, unchecks all others.
Definition: vcsfilechangesmodel.cpp:264
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Jan 19 2021 23:37:34 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Jan 19 2021 23:37:34 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.