diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-08-19 17:44:08 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-08-19 23:16:59 +0900 |
commit | 27370dc43a2f976917c07db600e1d22781625db8 (patch) | |
tree | f61aecf37d7e68afb1f608f712446c98780ec0e6 /konqueror | |
parent | 6b2e61030efa763b595887605f2a3892cd1c1cf3 (diff) | |
download | tdebase-27370dc43a2f976917c07db600e1d22781625db8.tar.gz tdebase-27370dc43a2f976917c07db600e1d22781625db8.zip |
konqueror: extend 'double click to move to parent' functinality to iconview mode as well
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit bfb2c13ee37585256a4a9e78989f68376cd28e34)
Diffstat (limited to 'konqueror')
-rw-r--r-- | konqueror/iconview/konq_iconview.cpp | 35 | ||||
-rw-r--r-- | konqueror/iconview/konq_iconview.h | 1 |
2 files changed, 28 insertions, 8 deletions
diff --git a/konqueror/iconview/konq_iconview.cpp b/konqueror/iconview/konq_iconview.cpp index 6a701e01f..396e7d301 100644 --- a/konqueror/iconview/konq_iconview.cpp +++ b/konqueror/iconview/konq_iconview.cpp @@ -348,8 +348,6 @@ KonqKfmIconView::KonqKfmIconView( TQWidget *parentWidget, TQObject *parent, cons this, TQT_SLOT( slotMouseButtonClicked(int, TQIconViewItem*, const TQPoint&)) ); connect( m_pIconView, TQT_SIGNAL( contextMenuRequested(TQIconViewItem*, const TQPoint&)), this, TQT_SLOT( slotContextMenuRequested(TQIconViewItem*, const TQPoint&)) ); - connect( m_pIconView, TQT_SIGNAL( mouseDoubleClicked(TQIconViewItem*)), - this, TQT_SLOT( slotDoubleClicked(TQIconViewItem*)) ); // Signals needed to implement the spring loading folders behavior connect( m_pIconView, TQT_SIGNAL( held( TQIconViewItem * ) ), @@ -412,6 +410,8 @@ KonqKfmIconView::KonqKfmIconView( TQWidget *parentWidget, TQObject *parent, cons // m_pIconView->calculateGridX(); setViewMode( mode ); + + m_pActivateDoubleClickTimer = new TQTimer(this); } KonqKfmIconView::~KonqKfmIconView() @@ -869,21 +869,40 @@ void KonqKfmIconView::slotMouseButtonPressed(int _button, TQIconViewItem* _item, void KonqKfmIconView::slotMouseButtonClicked(int _button, TQIconViewItem* _item, const TQPoint& ) { - if( _button == Qt::MidButton ) + if (_button == Qt::MidButton) + { mmbClicked( _item ? static_cast<KFileIVI*>(_item)->item() : 0L ); + } + else if (!_item && _button == Qt::LeftButton) + { + if (m_pActivateDoubleClickTimer->isActive()) + { + m_pActivateDoubleClickTimer->stop(); + slotDoubleClicked(_item); + } + else + { + m_pActivateDoubleClickTimer->start(TQApplication::doubleClickInterval(), true); + } + } } void KonqKfmIconView::slotDoubleClicked(TQIconViewItem *_item) { - if (!_item) + if (!_item && KonqFMSettings::settings()->doubleClickMoveToParent()) { KParts::URLArgs args; args.trustedSource = true; - KURL upURL = m_dirLister->url().upURL(); + KURL baseURL(m_dirLister->url().internalReferenceURL()); + if (baseURL.isEmpty()) + { + baseURL = m_dirLister->url(); + } + KURL upURL = baseURL.upURL(); if (!upURL.isEmpty()) - { - m_extension->openURLRequest(upURL, args); - } + { + m_extension->openURLRequest(upURL, args); + } } } diff --git a/konqueror/iconview/konq_iconview.h b/konqueror/iconview/konq_iconview.h index 777b07b8a..dd8d54fec 100644 --- a/konqueror/iconview/konq_iconview.h +++ b/konqueror/iconview/konq_iconview.h @@ -224,6 +224,7 @@ protected: KonqIconViewWidget *m_pIconView; TQTimer *m_pTimeoutRefreshTimer; + TQTimer *m_pActivateDoubleClickTimer; TQPtrDict<KFileIVI> m_itemDict; // maps KFileItem * -> KFileIVI * |