Bug 88940 - Quickbrowser doesn't close after drag and drop
Summary: Quickbrowser doesn't close after drag and drop
Status: RESOLVED FIXED
Alias: None
Product: kicker
Classification: Plasma
Component: Drag 'n Drop (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: John Firebaugh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-06 15:51 UTC by Kevin Goeser
Modified: 2005-01-14 19:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Goeser 2004-09-06 15:51:02 UTC
Version:           3.3.0 (using KDE 3.3.0, Gentoo)
Compiler:          gcc version 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6)
OS:                Linux (i686) release 2.6.8-gentoo-r3

1. Open any part of the filesystem in the quicklauncher
2. Drag an item e.g. to the desktop or the trashcan
3. Drop it and say "Move"
-> The menu stays (I think it should vanish)
-> The file is still shown to be in its old place

The not vanishing menu could be related to:
http://bugs.kde.org/show_bug.cgi?id=81438
(but the menu vanishes if you click somewhere)
Comment 1 Aaron J. Seigo 2004-09-14 21:51:04 UTC

*** This bug has been marked as a duplicate of 80247 ***
Comment 2 Kevin Goeser 2004-09-15 10:00:51 UTC
Sorry, I meant the quickbrowser, not the quicklauncher :(
I don't think it is the same bug. For the quickbrowser the menu for moving/copying/cancel appears. The actions also work, but the view isn't updated. So either the quickbrowser menu should be closed, or the moved item should be removed from the menu.
Comment 3 Dan Bullok 2004-09-15 19:59:33 UTC
Changing component to general, since this isn't related to quickbrowser, not quicklauncher.
Comment 4 Aaron J. Seigo 2005-01-14 19:15:52 UTC
CVS commit by aseigo: 

close menus after dragging items out of them
patch graciously contributed by Stefan Nikolaus

BUG:81438
BUG:88940
CCMAIL: stefan.nikolaus@stuco.uni-oldenburg.de


  M +9 -0      browser_mnu.cpp   1.67
  M +1 -0      browser_mnu.h   1.17
  M +31 -2     service_mnu.cpp   1.90
  M +3 -0      service_mnu.h   1.36


--- kdebase/kicker/ui/browser_mnu.cpp  #1.66:1.67
@@ -399,8 +399,17 @@ void PanelBrowserMenu::mouseMoveEvent(QM
     KURL::List files(url);
     KURLDrag *d = new KURLDrag(files, this);
+    connect(d, SIGNAL(destroyed()), this, SLOT(slotDragObjectDestroyed()));
     d->setPixmap(iconSet(id)->pixmap());
     d->drag();
 }
 
+void PanelBrowserMenu::slotDragObjectDestroyed()
+{
+    if (KURLDrag::target() != this)
+    {
+        close();
+    }
+}
+
 void PanelBrowserMenu::dragEnterEvent( QDragEnterEvent *ev )
 {

--- kdebase/kicker/ui/browser_mnu.h  #1.16:1.17
@@ -51,4 +51,5 @@ protected slots:
     void slotClearIfNeeded(const QString&);
     void slotClear();
+    void slotDragObjectDestroyed();
 
 protected:

--- kdebase/kicker/ui/service_mnu.cpp  #1.89:1.90
@@ -693,8 +693,7 @@ void PanelServiceMenu::mouseMoveEvent(QM
 
     KURLDrag *d = new KURLDrag(KURL::List(url), this);
-
+    connect(d, SIGNAL(destroyed()), this, SLOT(slotDragObjectDestroyed()));
     d->setPixmap(icon);
     d->dragCopy();
-    //close();
 
     // Set the startposition outside the panel, so there is no drag initiated
@@ -704,4 +703,34 @@ void PanelServiceMenu::mouseMoveEvent(QM
 }
 
+void PanelServiceMenu::dragEnterEvent(QDragEnterEvent *event)
+{
+    // Set the DragObject's target to this widget. This is needed because the
+    // widget doesn't accept drops, but we want to determine if the drag object
+    // is dropped on it. This avoids closing on accidental drags. If this
+    // widget accepts drops in the future, these lines can be removed.
+    if (event->source() == this)
+    {
+        KURLDrag::setTarget(this);
+    }
+    event->ignore();
+}
+
+void PanelServiceMenu::dragLeaveEvent(QDragLeaveEvent */*event*/)
+{
+    // see PanelServiceMenu::dragEnterEvent why this is nescessary
+    if (!frameGeometry().contains(QCursor::pos()))
+    {
+        KURLDrag::setTarget(0);
+    }
+}
+
+void PanelServiceMenu::slotDragObjectDestroyed()
+{
+    if (KURLDrag::target() != this)
+    {
+        close();
+    }
+}
+
 PanelServiceMenu *PanelServiceMenu::newSubMenu(const QString & label, const QString & relPath,
                                                QWidget * parent, const char * name)

--- kdebase/kicker/ui/service_mnu.h  #1.35:1.36
@@ -76,4 +76,5 @@ protected slots:
     virtual void configChanged();
     virtual void slotClose();
+    void slotDragObjectDestroyed();
 
 protected:
@@ -84,4 +85,6 @@ protected:
     virtual void mouseReleaseEvent(QMouseEvent *);
     virtual void mouseMoveEvent(QMouseEvent *);
+    virtual void dragEnterEvent(QDragEnterEvent *);
+    virtual void dragLeaveEvent(QDragLeaveEvent *);
 
     void activateParent(const QString &child);