]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinitemcategorizer.cpp
Fixed 'Select All' and 'Invert Selection' for the column view (only the items of...
[dolphin.git] / src / dolphinitemcategorizer.cpp
index e72edd3006d174c425a71060f722071cbdad3ccb..2a25a8f1275d5fda20eec6aeb70a4da2048955bf 100644 (file)
@@ -91,7 +91,7 @@ QString DolphinItemCategorizer::categoryForItem(const QModelIndex& index,
                     retString = data.toString().toUpper().at(1);
                 else if (item->isHidden() && data.toString().at(0) == '.' &&
                          !data.toString().at(1).isLetter())
-                    retString = i18n("Others");
+                    retString = i18nc("@title:group Name", "Others");
                 else if (item->isHidden() && data.toString().at(0) != '.')
                     retString = data.toString().toUpper().at(0);
                 else if (item->isHidden())
@@ -106,13 +106,13 @@ QString DolphinItemCategorizer::categoryForItem(const QModelIndex& index,
                         if (currA->isLetter())
                             validCategory = true;
                         else if (currA->isDigit())
-                            return i18n("Others");
+                            return i18nc("@title:group", "Others");
                         else
                             ++currA;
                     }
 
                     if (!validCategory)
-                        retString = i18n("Others");
+                        retString = i18nc("@title:group Name", "Others");
                     else
                         retString = *currA;
                 }
@@ -122,22 +122,21 @@ QString DolphinItemCategorizer::categoryForItem(const QModelIndex& index,
 
         case DolphinView::SortByDate:
         {
-            KDateTime modifiedTime;
-            modifiedTime.setTime_t(item->time(KIO::UDS_MODIFICATION_TIME));
+            KDateTime modifiedTime = item->time(KFileItem::ModificationTime);
             modifiedTime = modifiedTime.toLocalZone();
 
             if (modifiedTime.daysTo(KDateTime::currentLocalDateTime()) == 0)
-                retString = i18n("Today");
+                retString = i18nc("@title:group Date", "Today");
             else if (modifiedTime.daysTo(KDateTime::currentLocalDateTime()) == 1)
-                retString = i18n("Yesterday");
+                retString = i18nc("@title:group Date", "Yesterday");
             else if (modifiedTime.daysTo(KDateTime::currentLocalDateTime()) < 7)
-                retString = i18n("Less than a week");
+                retString = i18nc("@title:group Date", "Less than a week");
             else if (modifiedTime.daysTo(KDateTime::currentLocalDateTime()) < 31)
-                retString = i18n("Less than a month");
+                retString = i18nc("@title:group Date", "Less than a month");
             else if (modifiedTime.daysTo(KDateTime::currentLocalDateTime()) < 365)
-                retString = i18n("Less than a year");
+                retString = i18nc("@title:group Date", "Less than a year");
             else
-                retString = i18n("More than a year");
+                retString = i18nc("@title:group Date", "More than a year");
             break;
         }
 
@@ -156,13 +155,13 @@ QString DolphinItemCategorizer::categoryForItem(const QModelIndex& index,
         case DolphinView::SortBySize: {
             const int fileSize = item ? item->size() : -1;
             if (item && item->isDir()) {
-                retString = i18n("Folders");
+                retString = i18nc("@title:group Size", "Folders");
             } else if (fileSize < 5242880) {
-                retString = i18nc("Size", "Small");
+                retString = i18nc("@title:group Size", "Small");
             } else if (fileSize < 10485760) {
-                retString = i18nc("Size", "Medium");
+                retString = i18nc("@title:group Size", "Medium");
             } else {
-                retString = i18nc("Size", "Big");
+                retString = i18nc("@title:group Size", "Big");
             }
             break;
         }
@@ -183,7 +182,7 @@ QString DolphinItemCategorizer::categoryForItem(const QModelIndex& index,
             retString = DolphinSortFilterProxyModel::tagsForIndex(index);
 
             if (retString.isEmpty())
-                retString = i18n("Not yet tagged");
+                retString = i18nc("@title:group Tags", "Not yet tagged");
 
             break;
         }
@@ -199,8 +198,8 @@ void DolphinItemCategorizer::drawCategory(const QModelIndex &index,
                                           QPainter *painter) const
 {
     QRect starRect = option.rect;
-    int iconSize = KIconLoader::global()->theme()->defaultSize(K3Icon::Small);
 
+    int iconSize =  KIconLoader::global()->currentSize(K3Icon::Small);                       
     const QString category = categoryForItem(index, sortRole);
 
     QColor color = option.palette.color(QPalette::Text);
@@ -366,7 +365,7 @@ void DolphinItemCategorizer::drawCategory(const QModelIndex &index,
 
 int DolphinItemCategorizer::categoryHeight(const QStyleOption &option) const
 {
-    int iconSize = KIconLoader::global()->theme()->defaultSize(K3Icon::Small);
+    int iconSize = KIconLoader::global()->currentSize(K3Icon::Small);
 
     return qMax(option.fontMetrics.height() + (iconSize / 4) * 2 + 2, iconSize + (iconSize / 4) * 2 + 2) /* 2 gradient */;
 }