]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Don't change the default view properties, if the view mode is changed on a remote...
authorPeter Penz <peter.penz19@gmail.com>
Wed, 19 May 2010 19:25:04 +0000 (19:25 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 19 May 2010 19:25:04 +0000 (19:25 +0000)
BUG: 234852

svn path=/trunk/KDE/kdebase/apps/; revision=1128615

src/viewproperties.cpp

index 67f0634f283eebf512282f58119bfabf9294bf09..1f78fa61039ddb38044dfe71da112208e49b915a 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2006 by Peter Penz (<peter.penz@gmx.at>)                *
+ *   Copyright (C) 2006-2010 by Peter Penz (<peter.penz@gmx.at>)           *
  *   Copyright (C) 2006 by Aaron J. Seigo (<aseigo@kde.org>)               *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -39,18 +39,6 @@ ViewProperties::ViewProperties(const KUrl& url) :
     m_autoSave(true),
     m_node(0)
 {
-    KUrl cleanUrl(url);
-    cleanUrl.cleanPath();
-    m_filepath = cleanUrl.toLocalFile();
-
-    const QLatin1String fileName("/.directory");
-
-    if ((m_filepath.length() < 1) || !QDir::isAbsolutePath(m_filepath)) {
-        const QString file = destinationDir("global") + fileName;
-        m_node = new ViewPropertySettings(KSharedConfig::openConfig(file));
-        return;
-    }
-
     // We try and save it to a file in the directory being viewed.
     // If the directory is not writable by the user or the directory is not local,
     // we store the properties information in a local file.
@@ -58,7 +46,8 @@ ViewProperties::ViewProperties(const KUrl& url) :
     const bool useGlobalViewProps = settings->globalViewProps();
     if (useGlobalViewProps) {
         m_filepath = destinationDir("global");
-    } else if (cleanUrl.isLocalFile()) {
+    } else if (url.isLocalFile()) {
+        m_filepath = url.toLocalFile();
         const QFileInfo info(m_filepath);
         if (!info.isWritable()) {
             m_filepath = destinationDir("local") + m_filepath;
@@ -67,7 +56,7 @@ ViewProperties::ViewProperties(const KUrl& url) :
         m_filepath = destinationDir("remote") + m_filepath;
     }
 
-    const QString file = m_filepath + fileName;
+    const QString file = m_filepath + QDir::separator() + QLatin1String(".directory");
     m_node = new ViewPropertySettings(KSharedConfig::openConfig(file));
 
     const bool useDefaultProps = !useGlobalViewProps &&