Bug 103384

Summary: Trying to drag articles leads to marking articles accidentally as read
Product: [Applications] akregator Reporter: Eckhart Wörner <ewoerner>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: 1.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Trying to drag
The result of the drag

Description Eckhart Wörner 2005-04-06 23:08:30 UTC
Version:           1.0 (using KDE 3.4.0, Debian Package 4:3.4.0-0ubuntu3 (3.1))
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-8ubuntu2)
OS:                Linux (i686) release 2.6.10-5-386

At the moment, if you try to drag an article of the article list to an E-Mail or something else, you won't be able to drag it.

Instead, trying to move the article leads to selection of other articles and therefore marking them as read.

The first attached screen shot shows that one wants to drag the article located at (A) and drag it to the bottom; we'll just watch that to point (B).
The second screen shot shows the result of this.
Comment 1 Eckhart Wörner 2005-04-06 23:10:44 UTC
Created attachment 10531 [details]
Trying to drag
Comment 2 Eckhart Wörner 2005-04-06 23:11:20 UTC
Created attachment 10532 [details]
The result of the drag
Comment 3 Teemu Rytilahti 2005-05-12 23:21:48 UTC
I can confirm...
Comment 4 Teemu Rytilahti 2005-05-15 22:29:00 UTC
SVN commit 414333 by rytilahti:

Allow dragging of article. (will give you link for the article)
This feature removes also bug when multiple articles are marked as read when trying to drag something :)
warning-- too...

BUGS:103384
FEATURE:103387



 M  +10 -2     trunk/KDE/kdepim/akregator/src/articlelistview.cpp  
 M  +3 -0      trunk/KDE/kdepim/akregator/src/articlelistview.h  


--- trunk/KDE/kdepim/akregator/src/articlelistview.cpp #414332:414333
@@ -34,6 +34,7 @@
 #include <kiconloader.h>
 #include <klocale.h>
 #include <kcharsets.h>
+#include <kurl.h>
 
 #include <qdatetime.h>
 #include <qpixmap.h>
@@ -41,6 +42,7 @@
 #include <qvaluelist.h>
 #include <qwhatsthis.h>
 #include <qheader.h>
+#include <qdragobject.h>
 
 using namespace Akregator;
 
@@ -113,7 +115,7 @@
     setItemsRenameable(false);
     setItemsMovable(false);
     setAllColumnsShowFocus(true);
-    setDragEnabled(false); // FIXME before we implement dragging between archived feeds??
+    setDragEnabled(true); // FIXME before we implement dragging between archived feeds??
     setAcceptDrops(false); // FIXME before we implement dragging between archived feeds??
     setFullWidth(false);
     
@@ -317,6 +319,12 @@
     }
 }
 
+QDragObject *ArticleListView::dragObject()
+{
+    QDragObject *d = new QTextDrag(currentItem()->article().link().prettyURL(), this);
+    return d;
+}
+
 void ArticleListView::slotPreviousArticle()
 {
     QListViewItem *lvi = currentItem();
@@ -446,7 +454,7 @@
         emit signalArticleChosen( ai->article() );
 }
 
-void ArticleListView::slotCurrentChanged(QListViewItem* item)
+void ArticleListView::slotCurrentChanged(QListViewItem*/* item*/)
 {/*
     ArticleItem* ai = dynamic_cast<ArticleItem*> (item);
     if (ai)
--- trunk/KDE/kdepim/akregator/src/articlelistview.h #414332:414333
@@ -32,6 +32,7 @@
 #include <qptrlist.h>
 
 class QKeyEvent;
+class QDragObject;
 
 namespace Akregator
 {
@@ -118,6 +119,8 @@
             /** applies text filter and status filter by setting visibility
             of items accordingly */
             virtual void applyFilters();
+            
+            virtual QDragObject *dragObject();
 
         protected slots:
             virtual void slotSelectionChanged();