]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/viewproperties.cpp
Get back names, and use "using" keyword to keep GCC silent on "method foo on base...
[dolphin.git] / src / viewproperties.cpp
index 3fc102d6c933c0d3c7d40ed45f8664e812080aa8..3a2bb1fc15607b0bf1942f665058ac3730a65358 100644 (file)
 #include <kstandarddirs.h>
 #include <kurl.h>
 
-#ifdef HAVE_NEPOMUK
-    #include <nepomuk/resourcemanager.h>
-#endif
-
 #include <QDate>
 #include <QFile>
 #include <QFileInfo>
 
-bool ViewProperties::m_nepomukSupport = false;
-
 #define FILE_NAME "/.directory"
 
 ViewProperties::ViewProperties(const KUrl& url) :
@@ -46,14 +40,6 @@ ViewProperties::ViewProperties(const KUrl& url) :
     m_autoSave(true),
     m_node(0)
 {
-#ifdef HAVE_NEPOMUK
-    static bool checkedNepomukSupport = false;
-    if (!checkedNepomukSupport) {
-        m_nepomukSupport = !Nepomuk::ResourceManager::instance()->init();
-        checkedNepomukSupport = true;
-    }
-#endif
-
     KUrl cleanUrl(url);
     cleanUrl.cleanPath();
     m_filepath = cleanUrl.toLocalFile();
@@ -174,15 +160,7 @@ void ViewProperties::setSorting(DolphinView::Sorting sorting)
 
 DolphinView::Sorting ViewProperties::sorting() const
 {
-    // If Nepomuk is not available, return SortByName as fallback if SortByRating
-    // or SortByTags is stored.
-    DolphinView::Sorting sorting = static_cast<DolphinView::Sorting>(m_node->sorting());
-    const bool sortByName = !m_nepomukSupport &&
-                            ((sorting == DolphinView::SortByRating) || (sorting == DolphinView::SortByTags));
-    if (sortByName) {
-        sorting = DolphinView::SortByName;
-    }
-    return sorting;
+    return static_cast<DolphinView::Sorting>(m_node->sorting());
 }
 
 void ViewProperties::setSortOrder(Qt::SortOrder sortOrder)
@@ -282,6 +260,7 @@ void ViewProperties::setDirProperties(const ViewProperties& props)
     setCategorizedSorting(props.categorizedSorting());
     setSorting(props.sorting());
     setSortOrder(props.sortOrder());
+    setSortFoldersFirst(props.sortFoldersFirst());
     setAdditionalInfo(props.additionalInfo());
 }