┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-01-14 21:44:50 +0100
committerPeter Penz <[email protected]>2012-01-14 21:46:41 +0100
commitfcfb636ffe40065c46e44c7d987342826409f609 (patch)
tree3f191daed76ec6ef8fc21fb29a0baba9469cf1e3
parenta0115f912a9dbfe101b996bbe773bf5db81d2987 (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.cpp13
-rw-r--r--src/views/dolphinitemlistcontainer.h6
-rw-r--r--src/views/dolphinview.cpp3
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)));