[Digikam-devel] [Bug 139547] tag hierarchy automatic fill

Gilles Caulier caulier.gilles at kdemail.net
Fri Jan 5 20:20:00 GMT 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=139547         




------- Additional Comments From caulier.gilles kdemail net  2007-01-05 21:19 -------
SVN commit 620379 by cgilles:

digikam from trunk: Comments & Tags : Support of multiple selection of tags in treeview. Drag and drop tags will work like Tags Filter view

CCBUGS: 139547

 M  +0 -5      imagedescedittab.cpp  
 M  +24 -10    talbumlistview.cpp  
 M  +1 -1      talbumlistview.h  


--- trunk/extragear/graphics/digikam/libs/imageproperties/imagedescedittab.cpp #620378:620379
 @ -27,7 +27,6  @
 #include <qvbox.h>
 #include <qlabel.h>
 #include <qlayout.h>
-#include <qheader.h>
 #include <qtoolbutton.h>
 #include <qpushbutton.h>
 #include <qiconset.h>
 @ -191,10 +190,6  @
     d->recentTagsBtn->setPopupDelay(1);
 
     d->tagsView = new TAlbumListView(settingsArea);
-    d->tagsView->addColumn(i18n("Tags"));
-    d->tagsView->header()->hide();
-    d->tagsView->setSelectionMode(QListView::Single);
-    d->tagsView->setResizeMode(QListView::LastColumn);
 
     // Buttons -----------------------------------------
 
--- trunk/extragear/graphics/digikam/libs/imageproperties/talbumlistview.cpp #620378:620379
 @ -3,7 +3,7  @
  * Date  : 2006-18-12
  * Description : A list view to display digiKam Tags.
  *
- * Copyright 2006 by Gilles Caulier
+ * Copyright 2006-2007 by Gilles Caulier
  *
  * This program is free software; you can redistribute it
  * and/or modify it under the terms of the GNU General
 @ -18,6 +18,10  @
  *
  * ============================================================ */
 
+// Qt includes.
+
+#include <qheader.h>
+
 // KDE includes.
 
 #include <kpopupmenu.h>
 @ -83,6 +87,10  @
               : QListView(parent)
 {
     m_dragItem = 0;
+    addColumn(i18n("Tags"));
+    header()->hide();
+    setResizeMode(QListView::LastColumn);
+    setSelectionMode(QListView::Extended);
     setAcceptDrops(true);
     viewport()->setAcceptDrops(true);
 }
 @ -94,17 +102,23  @
 
 QDragObject* TAlbumListView::dragObject()
 {
-    TAlbumCheckListItem *item = dynamic_cast<TAlbumCheckListItem*>(dragItem());
-    if(!item)
-        return 0;
+    QValueList<int> dragTagIDs;
 
-    if(!item->m_album->parent())
-        return 0;
+    QListViewItemIterator it(this, QListViewItemIterator::Selected);
+    while (it.current())
+    {
+        TAlbumCheckListItem* item = (TAlbumCheckListItem*)it.current();
+        if (item)
+        {
+            if (item->m_album->parent())
+                dragTagIDs.append(item->m_album->id());
+        }
+        ++it;
+    }
 
-    TagDrag *t = new TagDrag(item->m_album->id(), this);
-    t->setPixmap(*item->pixmap(0));
-
-    return t;
+    TagListDrag *drag = new TagListDrag(dragTagIDs, this);
+    drag->setPixmap(AlbumThumbnailLoader::instance()->getStandardTagIcon());
+    return drag;
 }
 
 void TAlbumListView::startDrag()
--- trunk/extragear/graphics/digikam/libs/imageproperties/talbumlistview.h #620378:620379
 @ -3,7 +3,7  @
  * Date  : 2006-18-12
  * Description : A list view to display digiKam Tags.
  *
- * Copyright 2006 by Gilles Caulier
+ * Copyright 2006-2007 by Gilles Caulier
  *
  * This program is free software; you can redistribute it
  * and/or modify it under the terms of the GNU General



More information about the Digikam-devel mailing list