]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix "general settings" issues
authorPeter Penz <peter.penz19@gmail.com>
Sat, 14 Jan 2012 20:44:50 +0000 (21:44 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 14 Jan 2012 20:46:07 +0000 (21:46 +0100)
If the general settings for the "selection toggle" or "expanding folders during
drag operations" are changed, those changes must be applied to the engine.

src/views/dolphinitemlistcontainer.cpp
src/views/dolphinitemlistcontainer.h
src/views/dolphinview.cpp

index 9e7a15f742683da6b72cb702253419a9e553fc45..d28aa363f63af3a353d6fa2036e18a06b6c57812 100644 (file)
@@ -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;
index d91b96a344048d787989255f9ec11f5468bbf622..251552cc8d7f8582a247b2e4f405661755469a27 100644 (file)
@@ -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:
index a31bf566dc920e9684cc099138c5bf65825fa3cc..83d80012cbca8c36b8da3dfa489a5894c218f45c 100644 (file)
@@ -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)));