┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-04-16 21:08:09 +0000
committerPeter Penz <[email protected]>2008-04-16 21:08:09 +0000
commit3a27f307993829fabfa34e89a8e794e8c5c4ebca (patch)
tree40556fa2d2aa057dc7004245060a70b00b18d416
parenteb36093c2c5a8782c7c7f6be92881c108c30a5b1 (diff)
* clear the selection toggle when zooming in or out
* 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
-rw-r--r--src/dolphincolumnwidget.cpp15
-rw-r--r--src/dolphincolumnwidget.h2
-rw-r--r--src/dolphindetailsview.cpp18
-rw-r--r--src/dolphindetailsview.h2
-rw-r--r--src/dolphiniconsview.cpp15
-rw-r--r--src/dolphiniconsview.h2
6 files changed, 44 insertions, 10 deletions
diff --git a/src/dolphincolumnwidget.cpp b/src/dolphincolumnwidget.cpp
index ee051ff1a..cf2ae7656 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 e51ff5d97..ada7d637a 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 aef034df1..08d03fb0b 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 a92e113dd..829e53967 100644
--- a/src/dolphindetailsview.h
+++ b/src/dolphindetailsview.h
@@ -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;
diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp
index 7b9ddd6ac..a9659739a 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 56d492ce1..7ada661a4 100644
--- a/src/dolphiniconsview.h
+++ b/src/dolphiniconsview.h
@@ -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;