]> git.pld-linux.org Git - packages/kde4-kdepimlibs.git/blob - kde4-kdepimlibs-build.patch
f2ff5949f2c602b8c5aa2024178a3e99eb2df575
[packages/kde4-kdepimlibs.git] / kde4-kdepimlibs-build.patch
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
3 @@ -118,7 +118,6 @@
4  endif()
5  
6  
7 -include( CMakeExportBuildSettings )
8  # this writes way too much, but do we care?
9  EXPORT_LIBRARY_DEPENDENCIES( ${CMAKE_CURRENT_BINARY_DIR}/GpgmeppLibraryDepends.cmake )
10  
11 commit 14ec9116e0c2059c424751ca25a1ae88de972281
12 Author: Andras Mantia <amantia@kde.org>
13 Date:   Sun Sep 30 13:58:35 2012 +0300
14
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.
17     
18     REVIEW: 106629
19
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 )
25    Q_D( ResourceBase );
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();
31      return;
32    }
33 @@ -490,9 +490,9 @@ void ResourceBasePrivate::slotDeliveryDone(KJob * job)
34    Q_Q( ResourceBase );
35    Q_ASSERT( scheduler->currentTask().type == ResourceScheduler::FetchItem );
36    if ( job->error() ) {
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() ) );
39    }
40 -  scheduler->currentTask().sendDBusReplies( !job->error() );
41 +  scheduler->currentTask().sendDBusReplies( job->error() ? job->errorString() : QString() );
42    scheduler->taskDone();
43  }
44  
45 @@ -515,7 +515,7 @@ void ResourceBasePrivate::slotCollectionAttributesSyncDone(KJob * job)
46    Q_Q( ResourceBase );
47    Q_ASSERT( scheduler->currentTask().type == ResourceScheduler::SyncCollectionAttributes );
48    if ( job->error() ) {
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() ) );
51    }
52    emit q->attributesSynchronized( scheduler->currentTask().collection.id() );
53    scheduler->taskDone();
54 @@ -591,13 +591,19 @@ void ResourceBasePrivate::changeCommittedResult( KJob *job )
55    changeProcessed();
56  }
57  
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 )
62 +{
63 +  return requestItemDeliveryV2( uid, remoteId, mimeType, parts ).isEmpty();
64 +}
65 +
66 +QString ResourceBase::requestItemDeliveryV2(qint64 uid, const QString &remoteId, const QString &mimeType, const QStringList &_parts)
67  {
68    Q_D( ResourceBase );
69    if ( !isOnline() ) {
70 -    emit error( i18nc( "@info", "Cannot fetch item in offline mode." ) );
71 -    return false;
72 +    const QString errorMsg = i18nc( "@info", "Cannot fetch item in offline mode." );
73 +    emit error( errorMsg );
74 +    return errorMsg;
75    }
76  
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() );
81  
82 -  d->scheduler->scheduleItemFetch( item, parts, message().createReply() );
83 +  d->scheduler->scheduleItemFetch( item, parts, message() );
84 +
85 +  return QString();
86  
87 -  return true;
88  }
89  
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
96  
97      bool requestItemDelivery( qint64 uid, const QString &remoteId, const QString &mimeType, const QStringList &parts );
98  
99 +    QString requestItemDeliveryV2( qint64 uid, const QString &remoteId, const QString &mimeType, const QStringList &parts );
100 +
101    private:
102      Q_DECLARE_PRIVATE( ResourceBase )
103  
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 );
121          }
122        } else {
123 @@ -435,11 +435,20 @@ void ResourceScheduler::collectionRemoved( const Akonadi::Collection &collection
124    }
125  }
126  
127 -void ResourceScheduler::Task::sendDBusReplies( bool success )
128 +void ResourceScheduler::Task::sendDBusReplies( const QString &errorMsg )
129  {
130    Q_FOREACH( const QDBusMessage &msg, dbusMsgs ) {
131 -    QDBusMessage reply( msg );
132 -    reply << success;
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")) {
138 +      reply << errorMsg;
139 +    } else if (methodName.isEmpty()) {
140 +      continue; // unittest calls scheduleItemFetch with empty QDBusMessage
141 +    } else {
142 +      kFatal() << "Got unexpected member:" << methodName;
143 +    }
144      DBusConnectionPool::threadConnection().send( reply );
145    }
146  }
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;
153          QVariant argument;
154  
155 -        void sendDBusReplies( bool success );
156 +        void sendDBusReplies( const QString &errorMsg );
157  
158          bool operator==( const Task &other ) const
159          {
This page took 0.19162 seconds and 2 git commands to generate.