Bug 109703

Summary: updating of calendar view in Date panel
Product: [Applications] digikam Reporter: Mikolaj Machowski <mikmach>
Component: Searches-DatesAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 7.0.0

Description Mikolaj Machowski 2005-07-27 14:31:12 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc3.4.3 
OS:                Linux

After removing of all images from particular day bolding in calendar view
isn't removed immediately, have to switch to other month and return to
grey out day.

No significant Konsole output
Comment 1 Renchi Raju 2005-07-28 15:51:36 UTC
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;
Comment 2 caulier.gilles 2019-12-27 22:56:09 UTC
Not reproducible with 7.0.0-beta1