[Digikam-devel] [Bug 109703] updating of calendar view in Date panel

Renchi Raju renchi at pooh.tam.uiuc.edu
Thu Jul 28 14:51:40 BST 2005


------- 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=109703         
renchi pooh tam uiuc edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From renchi pooh tam uiuc edu  2005-07-28 15:51 -------
SVN commit 439595 by pahlibar:

when an item is deleted, update the date-filter view
BUGS: 109703


 M  +30 -0     monthwidget.cpp  
 M  +2 -0      monthwidget.h  


--- trunk/extragear/graphics/digikam/digikam/monthwidget.cpp #439594:439595
 @ -77,6 +77,7  @
         m_days[i].active   = false;
         m_days[i].selected = false;
         m_days[i].day      = -1;
+        m_days[i].numImages = 0;
     }
 
     QDate d(year, month, 1);
 @ -296,6 +297,9  @
         connect(AlbumLister::instance(),
                 SIGNAL(signalNewItems(const ImageInfoList&)),
                 SLOT(slotAddItems(const ImageInfoList&)));
+        connect(AlbumLister::instance(),
+                SIGNAL(signalDeleteItem(ImageInfo*)),
+                SLOT(slotDeleteItem(ImageInfo*)));
     }
     else
     {
 @ -322,6 +326,7  @
             if (m_days[i].day == dt.date().day())
             {
                 m_days[i].active = true;
+                m_days[i].numImages++;
                 break;
             }
         }
 @ -330,4 +335,29  @
     update();
 }
 
+void MonthWidget::slotDeleteItem(ImageInfo* item)
+{
+    if (!m_active || !item)
+        return;
+
+    QDateTime dt = item->dateTime();
+
+    for (int i=0; i<42; i++)
+    {
+        if (m_days[i].day == dt.date().day())
+        {
+            m_days[i].numImages--;
+            if (m_days[i].numImages <= 0)
+            {
+                m_days[i].active = false;
+                m_days[i].numImages = 0;
+            }
+            
+            break;
+        }
+    }
+    
+    update();
+}
+
 #include "monthwidget.moc"
--- trunk/extragear/graphics/digikam/digikam/monthwidget.h #439594:439595
 @ -49,6 +49,7  @
 private slots:
 
     void slotAddItems(const ImageInfoList& items);
+    void slotDeleteItem(ImageInfo* item);
     
 private:
     
 @ -57,6 +58,7  @
         bool active;
         bool selected;
         int  day;
+        int  numImages;
     };
 
     bool         m_active;



More information about the Digikam-devel mailing list