]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/settings/startupsettingspage.cpp
Added the Trash KCM to Dolphin, it's visible in the Settings Dialog, in the 'Trash...
[dolphin.git] / src / settings / startupsettingspage.cpp
index 767fcab667ffda49134bfe37765912da575bb174..fd79debc3803a20739e44c1d740a6b5ab3d0806b 100644 (file)
@@ -39,9 +39,9 @@
 #include <QPushButton>
 #include <QRadioButton>
 
-StartupSettingsPage::StartupSettingsPage(DolphinMainWindow* mainWin, QWidget* parent) :
+StartupSettingsPage::StartupSettingsPage(const KUrl& url, QWidget* parent) :
     SettingsPageBase(parent),
-    m_mainWindow(mainWin),
+    m_url(url),
     m_homeUrl(0),
     m_splitView(0),
     m_editableUrl(0),
@@ -82,7 +82,7 @@ StartupSettingsPage::StartupSettingsPage(DolphinMainWindow* mainWin, QWidget* pa
     homeBoxLayout->addWidget(homeUrlBox);
     homeBoxLayout->addWidget(buttonBox);
 
-    // create 'Split view', 'Editable location' and 'Filter bar' checkboxes
+    // create 'Split view', 'Show full path', 'Editable location' and 'Filter bar' checkboxes
     m_splitView = new QCheckBox(i18nc("@option:check Startup Settings", "Split view mode"), vBox);
     m_editableUrl = new QCheckBox(i18nc("@option:check Startup Settings", "Editable location bar"), vBox);
     m_showFullPath = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path inside location bar"), vBox);
@@ -119,7 +119,7 @@ void StartupSettingsPage::applySettings()
     if (url.isValid() && fileItem.isDir()) {
         settings->setHomeUrl(url.prettyUrl());
     } else {
-        KMessageBox::error(this, i18nc("@info", "The location for the home folder is invalid and will not be applied."));
+        KMessageBox::error(this, i18nc("@info", "The location for the home folder is invalid or does not exist, it will not be applied."));
     }
 
     settings->setSplitView(m_splitView->isChecked());
@@ -131,8 +131,9 @@ void StartupSettingsPage::applySettings()
 void StartupSettingsPage::restoreDefaults()
 {
     GeneralSettings* settings = DolphinSettings::instance().generalSettings();
-    settings->setDefaults();
+    settings->useDefaults(true);
     loadSettings();
+    settings->useDefaults(false);
 }
 
 void StartupSettingsPage::selectHomeUrl()
@@ -147,19 +148,20 @@ void StartupSettingsPage::selectHomeUrl()
 
 void StartupSettingsPage::useCurrentLocation()
 {
-    const DolphinView* view = m_mainWindow->activeViewContainer()->view();
-    m_homeUrl->setText(view->url().prettyUrl());
+    m_homeUrl->setText(m_url.prettyUrl());
 }
 
 void StartupSettingsPage::useDefaultLocation()
 {
-    m_homeUrl->setText(QDir::homePath());
+   KUrl url(QDir::homePath());
+    m_homeUrl->setText(url.prettyUrl());
 }
 
 void StartupSettingsPage::loadSettings()
 {
     GeneralSettings* settings = DolphinSettings::instance().generalSettings();
-    m_homeUrl->setText(settings->homeUrl());
+    KUrl url(settings->homeUrl());
+    m_homeUrl->setText(url.prettyUrl());
     m_splitView->setChecked(settings->splitView());
     m_editableUrl->setChecked(settings->editableUrl());
     m_showFullPath->setChecked(settings->showFullPath());