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

List:       kde-commits
Subject:    branches/digikam/0.8-experimental
From:       Renchi Raju <renchi () pooh ! tam ! uiuc ! edu>
Date:       2005-06-24 22:51:35
Message-ID: 1119653495.622927.409.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 428695 by pahlibar:

add index function for an iconitem. update TODO


 M  +0 -2      TODO  
 M  +24 -0     digikam/digikam/icongroupitem.cpp  
 M  +1 -0      digikam/digikam/icongroupitem.h  
 M  +1 -2      digikam/utilities/cameragui/cameraiconview.cpp  


--- branches/digikam/0.8-experimental/TODO #428694:428695
@@ -20,8 +20,6 @@
   - closed/open state of left/right views
   - currently selected albums in each view
 
-* port cameraiconview to iconview and remove thumbview
-
 * fix kipiinterface to work with new framework
 
 * Fix PPC compatibility in image filters [GC]
--- branches/digikam/0.8-experimental/digikam/digikam/icongroupitem.cpp #428694:428695
@@ -193,6 +193,29 @@
     return d->count;
 }
 
+int IconGroupItem::index(IconItem* item) const
+{
+    if ( !item )
+        return -1;
+
+    if ( item == d->firstItem )
+        return 0;
+    else if ( item == d->lastItem )
+        return d->count - 1;
+    else 
+    {
+        IconItem *i = d->firstItem;
+        int j = 0;
+        while ( i && i != item ) 
+        {
+            i = i->m_next;
+            ++j;
+        }
+
+        return i ? j : -1;
+    }
+}
+
 void IconGroupItem::clear(bool update)
 {
     d->clearing = true;
@@ -273,3 +296,4 @@
 {
     return 0;
 }
+
--- branches/digikam/0.8-experimental/digikam/digikam/icongroupitem.h #428694:428695
@@ -46,6 +46,7 @@
     IconItem* lastItem() const;
 
     int       count() const;
+    int       index(IconItem* item) const;
 
     void      clear(bool update=true);
     void      sort();
--- branches/digikam/0.8-experimental/digikam/utilities/cameragui/cameraiconview.cpp #428694:428695
@@ -135,8 +135,7 @@
         viewItem->setDownloadName( useDefault ? QString::null :
                                    getTemplatedName( nameTemplate,
                                                      viewItem->itemInfo(),
-                                                     0 ) );
-//TODO:                                              index(viewItem) ) );
+                                                     m_groupItem->index(viewItem) ) );
     }
     rearrangeItems();
     viewport()->setUpdatesEnabled(true);
[prev in list] [next in list] [prev in thread] [next in thread] 

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