X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/b2719884b9cdd31b293e785aebabddabf374383d..c8a2db7d4e79422ee3301e855ac5f6bb0a09e710:/src/views/viewproperties.cpp diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index 30deb7277..bcea06253 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include @@ -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() << "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; } }