From c3326efe94bff8b6e3bdddf9263ac9f3e9b0304a Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 26 Aug 2013 17:25:33 +0200 Subject: [PATCH] Do not sort the entries in the syc protocol dialog alphabetically The entries should be sorted chronogically. But now the QTreeWidget can only sort them alphabetically by the time, which is not what we want. Disalbe the sorting, and always insert the elements in the reverse order. Fix #890 --- src/mirall/itemprogressdialog.cpp | 6 +++--- src/mirall/itemprogressdialog.ui | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/mirall/itemprogressdialog.cpp b/src/mirall/itemprogressdialog.cpp index 2f6d13cfc..a08647ec8 100644 --- a/src/mirall/itemprogressdialog.cpp +++ b/src/mirall/itemprogressdialog.cpp @@ -149,7 +149,7 @@ void ItemProgressDialog::setSyncResult( const SyncResult& result ) twitem->setToolTip(0, longTimeStr); twitem->setToolTip(3, tooltip); twitem->setIcon(0, Theme::instance()->syncStateIcon(SyncResult::Problem, true)); - _ui->_treeWidget->addTopLevelItem(twitem); + _ui->_treeWidget->insertTopLevelItem(0, twitem); } } @@ -288,7 +288,7 @@ void ItemProgressDialog::slotProgressErrors( const QString& folder, const Progre // by error_code. A quota problem is considered an error, others might not?? item->setIcon(0, Theme::instance()->syncStateIcon(SyncResult::Error, true)); item->setToolTip(0, longTimeStr); - _ui->_treeWidget->addTopLevelItem(item); + _ui->_treeWidget->insertTopLevelItem(0, item); Q_UNUSED(item); } @@ -319,7 +319,7 @@ void ItemProgressDialog::slotProgressInfo( const QString& folder, const Progress QTreeWidgetItem *item = new QTreeWidgetItem(columns); item->setToolTip(0, longTimeStr); - _ui->_treeWidget->addTopLevelItem(item); + _ui->_treeWidget->insertTopLevelItem(0, item); Q_UNUSED(item); } diff --git a/src/mirall/itemprogressdialog.ui b/src/mirall/itemprogressdialog.ui index 3c35b3298..35ac14f73 100644 --- a/src/mirall/itemprogressdialog.ui +++ b/src/mirall/itemprogressdialog.ui @@ -39,9 +39,6 @@ true - - true - 4