Summary: | Quickbrowser doesn't close after drag and drop | ||
---|---|---|---|
Product: | [Plasma] kicker | Reporter: | Kevin Goeser <kevin> |
Component: | Drag 'n Drop | Assignee: | John Firebaugh <jfirebaugh> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Kevin Goeser
2004-09-06 15:51:02 UTC
*** This bug has been marked as a duplicate of 80247 *** 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. Changing component to general, since this isn't related to quickbrowser, not quicklauncher. 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); |