]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Bypassed a Qt-issue where enabling the menu-animation for QApplication emits a clicke...
authorPeter Penz <peter.penz19@gmail.com>
Tue, 8 Apr 2008 19:08:23 +0000 (19:08 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 8 Apr 2008 19:08:23 +0000 (19:08 +0000)
BUG: 155574

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

src/dolphinview.cpp
src/dolphinview.h

index 869d052af6ed4e470da4210b1ee62826c05215ed..7b0ac8947b801e58f0d0b60750912604602b0c57 100644 (file)
@@ -69,6 +69,7 @@ DolphinView::DolphinView(QWidget* parent,
     m_showPreview(false),
     m_loadingDirectory(false),
     m_storedCategorizedSorting(false),
+    m_isContextMenuOpen(false),
     m_mode(DolphinView::IconsView),
     m_topLayout(0),
     m_controller(0),
@@ -747,7 +748,8 @@ void DolphinView::triggerItem(const KFileItem& item)
         return;
     }
 
-    if (item.isNull()) {
+    // TODO: the m_isContextMenuOpen check is a workaround for Qt-issue xxxxxx
+    if (item.isNull() || m_isContextMenuOpen) {
         return;
     }
 
@@ -768,7 +770,9 @@ void DolphinView::openContextMenu(const QPoint& pos)
         item = fileItem(index);
     }
 
+    m_isContextMenuOpen = true; // TODO: workaround for Qt-issue xxxxxx
     emit requestContextMenu(item, url());
+    m_isContextMenuOpen = false;
 }
 
 void DolphinView::dropUrls(const KUrl::List& urls,
index c058338a8c6c9cba699742226915281e3c0c1fd4..40d3827387f853f7d55ee2302dfdd2495b7dac0e 100644 (file)
@@ -639,6 +639,7 @@ private:
     bool m_showPreview;
     bool m_loadingDirectory;
     bool m_storedCategorizedSorting;
+    bool m_isContextMenuOpen;   // TODO: workaround for Qt-issue xxxxxx
     Mode m_mode;
 
     DolphinMainWindow* m_mainWindow;