[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-08-13 22:53:59
Message-ID: 1218668039.055296.12337.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 846723 by divanov:

Emit fetchFinished() and fetchFailed()


 M  +10 -1     rssresource.cpp  
 M  +5 -0      syncfeedjob.cpp  
 M  +2 -0      syncfeedjob.h  


--- trunk/playground/pim/krss/resource/rssresource.cpp #846722:846723
@@ -371,10 +371,15 @@
 {
     kDebug() << "Blocked sync done";
 
+    FeedCollection feed = static_cast<SyncFeedJob *>( job )->collection();
     if ( job->error() ) {
         kWarning() << "Failed to sync the feed";
         kWarning() << job->errorString();
+        emit fetchFailed( feed.id(), job->errorString() );
     }
+    else {
+        emit fetchFinished( feed.id() );
+    }
 
     // notify the scheduler of the finished operation
     itemsRetrievalDone();
@@ -384,11 +389,15 @@
 {
     kDebug() << "Parallel sync done";
 
+    FeedCollection feed = static_cast<SyncFeedJob *>( job )->collection();
     if ( job->error() ) {
         kWarning() << "Failed to sync the feed";
         kWarning() << job->errorString();
-        return;
+        emit fetchFailed( feed.id(), job->errorString() );
     }
+    else {
+        emit fetchFinished( feed.id() );
+    }
 }
 
 void RssResource::slotImportDone( KJob *job )
--- trunk/playground/pim/krss/resource/syncfeedjob.cpp #846722:846723
@@ -127,6 +127,11 @@
 {
 }
 
+Akonadi::Collection SyncFeedJob::collection() const
+{
+    return m_collection;
+}
+
 void SyncFeedJob::start()
 {
     QTimer::singleShot( 0, this, SLOT( doStart() ) );
--- trunk/playground/pim/krss/resource/syncfeedjob.h #846722:846723
@@ -39,6 +39,8 @@
     explicit SyncFeedJob( const Akonadi::Collection &collection, QObject *parent = 0 );
     ~SyncFeedJob();
 
+    Akonadi::Collection collection() const;
+
     void start();
     QString errorString() const;
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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