]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/viewpropertiesdialog.cpp
Fixing autogenerated headers includes
[dolphin.git] / src / viewpropertiesdialog.cpp
index eceaf8048a594c4d28c3b84231e643a65c7d2850..f6578a511ae4882665e460b80fd275a371ed56b8 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,7 +73,10 @@ 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);
@@ -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);
     }