summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-08-19 17:44:08 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-08-19 23:12:54 +0900
commitbfb2c13ee37585256a4a9e78989f68376cd28e34 (patch)
tree3597a7f07b2c66df8231693da7d884645ca23ca8
parent558e73beb549e4b41546a73ed4c99ddaca229c9e (diff)
downloadtdebase-bfb2c13ee37585256a4a9e78989f68376cd28e34.tar.gz
tdebase-bfb2c13ee37585256a4a9e78989f68376cd28e34.zip
konqueror: extend 'double click to move to parent' functinality to iconview mode as well
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r--konqueror/iconview/konq_iconview.cpp35
-rw-r--r--konqueror/iconview/konq_iconview.h1
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 *