Ver código fonte

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
Olivier Goffart 12 anos atrás
pai
commit
c3326efe94

+ 3 - 3
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);
 }
 

+ 0 - 3
src/mirall/itemprogressdialog.ui

@@ -39,9 +39,6 @@
        <property name="uniformRowHeights">
         <bool>true</bool>
        </property>
-       <property name="sortingEnabled">
-        <bool>true</bool>
-       </property>
        <property name="columnCount">
         <number>4</number>
        </property>