]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/viewproperties.cpp
Merge branch 'master' into frameworks
[dolphin.git] / src / views / viewproperties.cpp
index 30deb7277dc0931a22eaeb6496b05e238a4a012a..bcea0625348213eaa065a4c123e57a7a3616c17b 100644 (file)
@@ -27,6 +27,8 @@
 #include <KLocale>
 #include <KStandardDirs>
 #include <KUrl>
+#include <KDebug>
+#include <KGlobal>
 
 #include <QCryptographicHash>
 #include <QDate>
@@ -53,7 +55,7 @@ ViewProperties::ViewProperties(const KUrl& url) :
     m_node(0)
 {
     GeneralSettings* settings = GeneralSettings::self();
-    const bool useGlobalViewProps = settings->globalViewProps();
+    const bool useGlobalViewProps = settings->globalViewProps() || url.isEmpty();
     bool useDetailsViewWithPath = false;
 
     // We try and save it to the file .directory in the directory being viewed.
@@ -100,13 +102,13 @@ ViewProperties::ViewProperties(const KUrl& url) :
             setVisibleRoles(QList<QByteArray>() << "path");
         } else {
             // The global view-properties act as default for directories without
-            // any view-property configuration
-            settings->setGlobalViewProps(true);
-
-            ViewProperties defaultProps(url);
+            // any view-property configuration. Constructing a ViewProperties 
+            // instance for an empty KUrl ensures that the global view-properties
+            // are loaded.
+            KUrl emptyUrl;
+            ViewProperties defaultProps(emptyUrl);
             setDirProperties(defaultProps);
 
-            settings->setGlobalViewProps(false);
             m_changedProps = false;
         }
     }