diff --git a/src/dolphincolumnwidget.cpp b/src/dolphincolumnwidget.cpp index ee051ff1ac..cf2ae7656b 100644 --- a/src/dolphincolumnwidget.cpp +++ b/src/dolphincolumnwidget.cpp @@ -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); } diff --git a/src/dolphincolumnwidget.h b/src/dolphincolumnwidget.h index e51ff5d97c..ada7d637a2 100644 --- a/src/dolphincolumnwidget.h +++ b/src/dolphincolumnwidget.h @@ -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 diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index aef034df17..08d03fb0b5 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -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(); } diff --git a/src/dolphindetailsview.h b/src/dolphindetailsview.h index a92e113dd9..829e539677 100644 --- a/src/dolphindetailsview.h +++ b/src/dolphindetailsview.h @@ -26,6 +26,7 @@ #include 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; diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp index 7b9ddd6ac5..a9659739a9 100644 --- a/src/dolphiniconsview.cpp +++ b/src/dolphiniconsview.cpp @@ -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 diff --git a/src/dolphiniconsview.h b/src/dolphiniconsview.h index 56d492ce1d..7ada661a4d 100644 --- a/src/dolphiniconsview.h +++ b/src/dolphiniconsview.h @@ -32,6 +32,7 @@ #include class DolphinController; +class SelectionManager; class DolphinCategoryDrawer; /** @@ -97,6 +98,7 @@ private: private: DolphinController* m_controller; + SelectionManager* m_selectionManager; DolphinCategoryDrawer* m_categoryDrawer; QFont m_font;