]> cloud.milkyroute.net Git - dolphin.git/commitdiff
For now, let the "Others" group to be sorted as the first one
authorRafael Fernández López <ereslibre@kde.org>
Wed, 5 Dec 2007 15:44:44 +0000 (15:44 +0000)
committerRafael Fernández López <ereslibre@kde.org>
Wed, 5 Dec 2007 15:44:44 +0000 (15:44 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=745157

src/dolphinmodel.cpp

index e74df4d3f01f14a34df22b17e072377281f96dc0..3dcbf63ef051c63438bdfc3fe1cf394d6e783209 100644 (file)
@@ -47,6 +47,8 @@
 #include <QDir>
 #include <QFileInfo>
 
+static QString others = I18N_NOOP2("@title:group Name", "Uncategorized");
+
 DolphinModel::DolphinModel(QObject *parent)
     : KDirModel(parent)
 {
@@ -89,7 +91,7 @@ QVariant DolphinModel::data(const QModelIndex &index, int role) const
                             if (name.size() > 1 && name.at(1).isLetter()) {
                                 retString = name.at(1).toUpper();
                             } else {
-                                retString = i18nc("@title:group Name", "Others");
+                                retString = others;
                             }
                         } else {
                             retString = name.at(0).toUpper();
@@ -103,14 +105,14 @@ QVariant DolphinModel::data(const QModelIndex &index, int role) const
                             if (currA->isLetter()) {
                                 validCategory = true;
                             } else if (currA->isDigit()) {
-                                return i18nc("@title:group", "Others");
+                                return others;
                             } else {
                                 ++currA;
                             }
                         }
 
                         if (!validCategory) {
-                            retString = validCategory ? *currA : i18nc("@title:group Name", "Others");
+                            retString = validCategory ? *currA : others;
                         } else {
                             retString = *currA;
                         }
@@ -241,6 +243,10 @@ QVariant DolphinModel::data(const QModelIndex &index, int role) const
         switch (index.column()) {
         case KDirModel::Name: {
             retVariant = data(index, KCategorizedSortFilterProxyModel::CategoryDisplayRole);
+
+            if (retVariant == others)
+                retVariant = QString();
+
             break;
         }