]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Assure that the startup-settings are applied immediately
authorPeter Penz <peter.penz19@gmail.com>
Fri, 15 Apr 2011 18:52:27 +0000 (20:52 +0200)
committerPeter Penz <peter.penz19@gmail.com>
Fri, 15 Apr 2011 18:53:13 +0000 (20:53 +0200)
src/dolphinmainwindow.cpp
src/dolphinmainwindow.h
src/settings/dolphinsettingsdialog.cpp

index 89ba6e5923b0ab46d0786a68d6cc2df8c538e831..07a3bc153188591d90bfcef246dc209e762d37b2 100644 (file)
@@ -366,39 +366,6 @@ void DolphinMainWindow::showCommand(CommandType command)
     }
 }
 
-void DolphinMainWindow::refreshViews()
-{
-    Q_ASSERT(m_viewTab[m_tabIndex].primaryView);
-
-    // remember the current active view, as because of
-    // the refreshing the active view might change to
-    // the secondary view
-    DolphinViewContainer* activeViewContainer = m_activeViewContainer;
-
-    const int tabCount = m_viewTab.count();
-    for (int i = 0; i < tabCount; ++i) {
-        m_viewTab[i].primaryView->refresh();
-        if (m_viewTab[i].secondaryView) {
-            m_viewTab[i].secondaryView->refresh();
-        }
-    }
-
-    setActiveViewContainer(activeViewContainer);
-
-    const GeneralSettings* generalSettings = DolphinSettings::instance().generalSettings();
-    if (generalSettings->modifiedStartupSettings()) {
-        // The startup settings have been changed by the user (see bug #254947).
-        // Synchronize the split-view setting with the active view:
-        const bool splitView = generalSettings->splitView();
-        const ViewTab& activeTab = m_viewTab[m_tabIndex];
-        const bool toggle =    ( splitView && !activeTab.secondaryView)
-                            || (!splitView &&  activeTab.secondaryView);
-        if (toggle) {
-            toggleSplitView();
-        }
-    }
-}
-
 void DolphinMainWindow::pasteIntoFolder()
 {
     m_activeViewContainer->view()->pasteIntoFolder();
@@ -1131,7 +1098,7 @@ void DolphinMainWindow::editSettings()
     if (!m_settingsDialog) {
         const KUrl url = activeViewContainer()->url();
         DolphinSettingsDialog* settingsDialog = new DolphinSettingsDialog(url, this);
-        connect(settingsDialog, SIGNAL(settingsChanged()), this, SLOT(reloadView()));
+        connect(settingsDialog, SIGNAL(settingsChanged()), this, SLOT(refreshViews()));
         settingsDialog->setAttribute(Qt::WA_DeleteOnClose);
         settingsDialog->show();
         m_settingsDialog = settingsDialog;
@@ -2052,6 +2019,39 @@ void DolphinMainWindow::rememberClosedTab(int index)
     KAcceleratorManager::manage(tabsMenu);
 }
 
+void DolphinMainWindow::refreshViews()
+{
+    Q_ASSERT(m_viewTab[m_tabIndex].primaryView);
+
+    // remember the current active view, as because of
+    // the refreshing the active view might change to
+    // the secondary view
+    DolphinViewContainer* activeViewContainer = m_activeViewContainer;
+
+    const int tabCount = m_viewTab.count();
+    for (int i = 0; i < tabCount; ++i) {
+        m_viewTab[i].primaryView->refresh();
+        if (m_viewTab[i].secondaryView) {
+            m_viewTab[i].secondaryView->refresh();
+        }
+    }
+
+    setActiveViewContainer(activeViewContainer);
+
+    const GeneralSettings* generalSettings = DolphinSettings::instance().generalSettings();
+    if (generalSettings->modifiedStartupSettings()) {
+        // The startup settings have been changed by the user (see bug #254947).
+        // Synchronize the split-view setting with the active view:
+        const bool splitView = generalSettings->splitView();
+        const ViewTab& activeTab = m_viewTab[m_tabIndex];
+        const bool toggle =    ( splitView && !activeTab.secondaryView)
+                            || (!splitView &&  activeTab.secondaryView);
+        if (toggle) {
+            toggleSplitView();
+        }
+    }
+}
+
 void DolphinMainWindow::clearStatusBar()
 {
     m_activeViewContainer->statusBar()->clear();
index ef4d29a5bc3203f8c6ccb5260d3275baf3eceed2..4ba7451258b96b92fdba4564d5b653d8206e34b4 100644 (file)
@@ -98,12 +98,6 @@ public:
     /** Renames the item represented by \a oldUrl to \a newUrl. */
     void rename(const KUrl& oldUrl, const KUrl& newUrl);
 
-    /**
-     * Refreshes the views of the main window by recreating them according to
-     * the given Dolphin settings.
-     */
-    void refreshViews();
-
     /**
      * Returns the 'Create New...' sub menu which also can be shared
      * with other menus (e. g. a context menu).
@@ -166,6 +160,12 @@ protected:
     virtual void readProperties(const KConfigGroup& group);
 
 private slots:
+    /**
+     * Refreshes the views of the main window by recreating them according to
+     * the given Dolphin settings.
+     */
+    void refreshViews();
+
     void clearStatusBar();
 
     /** Updates the 'Create New...' sub menu. */
index b1988ddc1e558290faa002025509ae6417ce8153..79a241acabd3f084c2b21bc7a2e93013a2a9be47 100644 (file)
@@ -130,17 +130,17 @@ void DolphinSettingsDialog::applySettings()
         page->applySettings();
     }
 
+    emit settingsChanged();
+
     GeneralSettings* settings = DolphinSettings::instance().generalSettings();
     if (settings->modifiedStartupSettings()) {
         // Reset the modified startup settings hint. The changed startup settings
-        // have been applied already in app()->refreshMainWindows().
+        // have been applied already due to emitting settingsChanged().
         settings->setModifiedStartupSettings(false);
         settings->writeConfig();
     }
 
     enableButtonApply(false);
-
-    emit settingsChanged();
 }
 
 void DolphinSettingsDialog::restoreDefaults()