diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-09-13 12:42:31 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-09-13 12:42:31 +0200 |
commit | c12a9a09da59b9e418316dba02e6215cb55e47ee (patch) | |
tree | 05498d9a42e399bcca787f40c1fc473fb09e680e /examples | |
parent | 55fe06979ceebe67553135b43aa47e70d931304b (diff) | |
parent | ebdb89b8bb482bbb5ecd544c3d38bef35fc7d820 (diff) | |
download | sink-0.4.0.tar.gz sink-0.4.0.zip |
Merge commit 'ebdb89b8bb482bbb5ecd544c3d38bef35fc7d820'v0.4.0
Diffstat (limited to 'examples')
-rw-r--r-- | examples/davresource/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/davresource/davresource.cpp | 28 | ||||
-rw-r--r-- | examples/dummyresource/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/imapresource/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/imapresource/imapresource.cpp | 11 | ||||
-rw-r--r-- | examples/imapresource/imapserverproxy.cpp | 35 | ||||
-rw-r--r-- | examples/imapresource/imapserverproxy.h | 4 | ||||
-rw-r--r-- | examples/maildirresource/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/mailtransportresource/CMakeLists.txt | 18 |
9 files changed, 70 insertions, 38 deletions
diff --git a/examples/davresource/CMakeLists.txt b/examples/davresource/CMakeLists.txt index 7091edc..2351ecd 100644 --- a/examples/davresource/CMakeLists.txt +++ b/examples/davresource/CMakeLists.txt | |||
@@ -6,7 +6,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) | |||
6 | find_package(KPimKDAV2 REQUIRED) | 6 | find_package(KPimKDAV2 REQUIRED) |
7 | 7 | ||
8 | add_library(${PROJECT_NAME} SHARED davresource.cpp) | 8 | add_library(${PROJECT_NAME} SHARED davresource.cpp) |
9 | qt5_use_modules(${PROJECT_NAME} Core Network) | 9 | target_link_libraries(${PROJECT_NAME} sink Qt5::Core Qt5::Network KPim::KDAV2) |
10 | target_link_libraries(${PROJECT_NAME} sink KPim::KDAV2) | ||
11 | 10 | ||
12 | install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${SINK_RESOURCE_PLUGINS_PATH}) | 11 | install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${SINK_RESOURCE_PLUGINS_PATH}) |
diff --git a/examples/davresource/davresource.cpp b/examples/davresource/davresource.cpp index 465220f..22c502f 100644 --- a/examples/davresource/davresource.cpp +++ b/examples/davresource/davresource.cpp | |||
@@ -93,7 +93,7 @@ public: | |||
93 | QVector<QByteArray> ridList; | 93 | QVector<QByteArray> ridList; |
94 | for(const auto &f : addressbookList) { | 94 | for(const auto &f : addressbookList) { |
95 | const auto &rid = getRid(f); | 95 | const auto &rid = getRid(f); |
96 | SinkTrace() << "Found addressbook:" << rid; | 96 | SinkLog() << "Found addressbook:" << rid << f.displayName(); |
97 | ridList.append(rid); | 97 | ridList.append(rid); |
98 | createAddressbook(f.displayName(), rid, ""); | 98 | createAddressbook(f.displayName(), rid, ""); |
99 | } | 99 | } |
@@ -138,19 +138,21 @@ public: | |||
138 | if (error) { | 138 | if (error) { |
139 | SinkWarningCtx(mLogCtx) << "Failed to synchronize addressbooks." << collectionsFetchJob->errorString(); | 139 | SinkWarningCtx(mLogCtx) << "Failed to synchronize addressbooks." << collectionsFetchJob->errorString(); |
140 | } else { | 140 | } else { |
141 | synchronizeAddressbooks(collectionsFetchJob ->collections()); | 141 | synchronizeAddressbooks(collectionsFetchJob->collections()); |
142 | } | 142 | } |
143 | }); | 143 | }); |
144 | return job; | 144 | return job; |
145 | } else if (query.type() == ApplicationDomain::getTypeName<ApplicationDomain::Contact>()) { | 145 | } else if (query.type() == ApplicationDomain::getTypeName<ApplicationDomain::Contact>()) { |
146 | SinkLogCtx(mLogCtx) << "Synchronizing contacts."; | 146 | SinkLogCtx(mLogCtx) << "Synchronizing contacts."; |
147 | auto ridList = QSharedPointer<QByteArrayList>::create(); | 147 | auto ridList = QSharedPointer<QByteArrayList>::create(); |
148 | auto total = QSharedPointer<int>::create(0); | ||
149 | auto progress = QSharedPointer<int>::create(0); | ||
148 | auto collectionsFetchJob = new KDAV2::DavCollectionsFetchJob(mResourceUrl); | 150 | auto collectionsFetchJob = new KDAV2::DavCollectionsFetchJob(mResourceUrl); |
149 | auto job = runJob(collectionsFetchJob).then([this, collectionsFetchJob] { | 151 | auto job = runJob(collectionsFetchJob).then([this, collectionsFetchJob] { |
150 | synchronizeAddressbooks(collectionsFetchJob ->collections()); | 152 | synchronizeAddressbooks(collectionsFetchJob ->collections()); |
151 | return collectionsFetchJob->collections(); | 153 | return collectionsFetchJob->collections(); |
152 | }) | 154 | }) |
153 | .serialEach([this, ridList](const KDAV2::DavCollection &collection) { | 155 | .serialEach([=](const KDAV2::DavCollection &collection) { |
154 | auto collId = getRid(collection); | 156 | auto collId = getRid(collection); |
155 | const auto addressbookLocalId = syncStore().resolveRemoteId(ENTITY_TYPE_ADDRESSBOOK, collId); | 157 | const auto addressbookLocalId = syncStore().resolveRemoteId(ENTITY_TYPE_ADDRESSBOOK, collId); |
156 | auto ctag = collection.CTag().toLatin1(); | 158 | auto ctag = collection.CTag().toLatin1(); |
@@ -158,10 +160,11 @@ public: | |||
158 | SinkTraceCtx(mLogCtx) << "Syncing " << collId; | 160 | SinkTraceCtx(mLogCtx) << "Syncing " << collId; |
159 | auto cache = std::shared_ptr<KDAV2::EtagCache>(new KDAV2::EtagCache()); | 161 | auto cache = std::shared_ptr<KDAV2::EtagCache>(new KDAV2::EtagCache()); |
160 | auto davItemsListJob = new KDAV2::DavItemsListJob(collection.url(), cache); | 162 | auto davItemsListJob = new KDAV2::DavItemsListJob(collection.url(), cache); |
161 | const QByteArray bufferType = ENTITY_TYPE_CONTACT; | ||
162 | QHash<QByteArray, Query::Comparator> mergeCriteria; | 163 | QHash<QByteArray, Query::Comparator> mergeCriteria; |
163 | auto colljob = runJob(davItemsListJob).then([davItemsListJob] { | 164 | auto colljob = runJob(davItemsListJob).then([=] { |
164 | return KAsync::value(davItemsListJob->items()); | 165 | const auto items = davItemsListJob->items(); |
166 | *total = items.size(); | ||
167 | return KAsync::value(items); | ||
165 | }) | 168 | }) |
166 | .serialEach([=] (const KDAV2::DavItem &item) { | 169 | .serialEach([=] (const KDAV2::DavItem &item) { |
167 | QByteArray rid = getRid(item); | 170 | QByteArray rid = getRid(item); |
@@ -175,13 +178,19 @@ public: | |||
175 | Sink::ApplicationDomain::Contact contact; | 178 | Sink::ApplicationDomain::Contact contact; |
176 | contact.setVcard(item.data()); | 179 | contact.setVcard(item.data()); |
177 | contact.setAddressbook(addressbookLocalId); | 180 | contact.setAddressbook(addressbookLocalId); |
178 | createOrModify(bufferType, rid, contact, mergeCriteria); | 181 | createOrModify(ENTITY_TYPE_CONTACT, rid, contact, mergeCriteria); |
179 | return item; | 182 | return item; |
180 | }) | 183 | }) |
181 | .then([this, ridList] (const KDAV2::DavItem &item) { | 184 | .then([=] (const KDAV2::DavItem &item) { |
182 | const auto rid = getRid(item); | 185 | const auto rid = getRid(item); |
183 | syncStore().writeValue(rid + "_etag", item.etag().toLatin1()); | 186 | syncStore().writeValue(rid + "_etag", item.etag().toLatin1()); |
184 | ridList->append(rid); | 187 | ridList->append(rid); |
188 | *progress += 1; | ||
189 | reportProgress(*progress, *total, QByteArrayList{} << addressbookLocalId); | ||
190 | //commit every 5 contacts (so contacts start appearing in the UI) | ||
191 | if ((*progress % 5) == 0) { | ||
192 | commit(); | ||
193 | } | ||
185 | return rid; | 194 | return rid; |
186 | }); | 195 | }); |
187 | return itemjob; | 196 | return itemjob; |
@@ -190,7 +199,7 @@ public: | |||
190 | return KAsync::value(rid); | 199 | return KAsync::value(rid); |
191 | } | 200 | } |
192 | }) | 201 | }) |
193 | .then([this, collId, ctag] () { | 202 | .then([=] () { |
194 | syncStore().writeValue(collId + "_ctag", ctag); | 203 | syncStore().writeValue(collId + "_ctag", ctag); |
195 | }); | 204 | }); |
196 | return colljob; | 205 | return colljob; |
@@ -251,6 +260,7 @@ DavResourceFactory::DavResourceFactory(QObject *parent) | |||
251 | : Sink::ResourceFactory(parent, | 260 | : Sink::ResourceFactory(parent, |
252 | {Sink::ApplicationDomain::ResourceCapabilities::Contact::contact, | 261 | {Sink::ApplicationDomain::ResourceCapabilities::Contact::contact, |
253 | Sink::ApplicationDomain::ResourceCapabilities::Contact::addressbook, | 262 | Sink::ApplicationDomain::ResourceCapabilities::Contact::addressbook, |
263 | Sink::ApplicationDomain::ResourceCapabilities::Contact::storage | ||
254 | } | 264 | } |
255 | ) | 265 | ) |
256 | { | 266 | { |
diff --git a/examples/dummyresource/CMakeLists.txt b/examples/dummyresource/CMakeLists.txt index 2bbaa47..62e96f1 100644 --- a/examples/dummyresource/CMakeLists.txt +++ b/examples/dummyresource/CMakeLists.txt | |||
@@ -6,7 +6,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) | |||
6 | 6 | ||
7 | add_library(${PROJECT_NAME} SHARED resourcefactory.cpp domainadaptor.cpp dummystore.cpp) | 7 | add_library(${PROJECT_NAME} SHARED resourcefactory.cpp domainadaptor.cpp dummystore.cpp) |
8 | generate_flatbuffers(${PROJECT_NAME} dummycalendar) | 8 | generate_flatbuffers(${PROJECT_NAME} dummycalendar) |
9 | qt5_use_modules(${PROJECT_NAME} Core Network) | 9 | target_link_libraries(${PROJECT_NAME} sink Qt5::Core Qt5::Network) |
10 | target_link_libraries(${PROJECT_NAME} sink) | ||
11 | 10 | ||
12 | install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${SINK_RESOURCE_PLUGINS_PATH}) | 11 | install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${SINK_RESOURCE_PLUGINS_PATH}) |
diff --git a/examples/imapresource/CMakeLists.txt b/examples/imapresource/CMakeLists.txt index 5d2d38b..f5f51f8 100644 --- a/examples/imapresource/CMakeLists.txt +++ b/examples/imapresource/CMakeLists.txt | |||
@@ -9,8 +9,7 @@ find_package(KIMAP2 0.2 REQUIRED) | |||
9 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) | 9 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) |
10 | 10 | ||
11 | add_library(${PROJECT_NAME} SHARED imapresource.cpp imapserverproxy.cpp) | 11 | add_library(${PROJECT_NAME} SHARED imapresource.cpp imapserverproxy.cpp) |
12 | qt5_use_modules(${PROJECT_NAME} Core Network) | 12 | target_link_libraries(${PROJECT_NAME} sink Qt5::Core Qt5::Network KF5::Mime KIMAP2) |
13 | target_link_libraries(${PROJECT_NAME} sink KF5::Mime KIMAP2) | ||
14 | 13 | ||
15 | install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${SINK_RESOURCE_PLUGINS_PATH}) | 14 | install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${SINK_RESOURCE_PLUGINS_PATH}) |
16 | 15 | ||
diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp index 81c808b..3ae7fd7 100644 --- a/examples/imapresource/imapresource.cpp +++ b/examples/imapresource/imapresource.cpp | |||
@@ -511,6 +511,8 @@ public: | |||
511 | return {ApplicationDomain::LoginError, error.errorMessage}; | 511 | return {ApplicationDomain::LoginError, error.errorMessage}; |
512 | case Imap::HostNotFoundError: | 512 | case Imap::HostNotFoundError: |
513 | return {ApplicationDomain::NoServerError, error.errorMessage}; | 513 | return {ApplicationDomain::NoServerError, error.errorMessage}; |
514 | case Imap::ConnectionLost: | ||
515 | return {ApplicationDomain::ConnectionLostError, error.errorMessage}; | ||
514 | default: | 516 | default: |
515 | return {ApplicationDomain::UnknownError, error.errorMessage}; | 517 | return {ApplicationDomain::UnknownError, error.errorMessage}; |
516 | } | 518 | } |
@@ -619,6 +621,15 @@ public: | |||
619 | 621 | ||
620 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Mail &mail, Sink::Operation operation, const QByteArray &oldRemoteId, const QList<QByteArray> &changedProperties) Q_DECL_OVERRIDE | 622 | KAsync::Job<QByteArray> replay(const ApplicationDomain::Mail &mail, Sink::Operation operation, const QByteArray &oldRemoteId, const QList<QByteArray> &changedProperties) Q_DECL_OVERRIDE |
621 | { | 623 | { |
624 | if (operation != Sink::Operation_Creation) { | ||
625 | if(oldRemoteId.isEmpty()) { | ||
626 | // return KAsync::error<QByteArray>("Tried to replay modification without old remoteId."); | ||
627 | qWarning() << "Tried to replay modification without old remoteId."; | ||
628 | // Since we can't recover from the situation we just skip over the revision. | ||
629 | // FIXME figure out how we can ever end up in this situation | ||
630 | return KAsync::null<QByteArray>(); | ||
631 | } | ||
632 | } | ||
622 | auto imap = QSharedPointer<ImapServerProxy>::create(mServer, mPort, &mSessionCache); | 633 | auto imap = QSharedPointer<ImapServerProxy>::create(mServer, mPort, &mSessionCache); |
623 | auto login = imap->login(mUser, mPassword); | 634 | auto login = imap->login(mUser, mPassword); |
624 | KAsync::Job<QByteArray> job = KAsync::null<QByteArray>(); | 635 | KAsync::Job<QByteArray> job = KAsync::null<QByteArray>(); |
diff --git a/examples/imapresource/imapserverproxy.cpp b/examples/imapresource/imapserverproxy.cpp index 538105c..5c2e07c 100644 --- a/examples/imapresource/imapserverproxy.cpp +++ b/examples/imapresource/imapserverproxy.cpp | |||
@@ -61,6 +61,21 @@ const char* Imap::Capabilities::Namespace = "NAMESPACE"; | |||
61 | const char* Imap::Capabilities::Uidplus = "UIDPLUS"; | 61 | const char* Imap::Capabilities::Uidplus = "UIDPLUS"; |
62 | const char* Imap::Capabilities::Condstore = "CONDSTORE"; | 62 | const char* Imap::Capabilities::Condstore = "CONDSTORE"; |
63 | 63 | ||
64 | static int translateImapError(int error) | ||
65 | { | ||
66 | switch (error) { | ||
67 | case KJob::UserDefinedError: | ||
68 | return Imap::ConnectionLost; | ||
69 | case KIMAP2::LoginJob::ErrorCode::ERR_HOST_NOT_FOUND: | ||
70 | return Imap::HostNotFoundError; | ||
71 | case KIMAP2::LoginJob::ErrorCode::ERR_COULD_NOT_CONNECT: | ||
72 | return Imap::CouldNotConnectError; | ||
73 | case KIMAP2::LoginJob::ErrorCode::ERR_SSL_HANDSHAKE_FAILED: | ||
74 | return Imap::SslHandshakeError; | ||
75 | } | ||
76 | return Imap::UnknownError; | ||
77 | } | ||
78 | |||
64 | template <typename T> | 79 | template <typename T> |
65 | static KAsync::Job<T> runJob(KJob *job, const std::function<T(KJob*)> &f) | 80 | static KAsync::Job<T> runJob(KJob *job, const std::function<T(KJob*)> &f) |
66 | { | 81 | { |
@@ -69,7 +84,8 @@ static KAsync::Job<T> runJob(KJob *job, const std::function<T(KJob*)> &f) | |||
69 | SinkTrace() << "Job done: " << job->metaObject()->className(); | 84 | SinkTrace() << "Job done: " << job->metaObject()->className(); |
70 | if (job->error()) { | 85 | if (job->error()) { |
71 | SinkWarning() << "Job failed: " << job->errorString() << job->metaObject()->className(); | 86 | SinkWarning() << "Job failed: " << job->errorString() << job->metaObject()->className(); |
72 | future.setError(job->error(), job->errorString()); | 87 | auto proxyError = translateImapError(job->error()); |
88 | future.setError(proxyError, job->errorString()); | ||
73 | } else { | 89 | } else { |
74 | future.setValue(f(job)); | 90 | future.setValue(f(job)); |
75 | future.setFinished(); | 91 | future.setFinished(); |
@@ -87,7 +103,8 @@ static KAsync::Job<void> runJob(KJob *job) | |||
87 | SinkTrace() << "Job done: " << job->metaObject()->className(); | 103 | SinkTrace() << "Job done: " << job->metaObject()->className(); |
88 | if (job->error()) { | 104 | if (job->error()) { |
89 | SinkWarning() << "Job failed: " << job->errorString() << job->metaObject()->className(); | 105 | SinkWarning() << "Job failed: " << job->errorString() << job->metaObject()->className(); |
90 | future.setError(job->error(), job->errorString()); | 106 | auto proxyError = translateImapError(job->error()); |
107 | future.setError(proxyError, job->errorString()); | ||
91 | } else { | 108 | } else { |
92 | future.setFinished(); | 109 | future.setFinished(); |
93 | } | 110 | } |
@@ -166,20 +183,6 @@ KAsync::Job<void> ImapServerProxy::login(const QString &username, const QString | |||
166 | // SinkTrace() << "Found personal namespaces: " << mNamespaces.personal; | 183 | // SinkTrace() << "Found personal namespaces: " << mNamespaces.personal; |
167 | // SinkTrace() << "Found shared namespaces: " << mNamespaces.shared; | 184 | // SinkTrace() << "Found shared namespaces: " << mNamespaces.shared; |
168 | // SinkTrace() << "Found user namespaces: " << mNamespaces.user; | 185 | // SinkTrace() << "Found user namespaces: " << mNamespaces.user; |
169 | }).then([=] (const KAsync::Error &error) { | ||
170 | if (error) { | ||
171 | switch (error.errorCode) { | ||
172 | case KIMAP2::LoginJob::ErrorCode::ERR_HOST_NOT_FOUND: | ||
173 | return KAsync::error(HostNotFoundError, "Host not found: " + error.errorMessage); | ||
174 | case KIMAP2::LoginJob::ErrorCode::ERR_COULD_NOT_CONNECT: | ||
175 | return KAsync::error(CouldNotConnectError, "Failed to connect: " + error.errorMessage); | ||
176 | case KIMAP2::LoginJob::ErrorCode::ERR_SSL_HANDSHAKE_FAILED: | ||
177 | return KAsync::error(SslHandshakeError, "Ssl handshake failed: " + error.errorMessage); | ||
178 | default: | ||
179 | return KAsync::error(error); | ||
180 | } | ||
181 | } | ||
182 | return KAsync::null(); | ||
183 | }); | 186 | }); |
184 | } | 187 | } |
185 | 188 | ||
diff --git a/examples/imapresource/imapserverproxy.h b/examples/imapresource/imapserverproxy.h index 82f4f58..f9b854b 100644 --- a/examples/imapresource/imapserverproxy.h +++ b/examples/imapresource/imapserverproxy.h | |||
@@ -33,7 +33,9 @@ enum ErrorCode { | |||
33 | NoError, | 33 | NoError, |
34 | HostNotFoundError, | 34 | HostNotFoundError, |
35 | CouldNotConnectError, | 35 | CouldNotConnectError, |
36 | SslHandshakeError | 36 | SslHandshakeError, |
37 | ConnectionLost, | ||
38 | UnknownError | ||
37 | }; | 39 | }; |
38 | 40 | ||
39 | namespace Flags | 41 | namespace Flags |
diff --git a/examples/maildirresource/CMakeLists.txt b/examples/maildirresource/CMakeLists.txt index a8f0359..690817e 100644 --- a/examples/maildirresource/CMakeLists.txt +++ b/examples/maildirresource/CMakeLists.txt | |||
@@ -6,8 +6,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) | |||
6 | find_package(KF5 COMPONENTS REQUIRED Mime) | 6 | find_package(KF5 COMPONENTS REQUIRED Mime) |
7 | 7 | ||
8 | add_library(${PROJECT_NAME} SHARED facade.cpp maildirresource.cpp libmaildir/maildir.cpp libmaildir/keycache.cpp) | 8 | add_library(${PROJECT_NAME} SHARED facade.cpp maildirresource.cpp libmaildir/maildir.cpp libmaildir/keycache.cpp) |
9 | qt5_use_modules(${PROJECT_NAME} Core Network) | 9 | target_link_libraries(${PROJECT_NAME} sink Qt5::Core Qt5::Network KF5::Mime) |
10 | target_link_libraries(${PROJECT_NAME} sink KF5::Mime) | ||
11 | 10 | ||
12 | install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${SINK_RESOURCE_PLUGINS_PATH}) | 11 | install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${SINK_RESOURCE_PLUGINS_PATH}) |
13 | 12 | ||
diff --git a/examples/mailtransportresource/CMakeLists.txt b/examples/mailtransportresource/CMakeLists.txt index 03b89db..1c34676 100644 --- a/examples/mailtransportresource/CMakeLists.txt +++ b/examples/mailtransportresource/CMakeLists.txt | |||
@@ -10,13 +10,23 @@ include_directories(${CURL_INCLUDE_DIRS}) | |||
10 | 10 | ||
11 | 11 | ||
12 | add_library(${PROJECT_NAME} SHARED mailtransportresource.cpp mailtransport.cpp) | 12 | add_library(${PROJECT_NAME} SHARED mailtransportresource.cpp mailtransport.cpp) |
13 | qt5_use_modules(${PROJECT_NAME} Core Network) | 13 | target_link_libraries(${PROJECT_NAME} |
14 | target_link_libraries(${PROJECT_NAME} sink KF5::Mime ${CURL_LIBRARIES}) | 14 | sink |
15 | Qt5::Core | ||
16 | Qt5::Network | ||
17 | KF5::Mime | ||
18 | ${CURL_LIBRARIES} | ||
19 | ) | ||
15 | install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${SINK_RESOURCE_PLUGINS_PATH}) | 20 | install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${SINK_RESOURCE_PLUGINS_PATH}) |
16 | 21 | ||
17 | add_executable(sink_smtp_test smtptest.cpp mailtransport.cpp) | 22 | add_executable(sink_smtp_test smtptest.cpp mailtransport.cpp) |
18 | qt5_use_modules(sink_smtp_test Core Network) | 23 | target_link_libraries(sink_smtp_test |
19 | target_link_libraries(sink_smtp_test sink KF5::Mime ${CURL_LIBRARIES}) | 24 | sink |
25 | Qt5::Core | ||
26 | Qt5::Network | ||
27 | KF5::Mime | ||
28 | ${CURL_LIBRARIES} | ||
29 | ) | ||
20 | install(TARGETS sink_smtp_test ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) | 30 | install(TARGETS sink_smtp_test ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) |
21 | 31 | ||
22 | add_subdirectory(tests) | 32 | add_subdirectory(tests) |