]> git.lyx.org Git - features.git/commitdiff
Really put uncategorized items at the end if sortCats is true
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 9 Oct 2012 06:51:39 +0000 (08:51 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 9 Oct 2012 06:51:39 +0000 (08:51 +0200)
src/frontends/qt4/CategorizedCombo.cpp

index 7a9508b1af10df388673ab914921a6e2946cd2e8..d4410cf16896fa57dde76698c3e3332e660f3380 100644 (file)
@@ -516,9 +516,12 @@ void CategorizedCombo::addItemSort(QString const & item, QString const & guiname
        // find category
        int i = 0;
        if (sortedByCat) {
+               // If sortCats == true, sort categories alphabetically, uncategorized at the end.
                while (i < end && d->model_->item(i, 2)->text() != qcat
-                      && (!sortCats || (d->model_->item(i, 2)->text().localeAwareCompare(qcat) < 0)
-                          || (uncategorized && d->model_->item(i, 2)->text() == qt_("Uncategorized"))))
+                      && (!sortCats 
+                          || (!uncategorized && d->model_->item(i, 2)->text().localeAwareCompare(qcat) < 0
+                              && d->model_->item(i, 2)->text() != qt_("Uncategorized"))
+                          || (uncategorized && d->model_->item(i, 2)->text() != qt_("Uncategorized"))))
                        ++i;
        }