┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-01-30 16:36:40 +0100
committerPeter Penz <[email protected]>2012-01-30 16:38:11 +0100
commit60bd873e9f42d22f2d4dae8d1ed43ebbc23c600f (patch)
tree74355713af87d639b498292b712088b96ce1c272 /src/views
parent670655f448b25a53f075ed1e61e64ab85deaee12 (diff)
Synchronize view-mode settings before the settings dialog gets opened
BUG: 292698 FIXED-IN: 4.8.1
Diffstat (limited to 'src/views')
-rw-r--r--src/views/dolphinitemlistcontainer.cpp15
-rw-r--r--src/views/dolphinitemlistcontainer.h6
-rw-r--r--src/views/dolphinview.cpp10
-rw-r--r--src/views/dolphinview.h12
4 files changed, 28 insertions, 15 deletions
diff --git a/src/views/dolphinitemlistcontainer.cpp b/src/views/dolphinitemlistcontainer.cpp
index 7c32f982a..c687ede4d 100644
--- a/src/views/dolphinitemlistcontainer.cpp
+++ b/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/src/views/dolphinitemlistcontainer.h b/src/views/dolphinitemlistcontainer.h
index 251552cc8..fa816b48c 100644
--- a/src/views/dolphinitemlistcontainer.h
+++ b/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/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 1e300c5cf..ef39414c9 100644
--- a/src/views/dolphinview.cpp
+++ b/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/src/views/dolphinview.h b/src/views/dolphinview.h
index 197a41046..56ebbe402 100644
--- a/src/views/dolphinview.h
+++ b/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