[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdepim/akregator_port] akregator2/src: akregator2: synchronize feed after it has been added
From: Gregor_Tätzner <gregor () freenet ! de>
Date: 2013-11-25 19:51:54
Message-ID: E1Vl2CI-0000Qr-J5 () scm ! kde ! org
[Download RAW message or body]
Git commit e4aa2309efb075238ca8351a02639d4688d7b19a by Gregor Tätzner.
Committed on 25/11/2013 at 19:49.
Pushed by gregort into branch 'akregator_port'.
akregator2: synchronize feed after it has been added
M +11 -4 akregator2/src/createfeedcommand.cpp
M +1 -1 akregator2/src/createfeedcommand.h
http://commits.kde.org/kdepim/e4aa2309efb075238ca8351a02639d4688d7b19a
diff --git a/akregator2/src/createfeedcommand.cpp \
b/akregator2/src/createfeedcommand.cpp index f7c4ac5..6bf572d 100644
--- a/akregator2/src/createfeedcommand.cpp
+++ b/akregator2/src/createfeedcommand.cpp
@@ -29,6 +29,7 @@
#include "editfeedcommand.h"
#include "command_p.h"
+#include <Akonadi/AgentManager>
#include <Akonadi/CachePolicy>
#include <Akonadi/Collection>
#include <Akonadi/CollectionCreateJob>
@@ -60,7 +61,7 @@ public:
void doCreate();
void creationDone( KJob* );
- void modificationDone();
+ void modificationDone( KJob* );
Akonadi::Session* m_session;
QString m_url;
@@ -140,7 +141,7 @@ void CreateFeedCommand::Private::creationDone( KJob* job )
Akonadi::CollectionCreateJob* createJob = \
qobject_cast<Akonadi::CollectionCreateJob*>( job ); Q_ASSERT( createJob );
EditFeedCommand* cmd = new EditFeedCommand( q );
- connect( cmd, SIGNAL(finished()), q, SLOT(modificationDone()) );
+ connect( cmd, SIGNAL(finished(KJob*)), q, SLOT(modificationDone(KJob*)) );
cmd->setParentWidget( q->parentWidget() );
cmd->setCollection( createJob->collection() );
cmd->setSession( m_session );
@@ -148,14 +149,20 @@ void CreateFeedCommand::Private::creationDone( KJob* job )
}
}
-void CreateFeedCommand::Private::modificationDone()
+void CreateFeedCommand::Private::modificationDone( KJob* job )
{
- EditFeedCommand* cmd = qobject_cast<EditFeedCommand*>( q->sender() );
+ EditFeedCommand* cmd = qobject_cast<EditFeedCommand*>( job );
Q_ASSERT( cmd );
if ( cmd->error() )
+ {
q->setErrorAndEmitResult( i18n("Could not edit feed: %1", \
cmd->errorString()) ); + }
else
+ {
+ // fetch feed
+ Akonadi::AgentManager::self()->synchronizeCollection( cmd->collection() );
q->emitResult();
+ }
}
CreateFeedCommand::CreateFeedCommand( Akonadi::Session* session, QObject* parent ) : \
Command( parent ), d( new Private( session, this ) )
diff --git a/akregator2/src/createfeedcommand.h b/akregator2/src/createfeedcommand.h
index 2958276..1d8a42c 100644
--- a/akregator2/src/createfeedcommand.h
+++ b/akregator2/src/createfeedcommand.h
@@ -59,7 +59,7 @@ private:
Private* const d;
Q_PRIVATE_SLOT( d, void doCreate() )
Q_PRIVATE_SLOT( d, void creationDone( KJob* ) )
- Q_PRIVATE_SLOT( d, void modificationDone() )
+ Q_PRIVATE_SLOT( d, void modificationDone( KJob* ) )
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic