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);
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();
}
}
void DolphinPartBrowserExtension::reparseConfiguration()
{
- m_part->view()->refresh();
+ m_part->view()->readSettings();
}
////
return m_searchBox;
}
-void DolphinViewContainer::refresh()
+void DolphinViewContainer::readSettings()
{
if (GeneralSettings::modifiedStartupSettings()) {
// The startup settings should only get applied if they have been
setFilterBarVisible(GeneralSettings::filterBar());
}
- m_view->refresh();
- m_statusBar->refresh();
+ m_view->readSettings();
+ m_statusBar->readSettings();
}
bool DolphinViewContainer::isFilterBarVisible() const
/**
* 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;
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));
return m_messageLabel->defaultText();
}
-void DolphinStatusBar::refresh()
+void DolphinStatusBar::readSettings()
{
setExtensionsVisible(true);
}
/**
* Refreshes the status bar to get synchronized with the (updated) Dolphin settings.
*/
- void refresh();
+ void readSettings();
signals:
/**
DolphinItemListContainer::~DolphinItemListContainer()
{
- IconsModeSettings::self()->writeConfig();
- CompactModeSettings::self()->writeConfig();
- DetailsModeSettings::self()->writeConfig();
-
+ writeSettings();
+
controller()->setView(0);
delete m_fileItemListView;
m_fileItemListView = 0;
m_fileItemListView->endTransaction();
}
-void DolphinItemListContainer::refresh()
+void DolphinItemListContainer::readSettings()
{
ViewModeSettings settings(viewMode());
settings.readConfig();
endTransaction();
}
+void DolphinItemListContainer::writeSettings()
+{
+ IconsModeSettings::self()->writeConfig();
+ CompactModeSettings::self()->writeConfig();
+ DetailsModeSettings::self()->writeConfig();
+}
+
void DolphinItemListContainer::updateGridSize()
{
const ViewModeSettings settings(viewMode());
void beginTransaction();
void endTransaction();
- /**
- * Refreshs the view by reapplying the (changed) viewmode settings.
- */
- void refresh();
+ void readSettings();
+ void writeSettings();
private:
void updateGridSize();
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);
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