diff options
author | Aaron Seigo <aseigo@kde.org> | 2015-12-28 16:32:46 +0100 |
---|---|---|
committer | Aaron Seigo <aseigo@kde.org> | 2015-12-28 16:32:51 +0100 |
commit | 4b9675e797c87ea363aa313854b72b5754122b79 (patch) | |
tree | e2ccf42bc4a0fe8d7450c0b18956afa8d248de73 /akonadish/syntax_modules | |
parent | f90a6a8992ab2b99b3d56e268c1592c7432aedcf (diff) | |
download | sink-4b9675e797c87ea363aa313854b72b5754122b79.tar.gz sink-4b9675e797c87ea363aa313854b72b5754122b79.zip |
tighten this up a little
Diffstat (limited to 'akonadish/syntax_modules')
-rw-r--r-- | akonadish/syntax_modules/akonadi_list.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/akonadish/syntax_modules/akonadi_list.cpp b/akonadish/syntax_modules/akonadi_list.cpp index 807119c..18f15e7 100644 --- a/akonadish/syntax_modules/akonadi_list.cpp +++ b/akonadish/syntax_modules/akonadi_list.cpp | |||
@@ -72,7 +72,6 @@ bool list(const QStringList &args, State &state) | |||
72 | 72 | ||
73 | //qDebug() << "Listing"; | 73 | //qDebug() << "Listing"; |
74 | int colSize = 38; //Necessary to display a complete UUID | 74 | int colSize = 38; //Necessary to display a complete UUID |
75 | state.print(" " + QObject::tr("Column") + " "); | ||
76 | state.print(QObject::tr("Resource").leftJustified(colSize, ' ', true) + | 75 | state.print(QObject::tr("Resource").leftJustified(colSize, ' ', true) + |
77 | QObject::tr("Identifier").leftJustified(colSize, ' ', true)); | 76 | QObject::tr("Identifier").leftJustified(colSize, ' ', true)); |
78 | for (int i = 0; i < model->columnCount(QModelIndex()); i++) { | 77 | for (int i = 0; i < model->columnCount(QModelIndex()); i++) { |
@@ -82,9 +81,8 @@ bool list(const QStringList &args, State &state) | |||
82 | 81 | ||
83 | QObject::connect(model.data(), &QAbstractItemModel::rowsInserted, [model, colSize, state](const QModelIndex &index, int start, int end) { | 82 | QObject::connect(model.data(), &QAbstractItemModel::rowsInserted, [model, colSize, state](const QModelIndex &index, int start, int end) { |
84 | for (int i = start; i <= end; i++) { | 83 | for (int i = start; i <= end; i++) { |
85 | state.print(" " + QObject::tr("Row %1").arg(QString::number(model->rowCount())).rightJustified(4, ' ') + ": "); | ||
86 | auto object = model->data(model->index(i, 0, index), Akonadi2::Store::DomainObjectBaseRole).value<Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr>(); | 84 | auto object = model->data(model->index(i, 0, index), Akonadi2::Store::DomainObjectBaseRole).value<Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr>(); |
87 | state.print(" " + object->resourceInstanceIdentifier().leftJustified(colSize, ' ', true)); | 85 | state.print(object->resourceInstanceIdentifier().leftJustified(colSize, ' ', true)); |
88 | state.print(object->identifier().leftJustified(colSize, ' ', true)); | 86 | state.print(object->identifier().leftJustified(colSize, ' ', true)); |
89 | for (int col = 0; col < model->columnCount(QModelIndex()); col++) { | 87 | for (int col = 0; col < model->columnCount(QModelIndex()); col++) { |
90 | state.print(" | " + model->data(model->index(i, col, index)).toString().leftJustified(colSize, ' ', true)); | 88 | state.print(" | " + model->data(model->index(i, col, index)).toString().leftJustified(colSize, ' ', true)); |