summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-07-19 13:23:32 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-09-15 16:14:19 +0200
commit1e96213e9617d658627f9219fa1750f4466de653 (patch)
tree1e85ee592379a6369cb128dde02df5359bfffa65
parentae46ff86990c786060c6ebfe69cc3e7a6bb051a5 (diff)
downloadsink-1e96213e9617d658627f9219fa1750f4466de653.tar.gz
sink-1e96213e9617d658627f9219fa1750f4466de653.zip
Cleanup
-rw-r--r--common/entityreader.cpp1
-rw-r--r--common/listener.cpp2
-rw-r--r--examples/imapresource/imapresource.cpp4
-rw-r--r--synchronizer/main.cpp15
4 files changed, 8 insertions, 14 deletions
diff --git a/common/entityreader.cpp b/common/entityreader.cpp
index 411e7e4..01c25d2 100644
--- a/common/entityreader.cpp
+++ b/common/entityreader.cpp
@@ -88,7 +88,6 @@ EntityReader<DomainType>::EntityReader(const QByteArray &resourceType, const QBy
88 mDomainTypeAdaptorFactory(*mDomainTypeAdaptorFactoryPtr) 88 mDomainTypeAdaptorFactory(*mDomainTypeAdaptorFactoryPtr)
89{ 89{
90 Q_ASSERT(!resourceType.isEmpty()); 90 Q_ASSERT(!resourceType.isEmpty());
91 SinkTrace() << "resourceType " << resourceType;
92 Q_ASSERT(mDomainTypeAdaptorFactoryPtr); 91 Q_ASSERT(mDomainTypeAdaptorFactoryPtr);
93} 92}
94 93
diff --git a/common/listener.cpp b/common/listener.cpp
index 8f7518f..a051293 100644
--- a/common/listener.cpp
+++ b/common/listener.cpp
@@ -82,6 +82,7 @@ Listener::Listener(const QByteArray &resourceInstanceIdentifier, const QByteArra
82 82
83Listener::~Listener() 83Listener::~Listener()
84{ 84{
85 SinkTrace() << "Shutting down " << m_resourceInstanceIdentifier;
85 closeAllConnections(); 86 closeAllConnections();
86} 87}
87 88
@@ -335,6 +336,7 @@ void Listener::sendShutdownNotification()
335 336
336void Listener::quit() 337void Listener::quit()
337{ 338{
339 SinkTrace() << "Quitting " << m_resourceInstanceIdentifier;
338 m_clientBufferProcessesTimer->stop(); 340 m_clientBufferProcessesTimer->stop();
339 m_server->close(); 341 m_server->close();
340 sendShutdownNotification(); 342 sendShutdownNotification();
diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp
index 6f201ff..1dc503d 100644
--- a/examples/imapresource/imapresource.cpp
+++ b/examples/imapresource/imapresource.cpp
@@ -173,7 +173,7 @@ public:
173 createOrModify(bufferType, remoteId, mail); 173 createOrModify(bufferType, remoteId, mail);
174 } 174 }
175 const auto elapsed = time->elapsed(); 175 const auto elapsed = time->elapsed();
176 SinkLog() << "Synchronized " << count << " mails in " << path << Sink::Log::TraceTime(elapsed) << " " << elapsed/qMax(count, 1) << " [ms/mail]"; 176 SinkTrace() << "Synchronized " << count << " mails in " << path << Sink::Log::TraceTime(elapsed) << " " << elapsed/qMax(count, 1) << " [ms/mail]";
177 } 177 }
178 178
179 void synchronizeRemovals(const QString &path, const QSet<qint64> &messages) 179 void synchronizeRemovals(const QString &path, const QSet<qint64> &messages)
@@ -249,8 +249,8 @@ public:
249 continue; 249 continue;
250 } 250 }
251 QSet<qint64> uids; 251 QSet<qint64> uids;
252 SinkLog() << "Synchronizing mails" << folder.normalizedPath();
252 auto messagesFuture = imap.fetchMessages(folder, [this, folder, &uids](const QVector<Message> &messages) { 253 auto messagesFuture = imap.fetchMessages(folder, [this, folder, &uids](const QVector<Message> &messages) {
253 SinkTrace() << "Synchronizing mails" << folder.normalizedPath();
254 for (const auto &msg : messages) { 254 for (const auto &msg : messages) {
255 uids << msg.uid; 255 uids << msg.uid;
256 } 256 }
diff --git a/synchronizer/main.cpp b/synchronizer/main.cpp
index e9dd6cb..110e59c 100644
--- a/synchronizer/main.cpp
+++ b/synchronizer/main.cpp
@@ -113,21 +113,14 @@ void terminateHandler()
113 if (exptr != 0) 113 if (exptr != 0)
114 { 114 {
115 // the only useful feature of std::exception_ptr is that it can be rethrown... 115 // the only useful feature of std::exception_ptr is that it can be rethrown...
116 try 116 try {
117 {
118 std::rethrow_exception(exptr); 117 std::rethrow_exception(exptr);
119 } 118 } catch (std::exception &ex) {
120 catch (std::exception &ex)
121 {
122 std::fprintf(stderr, "Terminated due to exception: %s\n", ex.what()); 119 std::fprintf(stderr, "Terminated due to exception: %s\n", ex.what());
123 } 120 } catch (...) {
124 catch (...)
125 {
126 std::fprintf(stderr, "Terminated due to unknown exception\n"); 121 std::fprintf(stderr, "Terminated due to unknown exception\n");
127 } 122 }
128 } 123 } else {
129 else
130 {
131 std::fprintf(stderr, "Terminated due to unknown reason :(\n"); 124 std::fprintf(stderr, "Terminated due to unknown reason :(\n");
132 } 125 }
133 std::abort(); 126 std::abort();