diff options
| author | Peter Penz <[email protected]> | 2012-01-14 21:44:50 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-01-14 21:46:07 +0100 |
| commit | 538d9bf43f4164179f57495e582ef1f44331fde4 (patch) | |
| tree | 00c4cede6214f221fa249d883f8c0ea9e0ce5ce1 | |
| parent | 9da248fa267f4d9e85cc12c1afbe859e4de7c233 (diff) | |
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.
| -rw-r--r-- | src/views/dolphinitemlistcontainer.cpp | 13 | ||||
| -rw-r--r-- | src/views/dolphinitemlistcontainer.h | 6 | ||||
| -rw-r--r-- | src/views/dolphinview.cpp | 3 |
3 files changed, 19 insertions, 3 deletions
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<int>)), this, SLOT(slotItemsActivated(QSet<int>))); connect(controller, SIGNAL(itemMiddleClicked(int)), this, SLOT(slotItemMiddleClicked(int))); |
