[Digikam-devel] branches/stable/extragear/graphics/digikam

Gilles Caulier caulier.gilles at free.fr
Mon Mar 20 12:36:54 GMT 2006


SVN commit 520584 by cgilles:

digikam from stable : Rating image using keyboard shortcuts CTRL+0/1/2/3/4/5 from main interface

CCMAIL: digikam-devel at kde.org
CCBUGS: 123646

 M  +30 -0     digikam/albumiconview.cpp  
 M  +9 -3      digikam/albumiconview.h  
 M  +21 -0     digikam/digikamapp.cpp  
 M  +7 -0      digikam/digikamapp.h  
 M  +35 -0     digikam/digikamview.cpp  
 M  +10 -1     digikam/digikamview.h  
 M  +1 -0      libs/histogram/imagehistogram.cpp  


--- branches/stable/extragear/graphics/digikam/digikam/albumiconview.cpp #520583:520584
@@ -1688,6 +1688,36 @@
     triggerUpdate();
 }
 
+void AlbumIconView::slotAssignRatingNoStar()
+{
+    slotAssignRating(0);
+}
+
+void AlbumIconView::slotAssignRatingOneStar()
+{
+    slotAssignRating(1);
+}
+
+void AlbumIconView::slotAssignRatingTwoStar()
+{
+    slotAssignRating(2);
+}
+
+void AlbumIconView::slotAssignRatingThreeStar()
+{
+    slotAssignRating(3);
+}
+
+void AlbumIconView::slotAssignRatingFourStar()
+{
+    slotAssignRating(4);
+}
+
+void AlbumIconView::slotAssignRatingFiveStar()
+{
+    slotAssignRating(5);
+}
+
 void AlbumIconView::slotDIOResult(KIO::Job* job)
 {
     if (job->error())
--- branches/stable/extragear/graphics/digikam/digikam/albumiconview.h #520583:520584
@@ -152,8 +152,6 @@
     void slotAssignTag(int tagID);
     void slotRemoveTag(int tagID);
 
-    void slotAssignRating(int rating);
-    
     void slotDIOResult(KIO::Job* job);
     
 public slots:
@@ -168,7 +166,15 @@
     void slotSetAlbumThumbnail(AlbumIconItem *iconItem);
     void slotCopy();
     void slotPaste();
-    
+
+    void slotAssignRating(int rating);
+    void slotAssignRatingNoStar();
+    void slotAssignRatingOneStar();
+    void slotAssignRatingTwoStar();
+    void slotAssignRatingThreeStar();
+    void slotAssignRatingFourStar();
+    void slotAssignRatingFiveStar();
+        
 signals:
 
     void signalItemsAdded();
--- branches/stable/extragear/graphics/digikam/digikam/digikamapp.cpp #520583:520584
@@ -588,6 +588,27 @@
                                    actionCollection(),
                                    "gamma_adjustment");
 
+    // -- Rating actions ---------------------------------------------------------------
+
+    m_0Star = new KAction(i18n("No Star"), CTRL+Key_0,
+                          mView, SLOT(slotAssignRatingNoStar()),
+                          actionCollection(), "imageview_ratenostar");
+    m_1Star = new KAction(i18n("One Star"), CTRL+Key_1,
+                          mView, SLOT(slotAssignRatingOneStar()),
+                          actionCollection(), "imageview_rateonestar");
+    m_2Star = new KAction(i18n("Two Star"), CTRL+Key_2, 
+                          mView, SLOT(slotAssignRatingTwoStar()),
+                          actionCollection(), "imageview_ratetwostar");
+    m_3Star = new KAction(i18n("Three Star"), CTRL+Key_3, 
+                          mView, SLOT(slotAssignRatingThreeStar()),
+                          actionCollection(), "imageview_ratethreestar");
+    m_4Star = new KAction(i18n("Four Star"), CTRL+Key_4, 
+                          mView, SLOT(slotAssignRatingFourStar()),
+                          actionCollection(), "imageview_ratefourstar");
+    m_5Star = new KAction(i18n("Five Star"), CTRL+Key_5, 
+                          mView, SLOT(slotAssignRatingFiveStar()),
+                          actionCollection(), "imageview_ratefivestar");
+                          
     // -----------------------------------------------------------
 
     KAction* findAction = KStdAction::find(mView, SLOT(slotNewQuickSearch()),
--- branches/stable/extragear/graphics/digikam/digikam/digikamapp.h #520583:520584
@@ -190,6 +190,13 @@
     KAction       *mThumbSizeMinusAction;
     KAction       *mFullScreenAction;
 
+    KAction               *m_0Star;
+    KAction               *m_1Star;
+    KAction               *m_2Star;
+    KAction               *m_3Star;
+    KAction               *m_4Star;
+    KAction               *m_5Star;
+
     // Application Actions
     KAction       *mQuitAction;
     KAction       *mTipAction;
--- branches/stable/extragear/graphics/digikam/digikam/digikamview.cpp #520583:520584
@@ -682,4 +682,39 @@
     mSearchFolderView->setActive(w == mSearchFolderView);
 }
 
+void DigikamView::slotAssignRating(int rating)
+{
+    mIconView->slotAssignRating(rating);
+}
+
+void DigikamView::slotAssignRatingNoStar()
+{
+    mIconView->slotAssignRatingNoStar();
+}
+
+void DigikamView::slotAssignRatingOneStar()
+{
+    mIconView->slotAssignRatingOneStar();
+}
+
+void DigikamView::slotAssignRatingTwoStar()
+{
+    mIconView->slotAssignRatingTwoStar();
+}
+
+void DigikamView::slotAssignRatingThreeStar()
+{
+    mIconView->slotAssignRatingThreeStar();
+}
+
+void DigikamView::slotAssignRatingFourStar()
+{
+    mIconView->slotAssignRatingFourStar();
+}
+
+void DigikamView::slotAssignRatingFiveStar()
+{
+    mIconView->slotAssignRatingFiveStar();
+}
+
 #include "digikamview.moc"
--- branches/stable/extragear/graphics/digikam/digikam/digikamview.h #520583:520584
@@ -133,7 +133,16 @@
     void slotSortImages(int order);
 
     void slot_albumSelected(Album* album);
-    
+
+    // Image Rating slots
+    void slotAssignRating(int rating);
+    void slotAssignRatingNoStar();
+    void slotAssignRatingOneStar();
+    void slotAssignRatingTwoStar();
+    void slotAssignRatingThreeStar();
+    void slotAssignRatingFourStar();
+    void slotAssignRatingFiveStar();
+        
 private slots:
 
     void slotAllAlbumsLoaded();
--- branches/stable/extragear/graphics/digikam/libs/histogram/imagehistogram.cpp #520583:520584
@@ -110,6 +110,7 @@
        postProgress(true, false);
         
     m_histogram = new double_packet[256];
+    memset(m_histogram, 0, 256*sizeof(double_packet));
     
     if ( !m_histogram )
        {



More information about the Digikam-devel mailing list