Bug 94287 - dragging feeds should do a KURLDrag
Summary: dragging feeds should do a KURLDrag
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: cvs
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-02 18:22 UTC by George Staikos
Modified: 2004-12-02 19:10 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 George Staikos 2004-12-02 18:22:40 UTC
When a feed is dragged, it should encode as a KURLDrag so that it can be 
dragged out of akregator.  Would be nice to have a better pixmap (such as the 
favicon) for the drag pixmap too.
Comment 1 George Staikos 2004-12-02 18:35:46 UTC
CVS commit by staikos: 

make a nice icon for dragging feeds
CCBUG: 94287


  M +13 -0     feedstree.cpp   1.28
  M +5 -0      feedstree.h   1.16


--- kdenonbeta/akregator/src/feedstree.cpp  #1.27:1.28
@@ -658,3 +658,16 @@ void FeedsTree::slotNodeChanged(TreeNode
 }
 
+QDragObject *FeedsTree::dragObject()
+{
+    QDragObject *obj = KListView::dragObject();
+    if (obj) {
+        QListViewItem *i = static_cast<TreeNodeItem*>(currentItem());
+        if (i) {
+            obj->setPixmap(*(i->pixmap(0)));
+        }
+    }
+    return obj;
+}
+
 #include "feedstree.moc"
+// vim: ts=4 sw=4 et

--- kdenonbeta/akregator/src/feedstree.h  #1.15:1.16
@@ -147,4 +147,8 @@ namespace Akregator
             virtual void slotFeedFetchError(Feed* feed);
             virtual void slotFeedFetchCompleted(Feed* feed);
+
+        protected:
+            virtual QDragObject *dragObject();
+
         private:
             /** used for finding the item belonging to a node */
@@ -155,2 +159,3 @@ namespace Akregator
 
 #endif
+// vim: ts=4 sw=4 et


Comment 2 George Staikos 2004-12-02 19:10:36 UTC
CVS commit by staikos: 

allow dragging of feeds out of akregator
FEATURE: 94287


  M +12 -5     feedstree.cpp   1.29


--- kdenonbeta/akregator/src/feedstree.cpp  #1.28:1.29
@@ -18,4 +18,5 @@
 #include <kiconloader.h>
 #include <klocale.h>
+#include <kmultipledrag.h>
 #include <kstringhandler.h>
 #include <kurldrag.h>
@@ -660,12 +661,18 @@ void FeedsTree::slotNodeChanged(TreeNode
 QDragObject *FeedsTree::dragObject()
 {
+    KMultipleDrag *md = new KMultipleDrag(viewport());
     QDragObject *obj = KListView::dragObject();
     if (obj) {
-        QListViewItem *i = static_cast<TreeNodeItem*>(currentItem());
+        md->addDragObject(obj);
+    }
+    TreeNodeItem *i = static_cast<TreeNodeItem*>(currentItem());
         if (i) {
-            obj->setPixmap(*(i->pixmap(0)));
+        md->setPixmap(*(i->pixmap(0)));
+        FeedItem *fi = dynamic_cast<FeedItem*>(i);
+        if (fi) {
+            md->addDragObject(KURLDrag::newDrag(KURL(fi->node()->xmlUrl()), 0L));
         }
     }
-    return obj;
+    return md;
 }