]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/viewpropertiesdialog.cpp
Create a SidebarTreeView which will include support for drag & drop in later releases...
[dolphin.git] / src / viewpropertiesdialog.cpp
index eceaf8048a594c4d28c3b84231e643a65c7d2850..ecb27db15416f670c1f3814a86e6c48ebd364a48 100644 (file)
@@ -23,7 +23,7 @@
 #include "dolphinview.h"
 #include "dolphinsettings.h"
 #include "dolphinsortfilterproxymodel.h"
-#include "generalsettings.h"
+#include "dolphin_generalsettings.h"
 #include "viewproperties.h"
 
 #include <assert.h>
@@ -60,6 +60,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
     m_useAsDefault(0)
 {
     assert(dolphinView != 0);
+    const bool useGlobalViewProps = DolphinSettings::instance().generalSettings()->globalViewProps();
 
     setCaption(i18n("View Properties"));
     setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply);
@@ -72,12 +73,15 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
     QVBoxLayout* topLayout = new QVBoxLayout();
 
     // create 'Properties' group containing view mode, sorting, sort order and show hidden files
-    QGroupBox* propsBox = new QGroupBox(i18n("Properties"), main);
+    QWidget* propsBox = main;
+    if (!useGlobalViewProps) {
+        propsBox = new QGroupBox(i18n("Properties"), main);
+    }
 
     QLabel* viewModeLabel = new QLabel(i18n("View mode:"), propsBox);
     m_viewMode = new QComboBox(propsBox);
     m_viewMode->addItem(SmallIcon("view_icon"), i18n("Icons"));
-    m_viewMode->addItem(SmallIcon("view_text"), i18n("Details"));
+    m_viewMode->addItem(SmallIcon("fileview-text"), i18n("Details"));
     const int index = static_cast<int>(m_viewProps->viewMode());
     m_viewMode->setCurrentIndex(index);
 
@@ -133,7 +137,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
 
     // Only show the following settings if the view properties are remembered
     // for each directory:
-    if (!DolphinSettings::instance().generalSettings()->globalViewProps()) {
+    if (!useGlobalViewProps) {
         // create 'Apply view properties to:' group
         QGroupBox* applyBox = new QGroupBox(i18n("Apply view properties to:"), main);
 
@@ -262,10 +266,8 @@ void ViewPropertiesDialog::applyViewProperties()
         settings->setViewPropsTimestamp(QDateTime::currentDateTime());
 
         // This is also a good chance to make a cleanup of all mirrored view properties:
-        QString basePath = KGlobal::mainComponent().componentName();
-        basePath.append("/view_properties/");
-        const QString mirroredViewProps = KStandardDirs::locateLocal("data", basePath);
-        KIO::NetAccess::del(mirroredViewProps, this);
+        const KUrl mirroredDir = ViewProperties::mirroredDirectory();
+        KIO::NetAccess::del(mirroredDir, this);
     }
 
     m_viewProps->save();
@@ -288,7 +290,6 @@ void ViewPropertiesDialog::applyViewProperties()
         settings->setGlobalViewProps(true);
         ViewProperties defaultProps(m_dolphinView->url());
         defaultProps.setDirProperties(*m_viewProps);
-        kDebug() << "saving global viewprops" << endl;
         defaultProps.save();
         settings->setGlobalViewProps(false);
     }