Bug 109703 - updating of calendar view in Date panel
Summary: updating of calendar view in Date panel
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Searches-Dates (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-27 14:31 UTC by Mikolaj Machowski
Modified: 2019-12-27 22:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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