summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <peter.penz19@gmail.com>2012-01-30 15:36:40 (GMT)
committerPeter Penz <peter.penz19@gmail.com>2012-01-30 15:38:11 (GMT)
commit02e3235275ca2d58daa4fb5ca16b2ffc63016fd7 (patch)
tree60e56bfc0583743dd1e0cb750188c60bf93a3153
parent437c23a56a6bb8d76405007fc426bdacaa30632f (diff)
Synchronize view-mode settings before the settings dialog gets opened
BUG: 292698 FIXED-IN: 4.8.1
-rw-r--r--dolphin/src/dolphinmainwindow.cpp9
-rw-r--r--dolphin/src/dolphinpart.cpp2
-rw-r--r--dolphin/src/dolphinviewcontainer.cpp6
-rw-r--r--dolphin/src/dolphinviewcontainer.h2
-rw-r--r--dolphin/src/settings/viewmodes/viewsettingstab.cpp4
-rw-r--r--dolphin/src/statusbar/dolphinstatusbar.cpp2
-rw-r--r--dolphin/src/statusbar/dolphinstatusbar.h2
-rw-r--r--dolphin/src/views/dolphinitemlistcontainer.cpp15
-rw-r--r--dolphin/src/views/dolphinitemlistcontainer.h6
-rw-r--r--dolphin/src/views/dolphinview.cpp10
-rw-r--r--dolphin/src/views/dolphinview.h12
11 files changed, 44 insertions, 26 deletions
diff --git a/dolphin/src/dolphinmainwindow.cpp b/dolphin/src/dolphinmainwindow.cpp
index 74b751f..074185f 100644
--- a/dolphin/src/dolphinmainwindow.cpp
+++ b/dolphin/src/dolphinmainwindow.cpp
@@ -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();
}
}
diff --git a/dolphin/src/dolphinpart.cpp b/dolphin/src/dolphinpart.cpp
index 6c6683d..8720e0c 100644
--- a/dolphin/src/dolphinpart.cpp
+++ b/dolphin/src/dolphinpart.cpp
@@ -591,7 +591,7 @@ void DolphinPartBrowserExtension::pasteTo(const KUrl&)
void DolphinPartBrowserExtension::reparseConfiguration()
{
- m_part->view()->refresh();
+ m_part->view()->readSettings();
}
////
diff --git a/dolphin/src/dolphinviewcontainer.cpp b/dolphin/src/dolphinviewcontainer.cpp
index 72c943e..2d2e20f 100644
--- a/dolphin/src/dolphinviewcontainer.cpp
+++ b/dolphin/src/dolphinviewcontainer.cpp
@@ -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
diff --git a/dolphin/src/dolphinviewcontainer.h b/dolphin/src/dolphinviewcontainer.h
index ee9f83d..59b3c79 100644
--- a/dolphin/src/dolphinviewcontainer.h
+++ b/dolphin/src/dolphinviewcontainer.h
@@ -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;
diff --git a/dolphin/src/settings/viewmodes/viewsettingstab.cpp b/dolphin/src/settings/viewmodes/viewsettingstab.cpp
index b5cacf7..47aad7d 100644
--- a/dolphin/src/settings/viewmodes/viewsettingstab.cpp
+++ b/dolphin/src/settings/viewmodes/viewsettingstab.cpp
@@ -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));
diff --git a/dolphin/src/statusbar/dolphinstatusbar.cpp b/dolphin/src/statusbar/dolphinstatusbar.cpp
index c733ebe..b01f604 100644
--- a/dolphin/src/statusbar/dolphinstatusbar.cpp
+++ b/dolphin/src/statusbar/dolphinstatusbar.cpp
@@ -254,7 +254,7 @@ QString DolphinStatusBar::defaultText() const
return m_messageLabel->defaultText();
}
-void DolphinStatusBar::refresh()
+void DolphinStatusBar::readSettings()
{
setExtensionsVisible(true);
}
diff --git a/dolphin/src/statusbar/dolphinstatusbar.h b/dolphin/src/statusbar/dolphinstatusbar.h
index 32d603a..789656b 100644
--- a/dolphin/src/statusbar/dolphinstatusbar.h
+++ b/dolphin/src/statusbar/dolphinstatusbar.h
@@ -112,7 +112,7 @@ public:
/**
* Refreshes the status bar to get synchronized with the (updated) Dolphin settings.
*/
- void refresh();
+ void readSettings();
signals:
/**
diff --git a/dolphin/src/views/dolphinitemlistcontainer.cpp b/dolphin/src/views/dolphinitemlistcontainer.cpp
index 7c32f98..c687ede 100644
--- a/dolphin/src/views/dolphinitemlistcontainer.cpp
+++ b/dolphin/src/views/dolphinitemlistcontainer.cpp
@@ -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());
diff --git a/dolphin/src/views/dolphinitemlistcontainer.h b/dolphin/src/views/dolphinitemlistcontainer.h
index 251552c..fa816b4 100644
--- a/dolphin/src/views/dolphinitemlistcontainer.h
+++ b/dolphin/src/views/dolphinitemlistcontainer.h
@@ -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();
diff --git a/dolphin/src/views/dolphinview.cpp b/dolphin/src/views/dolphinview.cpp
index 1e300c5..ef39414 100644
--- a/dolphin/src/views/dolphinview.cpp
+++ b/dolphin/src/views/dolphinview.cpp
@@ -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);
diff --git a/dolphin/src/views/dolphinview.h b/dolphin/src/views/dolphinview.h
index 197a410..56ebbe4 100644
--- a/dolphin/src/views/dolphinview.h
+++ b/dolphin/src/views/dolphinview.h
@@ -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