]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmodel.cpp
Enable job-transfer indication for file items.
[dolphin.git] / src / dolphinmodel.cpp
index 3b507a8957d7ced2c63bfcc4ab28bfa0fe8f7a6f..35a5fb8f1700b960d033b4f6489444f84623e349 100644 (file)
 
 #include "kcategorizedview.h"
 
-#include <config-nepomuk.h>
-#ifdef HAVE_NEPOMUK
-#include <nepomuk/global.h>
-#include <nepomuk/resource.h>
-#include <nepomuk/tag.h>
-#include <Soprano/Vocabulary/Xesam>
-#endif
-
 #include <kdatetime.h>
 #include <kdirmodel.h>
 #include <kfileitem.h>
 #include <QDir>
 #include <QFileInfo>
 
-const char* DolphinModel::m_others = I18N_NOOP2("@title:group Name", "Others");
+const char* const DolphinModel::m_others = I18N_NOOP2("@title:group Name", "Others");
 
 DolphinModel::DolphinModel(QObject* parent) :
     KDirModel(parent),
     m_hasVersionData(false),
     m_revisionHash()
 {
+    setJobTransfersVisible(true);
 }
 
 DolphinModel::~DolphinModel()
@@ -217,11 +210,7 @@ QVariant DolphinModel::displayRoleData(const QModelIndex& index) const
                     }
                 }
 
-                if (!validCategory) {
-                    retString = validCategory ? *currA : i18nc("@title:group Name", m_others);
-                } else {
-                    retString = *currA;
-                }
+                retString = validCategory ? *currA : i18nc("@title:group Name", m_others);
             }
         }
         break;
@@ -263,6 +252,11 @@ QVariant DolphinModel::displayRoleData(const QModelIndex& index) const
         }
 
         if (currentDate.year() == modifiedDate.year() && currentDate.month() == modifiedDate.month()) {
+            if (modifiedWeek > currentWeek) {
+                // use case: modified date = 2010-01-01, current date = 2010-01-22
+                //           modified week = 53,         current week = 3
+                modifiedWeek = 0;
+            }
             switch (currentWeek - modifiedWeek) {
             case 0:
                 switch (daysDistance) {
@@ -393,7 +387,7 @@ QVariant DolphinModel::sortRoleData(const QModelIndex& index) const
         retVariant = data(index, KCategorizedSortFilterProxyModel::CategoryDisplayRole);
         if (retVariant == i18nc("@title:group Name", m_others)) {
             // assure that the "Others" group is always the last categorization
-            retVariant = QString(QChar(QChar::ReplacementCharacter));
+            retVariant = QString('Z').append(QChar::ReplacementCharacter);
         }
         break;
     }