]> cloud.milkyroute.net Git - dolphin.git/commitdiff
* clear the selection toggle when zooming in or out
authorPeter Penz <peter.penz19@gmail.com>
Wed, 16 Apr 2008 21:08:09 +0000 (21:08 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 16 Apr 2008 21:08:09 +0000 (21:08 +0000)
* clear the selection toggle when using the scroll wheel (this is only a temporary workaround until Qt-issue #200665 has been fixed)

BUG: 159737

svn path=/trunk/KDE/kdebase/apps/; revision=797808

src/dolphincolumnwidget.cpp
src/dolphincolumnwidget.h
src/dolphindetailsview.cpp
src/dolphindetailsview.h
src/dolphiniconsview.cpp
src/dolphiniconsview.h

index ee051ff1acb325a0c6ed1d6e8a14b3df320c4fd6..cf2ae7656b57ef15d671e2190f16c543436be12e 100644 (file)
@@ -53,6 +53,7 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent,
     QListView(parent),
     m_active(true),
     m_view(columnView),
+    m_selectionManager(0),
     m_url(url),
     m_childUrl(),
     m_font(),
@@ -125,11 +126,11 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent,
     const bool useSelManager = KGlobalSettings::singleClick() &&
                                DolphinSettings::instance().generalSettings()->showSelectionToggle();
     if (useSelManager) {
-        SelectionManager* selManager = new SelectionManager(this);
-        connect(selManager, SIGNAL(selectionChanged()),
+        m_selectionManager = new SelectionManager(this);
+        connect(m_selectionManager, SIGNAL(selectionChanged()),
                 this, SLOT(requestActivation()));
         connect(m_view->m_controller, SIGNAL(urlChanged(const KUrl&)),
-                selManager, SLOT(reset()));
+                m_selectionManager, SLOT(reset()));
     }
 
     new KMimeTypeResolver(this, m_dolphinModel);
@@ -163,6 +164,9 @@ void DolphinColumnWidget::setDecorationSize(const QSize& size)
     if (m_iconManager != 0) {
         m_iconManager->updatePreviews();
     }
+    if (m_selectionManager != 0) {
+        m_selectionManager->reset();
+    }
 }
 
 void DolphinColumnWidget::setActive(bool active)
@@ -365,11 +369,16 @@ void DolphinColumnWidget::contextMenuEvent(QContextMenuEvent* event)
 
 void DolphinColumnWidget::wheelEvent(QWheelEvent* event)
 {
+    if (m_selectionManager != 0) {
+        m_selectionManager->reset();
+    }
+
     // let Ctrl+wheel events propagate to the DolphinView for icon zooming
     if (event->modifiers() & Qt::ControlModifier) {
         event->ignore();
         return;
     }
+
     QListView::wheelEvent(event);
 }
 
index e51ff5d97cbfda35333d6c9090fc5c359e2e996d..ada7d637a2571cecc9669ea403686abc37e6cbc3 100644 (file)
@@ -37,6 +37,7 @@ class KDirLister;
 class KJob;
 class KFileItem;
 class KFileItemList;
+class SelectionManager;
 class QPixmap;
 
 /**
@@ -133,6 +134,7 @@ private:
 private:
     bool m_active;
     DolphinColumnView* m_view;
+    SelectionManager* m_selectionManager;
     KUrl m_url;      // URL of the directory that is shown
     KUrl m_childUrl; // URL of the next column that is shown
 
index aef034df176e3fce11100427a0295d9fe2b84d52..08d03fb0b5effc6a8b6013f70468caa7dd5d43eb 100644 (file)
@@ -47,6 +47,7 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr
     QTreeView(parent),
        m_autoResize(true),
     m_controller(controller),
+    m_selectionManager(0),
     m_font(),
     m_decorationSize(),
     m_showElasticBand(false),
@@ -98,12 +99,12 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr
         connect(this, SIGNAL(clicked(const QModelIndex&)),
                 controller, SLOT(triggerItem(const QModelIndex&)));
         if (DolphinSettings::instance().generalSettings()->showSelectionToggle()) {
-            SelectionManager* selManager = new SelectionManager(this);
-            connect(selManager, SIGNAL(selectionChanged()),
+            m_selectionManager = new SelectionManager(this);
+            connect(m_selectionManager, SIGNAL(selectionChanged()),
                     this, SLOT(requestActivation()));
             connect(m_controller, SIGNAL(urlChanged(const KUrl&)),
-                    selManager, SLOT(reset()));
-        }
+                    m_selectionManager, SLOT(reset()));
+         }
     } else {
         connect(this, SIGNAL(doubleClicked(const QModelIndex&)),
                 controller, SLOT(triggerItem(const QModelIndex&)));
@@ -345,11 +346,16 @@ void DolphinDetailsView::resizeEvent(QResizeEvent* event)
 
 void DolphinDetailsView::wheelEvent(QWheelEvent* event)
 {
+    if (m_selectionManager != 0) {
+        m_selectionManager->reset();
+    }
+
     // let Ctrl+wheel events propagate to the DolphinView for icon zooming
     if (event->modifiers() & Qt::ControlModifier) {
         event->ignore();
         return;
     }
+
     QTreeView::wheelEvent(event);
 }
 
@@ -555,6 +561,10 @@ void DolphinDetailsView::updateDecorationSize()
     m_controller->setZoomInPossible(isZoomInPossible());
     m_controller->setZoomOutPossible(isZoomOutPossible());
 
+    if (m_selectionManager != 0) {
+        m_selectionManager->reset();
+    }
+
     doItemsLayout();
 }
 
index a92e113dd9041c8337a8a6c966a32476792b2d4a..829e5396775ccd053d65880f23d54f0c5294412e 100644 (file)
@@ -26,6 +26,7 @@
 #include <libdolphin_export.h>
 
 class DolphinController;
+class SelectionManager;
 
 /**
  * @brief Represents the details view which shows the name, size,
@@ -158,6 +159,7 @@ private:
        bool m_autoResize;  // if true, the columns are resized automatically to the available width
 
     DolphinController* m_controller;
+    SelectionManager* m_selectionManager;
 
     QFont m_font;
     QSize m_decorationSize;
index 7b9ddd6ac55485d3fafaa5650505d5905233ff3a..a9659739a99ce3979aaec90124964268ae0e81ac 100644 (file)
@@ -41,6 +41,7 @@
 DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controller) :
     KCategorizedView(parent),
     m_controller(controller),
+    m_selectionManager(0),
     m_categoryDrawer(0),
     m_font(),
     m_decorationSize(),
@@ -68,11 +69,11 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle
         connect(this, SIGNAL(clicked(const QModelIndex&)),
                 controller, SLOT(triggerItem(const QModelIndex&)));
         if (DolphinSettings::instance().generalSettings()->showSelectionToggle()) {
-            SelectionManager* selManager = new SelectionManager(this);
-            connect(selManager, SIGNAL(selectionChanged()),
+            m_selectionManager = new SelectionManager(this);
+            connect(m_selectionManager, SIGNAL(selectionChanged()),
                     this, SLOT(requestActivation()));
             connect(m_controller, SIGNAL(urlChanged(const KUrl&)),
-                    selManager, SLOT(reset()));
+                    m_selectionManager, SLOT(reset()));
         }
     } else {
         connect(this, SIGNAL(doubleClicked(const QModelIndex&)),
@@ -247,6 +248,10 @@ void DolphinIconsView::keyPressEvent(QKeyEvent* event)
 
 void DolphinIconsView::wheelEvent(QWheelEvent* event)
 {
+    if (m_selectionManager != 0) {
+        m_selectionManager->reset();
+    }
+
     // let Ctrl+wheel events propagate to the DolphinView for icon zooming
     if (event->modifiers() & Qt::ControlModifier) {
         event->ignore();
@@ -453,6 +458,10 @@ void DolphinIconsView::updateGridSize(bool showPreview, int additionalInfoCount)
     if (delegate != 0) {
         delegate->setMaximumSize(m_itemSize);
     }
+
+    if (m_selectionManager != 0) {
+        m_selectionManager->reset();
+    }
 }
 
 int DolphinIconsView::additionalInfoCount() const
index 56d492ce1d301d5279b58bae3e3ccfe7b7efa084..7ada661a4d8655ab1ce0fb0c94c27ec1b3335cec 100644 (file)
@@ -32,6 +32,7 @@
 #include <libdolphin_export.h>
 
 class DolphinController;
+class SelectionManager;
 class DolphinCategoryDrawer;
 
 /**
@@ -97,6 +98,7 @@ private:
 
 private:
     DolphinController* m_controller;
+    SelectionManager* m_selectionManager;
     DolphinCategoryDrawer* m_categoryDrawer;
 
     QFont m_font;