Gerrit: Refactor preparing the introduction of a hierarchical model.

Change model and dialog methods to use QModelIndex and remove
obsolete methods. Split out method to populate a list of standard items
from a change. Change GerritModel::itemForId() to recurse
over the tree.

Change-Id: I9393f498ffbdf63ba3ad78146d041bcda3835527
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Friedemann Kleint
2014-06-20 09:52:29 +02:00
parent d33b27e6d5
commit bb4031dccf
4 changed files with 89 additions and 85 deletions

View File

@@ -115,8 +115,8 @@ public:
GerritModel(const QSharedPointer<GerritParameters> &, QObject *parent = 0);
~GerritModel();
GerritChangePtr change(int row) const;
QString toHtml(int row) const;
GerritChangePtr change(const QModelIndex &index) const;
QString toHtml(const QModelIndex &index) const;
QStandardItem *itemForId(const QString &id) const;
@@ -133,9 +133,9 @@ private slots:
void clearData();
private:
inline bool evaluateQuery(QString *errorMessage);
QString dependencyHtml(const QString &header, const QString &changeId,
const QString &serverPrefix) const;
QList<QStandardItem *> changeToRow(const GerritChangePtr &c) const;
const QSharedPointer<GerritParameters> m_parameters;
QueryContext *m_query;