diff options
Diffstat (limited to 'src/views')
| -rw-r--r-- | src/views/dolphinitemlistcontainer.cpp | 15 | ||||
| -rw-r--r-- | src/views/dolphinitemlistcontainer.h | 6 | ||||
| -rw-r--r-- | src/views/dolphinview.cpp | 10 | ||||
| -rw-r--r-- | src/views/dolphinview.h | 12 |
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 |
