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

List:       kde-commits
Subject:    KDE/kdepim/kmail
From:       Laurent Montel <montel () kde ! org>
Date:       2010-08-03 17:31:21
Message-ID: 20100803173121.32126AC7A9 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1158775 by mlaurent:

Apply filter when we added new item


 M  +17 -8     kmmainwidget.cpp  
 M  +3 -0      kmmainwidget.h  


--- trunk/KDE/kdepim/kmail/kmmainwidget.cpp #1158774:1158775
@@ -1115,18 +1115,14 @@
 }
 
 
-void KMMainWidget::slotItemAdded( const Akonadi::Item &, const Akonadi::Collection& col)
+void KMMainWidget::slotItemAdded( const Akonadi::Item &msg, const Akonadi::Collection& col)
 {
   if ( col.isValid() && ( col == kmkernel->outboxCollectionFolder() ) ) {
     startUpdateMessageActionsTimer();
   }
-
-  const QString fullCollectionPath( KMail::Util::fullCollectionPath( col ) );
-  if ( mCheckMail.contains( fullCollectionPath ) ) {
-    mCheckMail[fullCollectionPath].nbMail++;
-  } else {
-    collectionInfo info( col, 1 );
-    mCheckMail.insert( fullCollectionPath, info );
+  const int resultFilter = slotFilterMsg( msg );
+  if ( resultFilter == 1 ) {
+    addInfoInNotification( col );
   }
 }
 
@@ -1139,13 +1135,26 @@
 
 void KMMainWidget::slotItemMoved( Akonadi::Item item, Akonadi::Collection from, Akonadi::Collection to )
 {
+  kDebug()<<" slotItemMoved from :"<<from.id()<<" to "<<to.id();
   if( item.isValid() && ( ( from.id() == kmkernel->outboxCollectionFolder().id() )
                           || to.id() == kmkernel->outboxCollectionFolder().id() ) )
   {
     startUpdateMessageActionsTimer();
   }
+  addInfoInNotification( to );
 }
 
+void KMMainWidget::addInfoInNotification( const Akonadi::Collection&col )
+{
+  const QString fullCollectionPath( KMail::Util::fullCollectionPath( col ) );
+  if ( mCheckMail.contains( fullCollectionPath ) ) {
+    mCheckMail[fullCollectionPath].nbMail++;
+  } else {
+    collectionInfo info( col, 1 );
+    mCheckMail.insert( fullCollectionPath, info );
+  }
+}
+
 //-------------------------------------------------------------------------
 void KMMainWidget::slotFocusQuickSearch()
 {
--- trunk/KDE/kdepim/kmail/kmmainwidget.h #1158774:1158775
@@ -509,6 +509,9 @@
      */
     FolderSelectionDialog* selectFromAllFoldersDialog();
 
+
+    void addInfoInNotification( const Akonadi::Collection&col );
+
   private slots:
     /**
      * Called when a "move to trash" operation is completed
[prev in list] [next in list] [prev in thread] [next in thread] 

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