]>
Commit | Line | Data |
---|---|---|
eee30297 AM |
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 | { | |
ff95e888 AM |
160 | diff -urN kdepimlibs-4.9.1.org/gpgme++/gpgsignkeyeditinteractor.cpp kdepimlibs-4.9.1/gpgme++/gpgsignkeyeditinteractor.cpp |
161 | --- kdepimlibs-4.9.1.org/gpgme++/gpgsignkeyeditinteractor.cpp 2012-08-13 10:50:52.000000000 +0200 | |
162 | +++ kdepimlibs-4.9.1/gpgme++/gpgsignkeyeditinteractor.cpp 2017-10-05 08:23:52.005488763 +0200 | |
163 | @@ -26,9 +26,6 @@ | |
164 | ||
165 | #include <gpgme.h> | |
166 | ||
167 | -#include <boost/tuple/tuple.hpp> | |
168 | -#include <boost/tuple/tuple_comparison.hpp> | |
169 | - | |
170 | #include <map> | |
171 | #include <string> | |
172 | #include <sstream> | |
173 | @@ -49,7 +46,6 @@ | |
174 | #define snprintf _snprintf | |
175 | #endif | |
176 | ||
177 | -using namespace boost; | |
178 | using namespace GpgME; | |
179 | ||
180 | class GpgSignKeyEditInteractor::Private { | |
181 | @@ -144,7 +140,7 @@ | |
182 | ERROR = EditInteractor::ErrorState | |
183 | }; | |
184 | ||
185 | -typedef std::map<tuple<SignKeyState, unsigned int, std::string>, SignKeyState> TransitionMap; | |
186 | +typedef std::map<std::tuple<SignKeyState, unsigned int, std::string>, SignKeyState> TransitionMap; | |
187 | ||
188 | } | |
189 | ||
190 | @@ -157,7 +153,7 @@ | |
191 | TransitionMap tab; | |
192 | const unsigned int GET_BOOL = GPGME_STATUS_GET_BOOL; | |
193 | const unsigned int GET_LINE = GPGME_STATUS_GET_LINE; | |
194 | -#define addEntry( s1, status, str, s2 ) tab[make_tuple( s1, status, str)] = s2 | |
195 | +#define addEntry( s1, status, str, s2 ) tab[std::make_tuple( s1, status, str)] = s2 | |
196 | addEntry( START, GET_LINE, "keyedit.prompt", COMMAND ); | |
197 | addEntry( COMMAND, GET_BOOL, "keyedit.sign_all.okay", UIDS_ANSWER_SIGN_ALL ); | |
198 | addEntry( COMMAND, GET_BOOL, "sign_uid.okay", CONFIRM ); | |
199 | @@ -244,7 +240,7 @@ | |
200 | using namespace GpgSignKeyEditInteractor_Private; | |
201 | ||
202 | //lookup transition in map | |
203 | - const TransitionMap::const_iterator it = table.find( make_tuple( static_cast<SignKeyState>( state() ), status, std::string( args ) ) ); | |
204 | + const TransitionMap::const_iterator it = table.find( std::make_tuple( static_cast<SignKeyState>( state() ), status, std::string( args ) ) ); | |
205 | if ( it != table.end() ) | |
206 | return it->second; | |
207 | ||
208 | --- kdepimlibs-4.9.1/kcalcore/tests/testfilestorage.cpp.org 2012-08-13 10:50:37.000000000 +0200 | |
209 | +++ kdepimlibs-4.9.1/kcalcore/tests/testfilestorage.cpp 2017-10-05 08:45:57.380986950 +0200 | |
210 | @@ -124,9 +124,9 @@ void FileStorageTest::testSpecialChars() | |
211 | event->setDtStart( KDateTime( currentDate ) ); | |
212 | event->setDtEnd( KDateTime( currentDate.addDays( 1 ) ) ); | |
213 | ||
214 | - const char latin1_umlaut[] = { 0xFC, '\0' }; | |
215 | + const QChar latin1_umlaut[] = { 0xFC, QLatin1Char('\0') }; | |
216 | ||
217 | - event->setSummary( QLatin1String( latin1_umlaut ) ); | |
218 | + event->setSummary( QString( latin1_umlaut ) ); | |
219 | ||
220 | // Save to file: | |
221 | MemoryCalendar::Ptr cal( new MemoryCalendar( QLatin1String( "UTC" ) ) ); | |
222 | @@ -151,17 +151,17 @@ void FileStorageTest::testSpecialChars() | |
223 | // Make sure the retrieved incidence is equal to the original one | |
224 | QVERIFY( otherEvent->summary() == event->summary() ); | |
225 | QVERIFY( otherEvent->summary().toLatin1().count() == 1 && | |
226 | - strcmp( otherEvent->summary().toLatin1().constData(), latin1_umlaut ) == 0 ); | |
227 | + strcmp( otherEvent->summary().toLatin1().constData(), QString(latin1_umlaut).toLatin1().constData() ) == 0 ); | |
228 | ||
229 | // Make sure bart.ics is in UTF-8 | |
230 | QFile file( QLatin1String( "bart.ics" ) ); | |
231 | QVERIFY( file.open( QIODevice::ReadOnly | QIODevice::Text ) ); | |
232 | ||
233 | const QByteArray bytesFromFile = file.readAll(); | |
234 | - const char utf_umlaut[] = { 0xC3, 0XBC, '\0' }; | |
235 | + const QChar utf_umlaut[] = { 0xC3, 0XBC, QLatin1Char('\0') }; | |
236 | ||
237 | - QVERIFY( bytesFromFile.contains( utf_umlaut ) ); | |
238 | - QVERIFY( !bytesFromFile.contains( latin1_umlaut ) ); | |
239 | + QVERIFY( bytesFromFile.contains( QString(utf_umlaut).toLatin1().constData() ) ); | |
240 | + QVERIFY( !bytesFromFile.contains( QString(latin1_umlaut).toLatin1().constData() ) ); | |
241 | ||
242 | file.close(); | |
243 | ||
244 | --- kdepimlibs-4.9.1/kcalcore/tests/testicalformat.cpp.org 2017-10-05 08:47:36.937010844 +0200 | |
245 | +++ kdepimlibs-4.9.1/kcalcore/tests/testicalformat.cpp 2017-10-05 08:51:16.639617197 +0200 | |
246 | @@ -47,16 +47,16 @@ void ICalFormatTest::testCharsets() | |
247 | event->setDtEnd( KDateTime( currentDate.addDays( 1 ) ) ); | |
248 | ||
249 | // ü | |
250 | - const char latin1_umlaut[] = { 0xFC, '\0' }; | |
251 | - event->setSummary( latin1_umlaut ); | |
252 | + const QChar latin1_umlaut[] = { 0xFC, QLatin1Char('\0') }; | |
253 | + event->setSummary( QString(latin1_umlaut) ); | |
254 | ||
255 | // Test if toString( Incidence ) didn't mess charsets | |
256 | const QString serialized = format.toString( event.staticCast<Incidence>() ); | |
257 | - const char utf_umlaut[] = { 0xC3, 0XBC, '\0' }; | |
258 | - QVERIFY( serialized.toUtf8().contains( utf_umlaut ) ); | |
259 | - QVERIFY( !serialized.toUtf8().contains( latin1_umlaut ) ); | |
260 | - QVERIFY( serialized.toLatin1().contains( latin1_umlaut ) ); | |
261 | - QVERIFY( !serialized.toLatin1().contains( utf_umlaut ) ); | |
262 | + const QChar utf_umlaut[] = { 0xC3, 0XBC, QLatin1Char('\0') }; | |
263 | + QVERIFY( serialized.toUtf8().contains( QString(utf_umlaut).toLatin1().constData() ) ); | |
264 | + QVERIFY( !serialized.toUtf8().contains( QString(latin1_umlaut).toLatin1().constData() ) ); | |
265 | + QVERIFY( serialized.toLatin1().contains( QString(latin1_umlaut).toLatin1().constData() ) ); | |
266 | + QVERIFY( !serialized.toLatin1().contains( QString(utf_umlaut).toLatin1().constData()) ); | |
267 | ||
268 | // test fromString( QString ) | |
269 | const QString serializedCalendar = "BEGIN:VCALENDAR\nPRODID:-//K Desktop Environment//NONSGML libkcal 3.2//EN\nVERSION:2.0\n" | |
270 | @@ -64,7 +64,7 @@ void ICalFormatTest::testCharsets() | |
271 | ||
272 | Incidence::Ptr event2 = format.fromString( serializedCalendar ); | |
273 | QVERIFY( event->summary() == event2->summary() ); | |
274 | - QVERIFY( event2->summary().toUtf8() == QByteArray( utf_umlaut ) ); | |
275 | + QVERIFY( event2->summary().toUtf8() == QByteArray( QString(utf_umlaut).toLatin1().constData() ) ); | |
276 | ||
277 | // test save() | |
278 | MemoryCalendar::Ptr calendar( new MemoryCalendar( "UTC" ) ); | |
279 | @@ -76,8 +76,8 @@ void ICalFormatTest::testCharsets() | |
280 | QVERIFY( file.open( QIODevice::ReadOnly | QIODevice::Text ) ); | |
281 | ||
282 | const QByteArray bytesFromFile = file.readAll(); | |
283 | - QVERIFY( bytesFromFile.contains( utf_umlaut ) ); | |
284 | - QVERIFY( !bytesFromFile.contains( latin1_umlaut ) ); | |
285 | + QVERIFY( bytesFromFile.contains( QString(utf_umlaut).toLatin1().constData() ) ); | |
286 | + QVERIFY( !bytesFromFile.contains( QString(latin1_umlaut).toLatin1().constData() ) ); | |
287 | file.close(); | |
288 | ||
289 | // Test load: | |
290 | @@ -89,7 +89,7 @@ void ICalFormatTest::testCharsets() | |
291 | // kDebug() << format.toString( calendar2->incidences().first() ); | |
292 | ||
293 | Event::Ptr loadedEvent = calendar2->incidences().first().staticCast<Event>(); | |
294 | - QVERIFY( loadedEvent->summary().toUtf8() == QByteArray( utf_umlaut ) ); | |
295 | + QVERIFY( loadedEvent->summary().toUtf8() == QByteArray( QString(utf_umlaut).toLatin1().constData() ) ); | |
296 | QVERIFY( *loadedEvent == *event ); | |
297 | ||
298 | ||
299 | --- kdepimlibs-4.9.1/akonadi/tests/itemhydratest.cpp~ 2012-08-13 10:47:03.000000000 +0200 | |
300 | +++ kdepimlibs-4.9.1/akonadi/tests/itemhydratest.cpp 2017-10-05 08:54:43.671963119 +0200 | |
301 | @@ -316,8 +316,8 @@ void ItemHydra::testSharedPointerConvers | |
302 | QVERIFY( a.hasPayload<VolkerPtr>() ); | |
303 | QVERIFY( a.hasPayload<RudiPtr>() ); | |
304 | QVERIFY( !a.hasPayload<GerdPtr>() ); | |
305 | - QVERIFY( a.payload<RudiPtr>() ); | |
306 | - QVERIFY( a.payload<VolkerPtr>() ); | |
307 | + QVERIFY( a.payload<RudiPtr>().get() ); | |
308 | + QVERIFY( a.payload<VolkerPtr>().get() ); | |
309 | bool thrown = false, thrownCorrectly = true; | |
310 | try { | |
311 | QVERIFY( !a.payload<GerdPtr>() ); | |
312 | --- kdepimlibs-4.9.1/kmime/tests/auto/contenttest.cpp.org 2017-10-05 09:01:36.680571386 +0200 | |
313 | +++ kdepimlibs-4.9.1/kmime/tests/auto/contenttest.cpp 2017-10-05 09:02:25.575393299 +0200 | |
314 | @@ -320,7 +320,7 @@ void ContentTest::testEncodedContent() | |
315 | void ContentTest::testDecodedContent() | |
316 | { | |
317 | Content *c = new Content(); | |
318 | - c->setBody( '\0' ); | |
319 | + c->setBody( (const char*)'\0' ); | |
320 | QVERIFY( c->decodedContent() == QByteArray() ); | |
321 | c->setBody( QByteArray() ); | |
322 | QVERIFY( c->decodedContent() == QByteArray() ); | |
323 | --- kdepimlibs-4.9.1/kmime/tests/auto/messagetest.cpp.org 2017-10-05 09:06:06.088488409 +0200 | |
324 | +++ kdepimlibs-4.9.1/kmime/tests/auto/messagetest.cpp 2017-10-05 09:06:00.871669191 +0200 | |
325 | @@ -504,7 +504,7 @@ void MessageTest::testEncapsulatedMessag | |
326 | QVERIFY( messageContent->body().isEmpty() ); | |
327 | QCOMPARE( messageContent->contents().count(), 1 ); | |
328 | QVERIFY( messageContent->bodyIsMessage() ); | |
329 | - QVERIFY( messageContent->bodyAsMessage() ); | |
330 | + QVERIFY( messageContent->bodyAsMessage().get() ); | |
331 | QVERIFY( !messageContent->isTopLevel() ); | |
332 | QCOMPARE( messageContent->index().toString().toAscii().data(), "2" ); | |
333 |