# # # patch "src/model/Certs.cpp" # from [c2f31fd9fd521deeeca8dfef1bcd12c21c17ab94] # to [8a92003203aa76ddf3620920602a2da4816415ec] # ============================================================ --- src/model/Certs.cpp c2f31fd9fd521deeeca8dfef1bcd12c21c17ab94 +++ src/model/Certs.cpp 8a92003203aa76ddf3620920602a2da4816415ec @@ -49,6 +49,13 @@ void Certs::processTaskResult(const Mono void Certs::processTaskResult(const MonotoneTask & task) { + if (task.getReturnCode() != 0) + { + C(QString("Command returned with a non-zero return code (%1)") + .arg(task.getOutputUtf8())); + return; + } + BasicIOParser parser(task.getOutputUtf8()); I(parser.parse()); StanzaList list = parser.getStanzas(); @@ -136,18 +143,18 @@ int Certs::columnCount(const QModelIndex int Certs::columnCount(const QModelIndex & parent) const { Q_UNUSED(parent); - return 6; + return 6; } QVariant Certs::data(const QModelIndex & index, int role) const { - if (!index.isValid()) - { - return QVariant(); - } + if (!index.isValid()) + { + return QVariant(); + } if (role == Qt::TextAlignmentRole) - { + { Qt::Alignment flags = Qt::AlignLeft | Qt::AlignTop; return QVariant(flags); } @@ -156,7 +163,7 @@ QVariant Certs::data(const QModelIndex & { return QVariant(); } - + int row = index.row(); if (row >= certs->size()) return QVariant(); @@ -188,14 +195,14 @@ Qt::ItemFlags Certs::flags(const QModelI Qt::ItemFlags Certs::flags(const QModelIndex & index) const { Q_UNUSED(index); - // rows shouldn't be selectable or anything else - return Qt::ItemIsEnabled; + // rows shouldn't be selectable or anything else + return Qt::ItemIsEnabled; } QVariant Certs::headerData(int section, Qt::Orientation orientation, int role) const { - if (orientation == Qt::Horizontal && role == Qt::DisplayRole) - { + if (orientation == Qt::Horizontal && role == Qt::DisplayRole) + { switch (section) { case 0: return QVariant(tr("Key")); @@ -211,7 +218,7 @@ int Certs::rowCount(const QModelIndex & int Certs::rowCount(const QModelIndex & parent) const { Q_UNUSED(parent); - return certs->size(); + return certs->size(); } QModelIndex Certs::index(int row, int column, const QModelIndex & parent) const