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

List:       kde-commits
Subject:    playground/pim/krss/resource
From:       Dmitry Ivanov <vonami () gmail ! com>
Date:       2008-06-18 20:19:08
Message-ID: 1213820348.239376.15336.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 821959 by divanov:

Don't save changes if the job fails


 M  +11 -8     rssresource.cpp  


--- trunk/playground/pim/krss/resource/rssresource.cpp #821958:821959
@@ -114,9 +114,10 @@
                 return false;
         }
 
-        m_collections[ remoteId ].attribute<SubscriptionLabelsCollectionAttribute>( \
                Akonadi::Collection::AddIfMissing )->
-                                  addSubscriptionLabel( subscriptionLabel );
-        Akonadi::CollectionModifyJob *job = new Akonadi::CollectionModifyJob( \
m_collections[ remoteId ] ); +        m_currentCollection = m_collections[ remoteId \
]; +        m_currentCollection.attribute<SubscriptionLabelsCollectionAttribute>( \
Akonadi::Collection::AddIfMissing )-> +                                     \
addSubscriptionLabel( subscriptionLabel ); +        Akonadi::CollectionModifyJob *job \
= new Akonadi::CollectionModifyJob( m_currentCollection );  connect( job, SIGNAL( \
result( KJob* ) ),  this, SLOT( slotSubscriptionDone( KJob* ) ) );
 
@@ -134,9 +135,10 @@
                 return false;
         }
 
-        m_collections[ remoteId ].attribute<SubscriptionLabelsCollectionAttribute>( \
                Akonadi::Collection::AddIfMissing )->
-                                  removeSubscriptionLabel( subscriptionLabel );
-        Akonadi::CollectionModifyJob *job = new Akonadi::CollectionModifyJob( \
m_collections[ remoteId ] ); +        m_currentCollection = m_collections[ remoteId \
]; +        m_currentCollection.attribute<SubscriptionLabelsCollectionAttribute>( \
Akonadi::Collection::AddIfMissing )-> +                                     \
removeSubscriptionLabel( subscriptionLabel ); +        Akonadi::CollectionModifyJob \
*job = new Akonadi::CollectionModifyJob( m_currentCollection );  connect( job, \
SIGNAL( result( KJob* ) ),  this, SLOT( slotSubscriptionDone( KJob* ) ) );
 
@@ -360,7 +362,7 @@
                 kWarning() << job->errorString();
                 m_replyMessage << false;
         }
-        else{
+        else {
                 m_replyMessage << true;
         }
 
@@ -376,7 +378,8 @@
                 kWarning() << job->errorString();
                 m_replyMessage << false;
         }
-        else{
+        else {
+                m_collections[ m_currentCollection.remoteId() ] = \
m_currentCollection;  m_replyMessage << true;
         }
 


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

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