Gerrit: Differentiate by approval type.

- Parse approval type and description.
- Format tooltip as HTML table, listing approvals by type
- Format the approval column similar to the web view by
  type character.
- Fix the special character issue in Qt 4.8 (query tool
  actually outputs UTF8 instead of escapes).

Change-Id: I803f289a03c5a8ede0029d972a19381b5e783d36
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Friedemann Kleint
2012-05-15 14:29:46 +02:00
parent d8a0b025b4
commit 37def2aa1c
2 changed files with 152 additions and 50 deletions

View File

@@ -48,25 +48,32 @@ namespace Internal {
class GerritParameters;
class QueryContext;
class GerritApproval {
public:
GerritApproval() : approval(-1) {}
QString type; // Review type
QString description; // Type description, possibly empty
QString reviewer;
int approval;
};
class GerritPatchSet {
public:
typedef QPair<QString, int> Approval;
GerritPatchSet() : patchSetNumber(1) {}
QString approvalsToolTip() const;
QString approvalsColumn() const;
bool hasApproval(const QString &userName) const;
int approvalLevel() const;
QString ref;
int patchSetNumber;
QList<Approval> approvals;
QList<GerritApproval> approvals;
};
class GerritChange
{
public:
typedef QPair<QString, int> Approval;
GerritChange() : number(0) {}
bool isValid() const { return number && !url.isEmpty() && !project.isEmpty(); }