1 --- kdepimlibs-4.9.1/gpgme++/CMakeLists.txt~ 2012-08-13 10:47:04.000000000 +0200
2 +++ kdepimlibs-4.9.1/gpgme++/CMakeLists.txt 2013-04-20 08:18:16.089973135 +0200
7 -include( CMakeExportBuildSettings )
8 # this writes way too much, but do we care?
9 EXPORT_LIBRARY_DEPENDENCIES( ${CMAKE_CURRENT_BINARY_DIR}/GpgmeppLibraryDepends.cmake )
11 commit 14ec9116e0c2059c424751ca25a1ae88de972281
12 Author: Andras Mantia <amantia@kde.org>
13 Date: Sun Sep 30 13:58:35 2012 +0300
15 Add a new requestItemDeliveryV2 that returns the error message. It needed some refactoring in how the error is sent through dbus.
16 Mark some strings to be translated that were not marked before.
20 diff --git a/akonadi/resourcebase.cpp b/akonadi/resourcebase.cpp
21 index 4a79b74..f1b28f3 100644
22 --- a/akonadi/resourcebase.cpp
23 +++ b/akonadi/resourcebase.cpp
24 @@ -466,7 +466,7 @@ void ResourceBase::itemRetrieved( const Item &item )
26 Q_ASSERT( d->scheduler->currentTask().type == ResourceScheduler::FetchItem );
27 if ( !item.isValid() ) {
28 - d->scheduler->currentTask().sendDBusReplies( false );
29 + d->scheduler->currentTask().sendDBusReplies( i18nc( "@info", "Invalid item retrieved" ) );
30 d->scheduler->taskDone();
33 @@ -490,9 +490,9 @@ void ResourceBasePrivate::slotDeliveryDone(KJob * job)
35 Q_ASSERT( scheduler->currentTask().type == ResourceScheduler::FetchItem );
37 - emit q->error( QLatin1String( "Error while creating item: " ) + job->errorString() );
38 + emit q->error( i18nc( "@info", "Error while creating item: %1" ).arg( job->errorString() ) );
40 - scheduler->currentTask().sendDBusReplies( !job->error() );
41 + scheduler->currentTask().sendDBusReplies( job->error() ? job->errorString() : QString() );
42 scheduler->taskDone();
45 @@ -515,7 +515,7 @@ void ResourceBasePrivate::slotCollectionAttributesSyncDone(KJob * job)
47 Q_ASSERT( scheduler->currentTask().type == ResourceScheduler::SyncCollectionAttributes );
49 - emit q->error( QLatin1String( "Error while updating collection: " ) + job->errorString() );
50 + emit q->error( i18nc( "@info", "Error while updating collection: %1" ).arg( job->errorString() ) );
52 emit q->attributesSynchronized( scheduler->currentTask().collection.id() );
53 scheduler->taskDone();
54 @@ -591,13 +591,19 @@ void ResourceBasePrivate::changeCommittedResult( KJob *job )
58 -bool ResourceBase::requestItemDelivery( qint64 uid, const QString & remoteId,
59 - const QString &mimeType, const QStringList &_parts )
60 +bool ResourceBase::requestItemDelivery( qint64 uid, const QString &remoteId,
61 + const QString &mimeType, const QStringList &parts )
63 + return requestItemDeliveryV2( uid, remoteId, mimeType, parts ).isEmpty();
66 +QString ResourceBase::requestItemDeliveryV2(qint64 uid, const QString &remoteId, const QString &mimeType, const QStringList &_parts)
70 - emit error( i18nc( "@info", "Cannot fetch item in offline mode." ) );
72 + const QString errorMsg = i18nc( "@info", "Cannot fetch item in offline mode." );
73 + emit error( errorMsg );
77 setDelayedReply( true );
78 @@ -610,9 +616,10 @@ bool ResourceBase::requestItemDelivery( qint64 uid, const QString & remoteId,
79 Q_FOREACH( const QString &str, _parts )
80 parts.insert( str.toLatin1() );
82 - d->scheduler->scheduleItemFetch( item, parts, message().createReply() );
83 + d->scheduler->scheduleItemFetch( item, parts, message() );
90 void ResourceBase::collectionsRetrieved( const Collection::List & collections )
91 diff --git a/akonadi/resourcebase.h b/akonadi/resourcebase.h
92 index d453d6c..2e112b5 100644
93 --- a/akonadi/resourcebase.h
94 +++ b/akonadi/resourcebase.h
95 @@ -627,6 +627,8 @@ class AKONADI_EXPORT ResourceBase : public AgentBase
97 bool requestItemDelivery( qint64 uid, const QString &remoteId, const QString &mimeType, const QStringList &parts );
99 + QString requestItemDeliveryV2( qint64 uid, const QString &remoteId, const QString &mimeType, const QStringList &parts );
102 Q_DECLARE_PRIVATE( ResourceBase )
104 diff --git a/akonadi/resourcescheduler.cpp b/akonadi/resourcescheduler.cpp
105 index 875ed9f..b79a4e8 100644
106 --- a/akonadi/resourcescheduler.cpp
107 +++ b/akonadi/resourcescheduler.cpp
108 @@ -386,12 +386,12 @@ void ResourceScheduler::setOnline(bool state)
109 TaskList& itemFetchQueue = queueForTaskType( FetchItem );
110 for ( QList< Task >::iterator it = itemFetchQueue.begin(); it != itemFetchQueue.end(); ) {
111 if ( (*it).type == FetchItem ) {
112 - (*it).sendDBusReplies( false );
113 + (*it).sendDBusReplies( i18nc( "@info", "Job canceled." ) );
114 it = itemFetchQueue.erase( it );
115 if ( s_resourcetracker ) {
116 QList<QVariant> argumentList;
117 argumentList << QString::number( mCurrentTask.serial )
118 - << QLatin1String( "Job canceled." );
119 + << i18nc( "@info", "Job canceled." );
120 s_resourcetracker->asyncCallWithArgumentList( QLatin1String( "jobEnded" ), argumentList );
123 @@ -435,11 +435,20 @@ void ResourceScheduler::collectionRemoved( const Akonadi::Collection &collection
127 -void ResourceScheduler::Task::sendDBusReplies( bool success )
128 +void ResourceScheduler::Task::sendDBusReplies( const QString &errorMsg )
130 Q_FOREACH( const QDBusMessage &msg, dbusMsgs ) {
131 - QDBusMessage reply( msg );
133 + QDBusMessage reply( msg.createReply() );
134 + const QString methodName = msg.member();
135 + if (methodName == QLatin1String("requestItemDelivery")) {
136 + reply << errorMsg.isEmpty();
137 + } else if (methodName == QLatin1String("requestItemDeliveryV2")) {
139 + } else if (methodName.isEmpty()) {
140 + continue; // unittest calls scheduleItemFetch with empty QDBusMessage
142 + kFatal() << "Got unexpected member:" << methodName;
144 DBusConnectionPool::threadConnection().send( reply );
147 diff --git a/akonadi/resourcescheduler_p.h b/akonadi/resourcescheduler_p.h
148 index aadd930..16ec454 100644
149 --- a/akonadi/resourcescheduler_p.h
150 +++ b/akonadi/resourcescheduler_p.h
151 @@ -79,7 +79,7 @@ class ResourceScheduler : public QObject
152 QByteArray methodName;
155 - void sendDBusReplies( bool success );
156 + void sendDBusReplies( const QString &errorMsg );
158 bool operator==( const Task &other ) const