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

List:       kde-commits
Subject:    KDE/kdepim/messagelist
From:       Thomas McGuire <mcguire () kde ! org>
Date:       2010-06-25 7:27:40
Message-ID: 20100625072740.89111AC8DD () svn ! kde ! org
[Download RAW message or body]

SVN commit 1142567 by tmcguire:

Invalidate the annotation cache when the annotation was changed.

Now using "Add Note" in KMail immediatley updates the annotation icon
again.

 M  +13 -0     core/messageitem.cpp  
 M  +3 -0      core/messageitem.h  
 M  +4 -1      storagemodel.cpp  


--- trunk/KDE/kdepim/messagelist/core/messageitem.cpp #1142566:1142567
@@ -142,6 +142,9 @@
   /// Deletes the internal list of tags
   void invalidateTagCache();
 
+  /// Deletes the cache of the annotation
+  void invalidateAnnotationCache();
+
   ThreadingStatus mThreadingStatus;
   QString mMessageIdMD5;            ///< always set
   QString mInReplyToIdMD5;          ///< set only if we're doing threading
@@ -206,6 +209,11 @@
   }
 }
 
+void MessageItem::Private::invalidateAnnotationCache()
+{
+  mAnnotationStateChecked = false;
+}
+
 const MessageItem::Tag* MessageItem::Private::bestTag() const
 {
   const Tag *best = 0;
@@ -376,6 +384,11 @@
   d->invalidateTagCache();
 }
 
+void MessageItem::invalidateAnnotationCache()
+{
+  d->invalidateAnnotationCache();
+}
+
 QColor MessageItem::textColor() const
 {
   QColor clr;
--- trunk/KDE/kdepim/messagelist/core/messageitem.h #1142566:1142567
@@ -123,6 +123,9 @@
   /// fetched from Nepomuk again
   void invalidateTagCache();
 
+  /// Same as invalidateTagCache(), only for the annotation
+  void invalidateAnnotationCache();
+
   QColor textColor() const;
 
   QColor backgroundColor() const;
--- trunk/KDE/kdepim/messagelist/storagemodel.cpp #1142566:1142567
@@ -330,6 +330,7 @@
   }
 
   mi->invalidateTagCache();
+  mi->invalidateAnnotationCache();
 }
 
 void StorageModel::setMessageItemStatus( MessageList::Core::MessageItem *mi,
@@ -406,7 +407,9 @@
 
 void StorageModel::Private::statementChanged( const Soprano::Statement &statement )
 {
-  if ( statement.predicate() == Soprano::Vocabulary::NAO::hasTag() ) {
+  if ( statement.predicate() == Soprano::Vocabulary::NAO::hasTag() ||
+       statement.predicate() == Soprano::Vocabulary::NAO::description() )
+  {
     const Akonadi::Item item = Item::fromUrl( statement.subject().uri() );
     if ( !item.isValid() ) {
       return;
[prev in list] [next in list] [prev in thread] [next in thread] 

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