]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Synchronize view-mode settings before the settings dialog gets opened
authorPeter Penz <peter.penz19@gmail.com>
Mon, 30 Jan 2012 15:36:40 +0000 (16:36 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Mon, 30 Jan 2012 15:38:24 +0000 (16:38 +0100)
BUG: 292698
FIXED-IN: 4.8.1

src/dolphinmainwindow.cpp
src/dolphinpart.cpp
src/dolphinviewcontainer.cpp
src/dolphinviewcontainer.h
src/settings/viewmodes/viewsettingstab.cpp
src/statusbar/dolphinstatusbar.cpp
src/statusbar/dolphinstatusbar.h
src/views/dolphinitemlistcontainer.cpp
src/views/dolphinitemlistcontainer.h
src/views/dolphinview.cpp
src/views/dolphinview.h

index 74b751f5adaa9938b5250d0f9f2662b240f10a63..074185f49764f25461c6f2bd0680ac9942eeb42f 100644 (file)
@@ -1118,7 +1118,10 @@ void DolphinMainWindow::openTerminal()
 void DolphinMainWindow::editSettings()
 {
     if (!m_settingsDialog) {
-        const KUrl url = activeViewContainer()->url();
+        DolphinViewContainer* container = activeViewContainer();
+        container->view()->writeSettings();
+        
+        const KUrl url = container->url();
         DolphinSettingsDialog* settingsDialog = new DolphinSettingsDialog(url, this);
         connect(settingsDialog, SIGNAL(settingsChanged()), this, SLOT(refreshViews()));
         settingsDialog->setAttribute(Qt::WA_DeleteOnClose);
@@ -2066,9 +2069,9 @@ void DolphinMainWindow::refreshViews()
 
     const int tabCount = m_viewTab.count();
     for (int i = 0; i < tabCount; ++i) {
-        m_viewTab[i].primaryView->refresh();
+        m_viewTab[i].primaryView->readSettings();
         if (m_viewTab[i].secondaryView) {
-            m_viewTab[i].secondaryView->refresh();
+            m_viewTab[i].secondaryView->readSettings();
         }
     }
 
index 6c6683d91c1bf8243900b0fb424e10d9e2e6b425..8720e0ce2202ae035b43ad2f4b3e86e3c2b3cab8 100644 (file)
@@ -591,7 +591,7 @@ void DolphinPartBrowserExtension::pasteTo(const KUrl&)
 
 void DolphinPartBrowserExtension::reparseConfiguration()
 {
-    m_part->view()->refresh();
+    m_part->view()->readSettings();
 }
 
 ////
index 72c943eb4a77865258b17d4467fdf13b7bcff5bd..2d2e20ff644726e7b535418d8cb350ad76532c41 100644 (file)
@@ -211,7 +211,7 @@ DolphinSearchBox* DolphinViewContainer::searchBox()
     return m_searchBox;
 }
 
-void DolphinViewContainer::refresh()
+void DolphinViewContainer::readSettings()
 {
     if (GeneralSettings::modifiedStartupSettings()) {
         // The startup settings should only get applied if they have been
@@ -222,8 +222,8 @@ void DolphinViewContainer::refresh()
         setFilterBarVisible(GeneralSettings::filterBar());
     }
 
-    m_view->refresh();
-    m_statusBar->refresh();
+    m_view->readSettings();
+    m_statusBar->readSettings();
 }
 
 bool DolphinViewContainer::isFilterBarVisible() const
index ee9f83dea17cc973bf53857956df4f102b347ba3..59b3c79eddbde1da152977a8590012065e2eeb1c 100644 (file)
@@ -86,7 +86,7 @@ public:
     /**
      * Refreshes the view container to get synchronized with the (updated) Dolphin settings.
      */
-    void refresh();
+    void readSettings();
 
     /** Returns true, if the filter bar is visible. */
     bool isFilterBarVisible() const;
index b5cacf787a1cf392a8a72cf12e12b25b997a4f47..47aad7dd2a3efa2749ceb82147477d3c278b1d6f 100644 (file)
@@ -155,7 +155,9 @@ void ViewSettingsTab::loadSettings()
         m_textWidthBox->setCurrentIndex(IconsModeSettings::textWidthIndex());
     }
 
-    const ViewModeSettings settings(viewMode());
+    ViewModeSettings settings(viewMode());
+    settings.readConfig();
+    
     const QSize iconSize(settings.iconSize(), settings.iconSize());
     m_defaultSizeSlider->setValue(ZoomLevelInfo::zoomLevelForIconSize(iconSize));
 
index c733ebe027bf8dd0915a79852de67ed362878adb..b01f6042cb815358dda5a8f29979d675c1278730 100644 (file)
@@ -254,7 +254,7 @@ QString DolphinStatusBar::defaultText() const
     return m_messageLabel->defaultText();
 }
 
-void DolphinStatusBar::refresh()
+void DolphinStatusBar::readSettings()
 {
     setExtensionsVisible(true);
 }
index 32d603ac581b26c0ec48c5edde6f8a5edba09cea..789656b8efd0ec2274f3782736bd876cab1e6b11 100644 (file)
@@ -112,7 +112,7 @@ public:
     /**
      * Refreshes the status bar to get synchronized with the (updated) Dolphin settings.
      */
-    void refresh();
+    void readSettings();
 
 signals:
     /**
index 7c32f982a839ada24d70ee8a8eab7e5300d17ff8..c687ede4d4a4702393ee542bcc483800806c2547 100644 (file)
@@ -59,10 +59,8 @@ DolphinItemListContainer::DolphinItemListContainer(KDirLister* dirLister,
 
 DolphinItemListContainer::~DolphinItemListContainer()
 {
-    IconsModeSettings::self()->writeConfig();
-    CompactModeSettings::self()->writeConfig();
-    DetailsModeSettings::self()->writeConfig();
-
+    writeSettings();
+    
     controller()->setView(0);
     delete m_fileItemListView;
     m_fileItemListView = 0;
@@ -170,7 +168,7 @@ void DolphinItemListContainer::endTransaction()
     m_fileItemListView->endTransaction();
 }
 
-void DolphinItemListContainer::refresh()
+void DolphinItemListContainer::readSettings()
 {
     ViewModeSettings settings(viewMode());
     settings.readConfig();
@@ -192,6 +190,13 @@ void DolphinItemListContainer::refresh()
     endTransaction();
 }
 
+void DolphinItemListContainer::writeSettings()
+{  
+    IconsModeSettings::self()->writeConfig();
+    CompactModeSettings::self()->writeConfig();
+    DetailsModeSettings::self()->writeConfig();
+}
+
 void DolphinItemListContainer::updateGridSize()
 {
     const ViewModeSettings settings(viewMode());
index 251552cc8d7f8582a247b2e4f405661755469a27..fa816b48c34b53593610a24c22d7b3d4a0a0df29 100644 (file)
@@ -64,10 +64,8 @@ public:
     void beginTransaction();
     void endTransaction();
 
-    /**
-     * Refreshs the view by reapplying the (changed) viewmode settings.
-     */
-    void refresh();
+    void readSettings();   
+    void writeSettings();
 
 private:
     void updateGridSize();
index 1e300c5cf25331129eecb2ec9fee969ca6e62594..ef39414c9f61980818b3c977a6242b30b73e350a 100644 (file)
@@ -446,13 +446,19 @@ void DolphinView::stopLoading()
     m_dirLister->stop();
 }
 
-void DolphinView::refresh()
+void DolphinView::readSettings()
 {
     GeneralSettings::self()->readConfig();
-    m_container->refresh();
+    m_container->readSettings();
     applyViewProperties();
 }
 
+void DolphinView::writeSettings()
+{
+    GeneralSettings::self()->writeConfig();
+    m_container->writeSettings();
+}
+
 void DolphinView::setNameFilter(const QString& nameFilter)
 {
     fileItemModel()->setNameFilter(nameFilter);
index 197a41046dce694b2ddc3933383d34e611fa65b4..56ebbe402cb608418e1292d5ce1d56ab7df20eb7 100644 (file)
@@ -265,11 +265,15 @@ public:
     void stopLoading();
 
     /**
-     * Refreshes the view to get synchronized with the (updated) Dolphin settings.
-     * This method only needs to get invoked if the view settings for the Icons View,
-     * Details View or Columns View have been changed.
+     * Refreshes the view to get synchronized with the settings (e.g. icons size,
+     * font, ...).
      */
-    void refresh();
+    void readSettings();
+    
+    /**
+     * Saves the current settings (e.g. icons size, font, ..).
+     */
+    void writeSettings();
 
     /**
      * Filters the currently shown items by \a nameFilter. All items