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

List:       kde-commits
Subject:    kdelibs/kio/bookmarks
From:       Daniel Teske <teske () squorn ! de>
Date:       2005-03-17 20:48:46
Message-ID: 20050317204846.E755C16F45 () office ! kde ! org
[Download RAW message or body]

CVS commit by teske: 

KBookmarkDrag::canDecode() claims that KBookmarkDrag can decode text/plain.
This actually implements the decoding of text/plain in KBookmarkDrag::decode.
And thus makes dropping text/plain work on the bookmark sidebar.
(E.g. selected text from the location bar.)
BUGS: 100464


  M +36 -0     kbookmarkdrag.cc   1.20


--- kdelibs/kio/bookmarks/kbookmarkdrag.cc  #1.19:1.20
@@ -147,4 +147,40 @@ QValueList<KBookmark> KBookmarkDrag::dec
         }
     }
+    if( e->provides("text/plain") )
+    {        
+        //kdDebug(7043) << "KBookmarkDrag::decode text/plain" << endl;
+        QString s;
+        if(QTextDrag::decode( e, s ))
+        {
+            
+            QStringList listDragURLs = QStringList::split(QChar('\n'), s);
+            QStringList::ConstIterator it = listDragURLs.begin();
+            QStringList::ConstIterator end = listDragURLs.end();
+            for( ; it!=end; ++it)
+            {
+                //kdDebug(7043)<<"KBookmarkDrag::decode string"<<(*it)<<endl;
+                bookmarks.append( KBookmark::standaloneBookmark( KURL(*it).prettyURL(), KURL(*it)));
+            }
+            return bookmarks;
+        }
+    }
+    if( e->provides("text/plain") )
+    {        
+        //kdDebug(7043) << "KBookmarkDrag::decode text/plain" << endl;
+        QString s;
+        if(QTextDrag::decode( e, s ))
+        {
+            
+            QStringList listDragURLs = QStringList::split(QChar('\n'), s);
+            QStringList::ConstIterator it = listDragURLs.begin();
+            QStringList::ConstIterator end = listDragURLs.end();
+            for( ; it!=end; ++it)
+            {
+                //kdDebug(7043)<<"KBookmarkDrag::decode string"<<(*it)<<endl;
+                bookmarks.append( KBookmark::standaloneBookmark( KURL(*it).prettyURL(), KURL(*it)));
+            }
+            return bookmarks;
+        }
+    }
     bookmarks.append( KBookmark() );
     return bookmarks;


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

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