[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/kicker/kicker/ui
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2005-10-05 0:18:12
Message-ID: 1128471492.072560.23231.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 467349 by aseigo:

use QDrag


 M  +10 -8     service_mnu.cpp  
 M  +1 -1      service_mnu.h  


--- trunk/KDE/kdebase/kicker/kicker/ui/service_mnu.cpp #467348:467349
@@ -48,7 +48,6 @@
 #include <ksycocaentry.h>
 #include <kservice.h>
 #include <ktoolinvocation.h>
-#include <kurldrag.h>
 #include <kio/job.h>
 #include <kauthorized.h>
 
@@ -702,12 +701,14 @@
 
     // If the path to the desktop file is relative, try to get the full
     // path from KStdDirs.
+    QDrag* drag = new QDrag(this);
+    QMimeData* data = new QMimeData;
+    url.setInMimeData(data);
+    drag->setMimeData(data);
+    drag->setPixmap(icon);
+    connect(drag, SIGNAL(destroyed(QObject*)), this, SLOT(dragObjectDestroyed(QObject*)));
+    drag->start();
 
-    KURLDrag *d = new KURLDrag(KURL::List(url), this);
-    connect(d, SIGNAL(destroyed()), this, SLOT(slotDragObjectDestroyed()));
-    d->setPixmap(icon);
-    d->dragCopy();
-
     // Set the startposition outside the panel, so there is no drag initiated
     // when we use drag and click to select items. A drag is only initiated when
     // you click to open the menu, and then press and drag an item.
@@ -738,9 +739,10 @@
     }
 }
 */
-void PanelServiceMenu::slotDragObjectDestroyed()
+void PanelServiceMenu::dragObjectDestroyed(QObject* o)
 {
-    if (KURLDrag::target() != this)
+    QDrag* drag = dynamic_cast<QDrag*>(o);
+    if (drag && drag->target() != this)
     {
         // we need to re-enter the event loop before calling close() here
         // this gets called _before_ the drag object is destroyed, so we are
--- trunk/KDE/kdebase/kicker/kicker/ui/service_mnu.h #467348:467349
@@ -77,7 +77,7 @@
     virtual void slotClear();
     virtual void configChanged();
     virtual void slotClose();
-    void slotDragObjectDestroyed();
+    void dragObjectDestroyed(QObject*);
 
     // for use in Add Applicaton To Panel
     virtual void addNonKDEApp() {}
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic