forked from qt-creator/qt-creator
Git: Fix issues in the branch dialog
* Split part/next/last into a 'part' node and a 'next/last' node instead of 'part/next' and 'last' node. This is closer to what git does. * Fix some model-issues along the way;) * Unhighlight remote checked-out branches again once they are no longer the current one. * Remove stale nodes after removing a branch. When removing 'first/next' kind of branches, do not keep a empty 'first' in the tree. Task-number: QTCREATORBUG-8518 Change-Id: Ia5650540aa58354aaab513199c8622392bdbd37f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
This commit is contained in:
@@ -55,7 +55,7 @@ public:
|
||||
// QAbstractItemModel
|
||||
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
|
||||
QModelIndex parent(const QModelIndex &index) const;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int rowCount(const QModelIndex &parentIdx = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
||||
@@ -83,12 +83,15 @@ public:
|
||||
|
||||
private:
|
||||
void parseOutputLine(const QString &line);
|
||||
BranchNode *indexToNode(const QModelIndex &index) const;
|
||||
QModelIndex nodeToIndex(BranchNode *node) const;
|
||||
|
||||
QString toolTip(const QString &sha) const;
|
||||
|
||||
GitClient *m_client;
|
||||
QString m_workingDirectory;
|
||||
BranchNode *m_rootNode;
|
||||
BranchNode *m_currentBranch;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user