From: Peter Penz Date: Sat, 14 Jan 2012 20:44:50 +0000 (+0100) Subject: Fix "general settings" issues X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/538d9bf43f4164179f57495e582ef1f44331fde4 Fix "general settings" issues If the general settings for the "selection toggle" or "expanding folders during drag operations" are changed, those changes must be applied to the engine. --- diff --git a/src/views/dolphinitemlistcontainer.cpp b/src/views/dolphinitemlistcontainer.cpp index 9e7a15f74..d28aa363f 100644 --- a/src/views/dolphinitemlistcontainer.cpp +++ b/src/views/dolphinitemlistcontainer.cpp @@ -52,6 +52,7 @@ DolphinItemListContainer::DolphinItemListContainer(KDirLister* dirLister, m_fileItemListView->setEnabledSelectionToggles(GeneralSettings::showSelectionToggle()); controller()->setView(m_fileItemListView); + updateAutoActivationDelay(); updateFont(); updateGridSize(); } @@ -174,6 +175,10 @@ void DolphinItemListContainer::refresh() ViewModeSettings settings(viewMode()); settings.readConfig(); + beginTransaction(); + + m_fileItemListView->setEnabledSelectionToggles(GeneralSettings::showSelectionToggle()); + updateAutoActivationDelay(); updateFont(); updateGridSize(); @@ -183,6 +188,8 @@ void DolphinItemListContainer::refresh() << "imagethumbnail" << "jpegthumbnail"); m_fileItemListView->setEnabledPlugins(plugins); + + endTransaction(); } void DolphinItemListContainer::updateGridSize() @@ -247,6 +254,12 @@ void DolphinItemListContainer::updateFont() m_fileItemListView->setStyleOption(styleOption); } +void DolphinItemListContainer::updateAutoActivationDelay() +{ + const int delay = GeneralSettings::autoExpandFolders() ? 750 : -1; + controller()->setAutoActivationDelay(delay); +} + ViewModeSettings::ViewMode DolphinItemListContainer::viewMode() const { ViewModeSettings::ViewMode mode; diff --git a/src/views/dolphinitemlistcontainer.h b/src/views/dolphinitemlistcontainer.h index d91b96a34..251552cc8 100644 --- a/src/views/dolphinitemlistcontainer.h +++ b/src/views/dolphinitemlistcontainer.h @@ -73,6 +73,12 @@ private: void updateGridSize(); void updateFont(); + /** + * Updates the auto activation delay of the itemlist controller + * dependent on the 'autoExpand' setting from the general settings. + */ + void updateAutoActivationDelay(); + ViewModeSettings::ViewMode viewMode() const; private: diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index a31bf566d..83d80012c 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -137,9 +137,6 @@ DolphinView::DolphinView(const KUrl& url, QWidget* parent) : KItemListController* controller = m_container->controller(); controller->setSelectionBehavior(KItemListController::MultiSelection); - if (GeneralSettings::autoExpandFolders()) { - controller->setAutoActivationDelay(750); - } connect(controller, SIGNAL(itemActivated(int)), this, SLOT(slotItemActivated(int))); connect(controller, SIGNAL(itemsActivated(QSet)), this, SLOT(slotItemsActivated(QSet))); connect(controller, SIGNAL(itemMiddleClicked(int)), this, SLOT(slotItemMiddleClicked(int)));