diff options
author | Paul Young <paulyoungonline@gmail.com> | 2013-07-04 15:50:36 -0400 |
---|---|---|
committer | Paul Young <paulyoungonline@gmail.com> | 2013-07-04 15:50:36 -0400 |
commit | ab7e732f161078a3640a415de02aac0ba6c6afe2 (patch) | |
tree | e8a33c7717eda0e21a72e850cdc49dfc3cdffe6c /src | |
parent | 7c042bd2f247e808b7eb4a93b02b24e6faec0339 (diff) | |
parent | 2a36c7acd33ac51be81209d0baac67c54bbd0800 (diff) |
Merge branch 'master' into message-rendering-with-session
Diffstat (limited to 'src')
-rw-r--r-- | src/async/imap/MCIMAPAsyncConnection.cc | 2 | ||||
-rw-r--r-- | src/async/imap/MCIMAPIdleOperation.cc | 4 | ||||
-rw-r--r-- | src/async/pop/MCPOPAsyncSession.cc | 2 | ||||
-rw-r--r-- | src/async/smtp/MCSMTPAsyncSession.cc | 2 | ||||
-rw-r--r-- | src/core/basetypes/MCConnectionLogger.h | 1 | ||||
-rw-r--r-- | src/core/basetypes/MCLog.c (renamed from src/core/basetypes/MCLog.cc) | 6 | ||||
-rw-r--r-- | src/core/basetypes/MCLog.h | 22 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPSession.mm | 2 | ||||
-rw-r--r-- | src/objc/pop/MCOPOPSession.mm | 2 | ||||
-rw-r--r-- | src/objc/smtp/MCOSMTPSession.mm | 2 |
10 files changed, 25 insertions, 20 deletions
diff --git a/src/async/imap/MCIMAPAsyncConnection.cc b/src/async/imap/MCIMAPAsyncConnection.cc index fc1935b7..1d07f79a 100644 --- a/src/async/imap/MCIMAPAsyncConnection.cc +++ b/src/async/imap/MCIMAPAsyncConnection.cc @@ -69,7 +69,7 @@ namespace mailcore { virtual ~IMAPConnectionLogger() { } - virtual void log(void * context, void * sender, ConnectionLogType logType, Data * buffer) + virtual void log(void * sender, ConnectionLogType logType, Data * buffer) { mConnection->logConnection(logType, buffer); } diff --git a/src/async/imap/MCIMAPIdleOperation.cc b/src/async/imap/MCIMAPIdleOperation.cc index 42c58f90..8b48b77c 100644 --- a/src/async/imap/MCIMAPIdleOperation.cc +++ b/src/async/imap/MCIMAPIdleOperation.cc @@ -47,7 +47,7 @@ void IMAPIdleOperation::unprepare() void IMAPIdleOperation::main() { - performMethodOnMainThread((Object::Method) &IMAPIdleOperation::prepare, NULL); + performMethodOnMainThread((Object::Method) &IMAPIdleOperation::prepare, NULL, true); if (!mSetupSuccess) { return; @@ -57,7 +57,7 @@ void IMAPIdleOperation::main() session()->session()->idle(folder(), mLastKnownUid, &error); setError(error); - performMethodOnMainThread((Object::Method) &IMAPIdleOperation::unprepare, NULL); + performMethodOnMainThread((Object::Method) &IMAPIdleOperation::unprepare, NULL, true); } void IMAPIdleOperation::interruptIdle() diff --git a/src/async/pop/MCPOPAsyncSession.cc b/src/async/pop/MCPOPAsyncSession.cc index 342b0f5e..bfabc847 100644 --- a/src/async/pop/MCPOPAsyncSession.cc +++ b/src/async/pop/MCPOPAsyncSession.cc @@ -50,7 +50,7 @@ namespace mailcore { virtual ~POPConnectionLogger() { } - virtual void log(void * context, void * sender, ConnectionLogType logType, Data * buffer) + virtual void log(void * sender, ConnectionLogType logType, Data * buffer) { mSession->logConnection(logType, buffer); } diff --git a/src/async/smtp/MCSMTPAsyncSession.cc b/src/async/smtp/MCSMTPAsyncSession.cc index fafc2e82..38d57756 100644 --- a/src/async/smtp/MCSMTPAsyncSession.cc +++ b/src/async/smtp/MCSMTPAsyncSession.cc @@ -41,7 +41,7 @@ namespace mailcore { virtual ~SMTPConnectionLogger() { } - virtual void log(void * context, void * sender, ConnectionLogType logType, Data * buffer) + virtual void log(void * sender, ConnectionLogType logType, Data * buffer) { mSession->logConnection(logType, buffer); } diff --git a/src/core/basetypes/MCConnectionLogger.h b/src/core/basetypes/MCConnectionLogger.h index dd596857..bdb588bc 100644 --- a/src/core/basetypes/MCConnectionLogger.h +++ b/src/core/basetypes/MCConnectionLogger.h @@ -16,7 +16,6 @@ namespace mailcore { class Data; - class String; enum ConnectionLogType { // Received data diff --git a/src/core/basetypes/MCLog.cc b/src/core/basetypes/MCLog.c index 7db01b41..8744f2dd 100644 --- a/src/core/basetypes/MCLog.cc +++ b/src/core/basetypes/MCLog.c @@ -9,7 +9,7 @@ #include <unistd.h> static pid_t sPid = -1; -bool mailcore::logEnabled = false; +int MCLogEnabled = 0; __attribute__((constructor)) static void initialize() { @@ -20,7 +20,7 @@ static void logInternalv(FILE * file, const char * user, const char * filename, unsigned int line, int dumpStack, const char * format, va_list argp); -void mailcore::logInternal(const char * user, +void MCLogInternal(const char * user, const char * filename, unsigned int line, int dumpStack, @@ -37,7 +37,7 @@ static void logInternalv(FILE * file, const char * user, const char * filename, unsigned int line, int dumpStack, const char * format, va_list argp) { - if (!mailcore::logEnabled) + if (!MCLogEnabled) return; while (1) { diff --git a/src/core/basetypes/MCLog.h b/src/core/basetypes/MCLog.h index b84a2182..de75314f 100644 --- a/src/core/basetypes/MCLog.h +++ b/src/core/basetypes/MCLog.h @@ -6,22 +6,28 @@ #ifdef __cplusplus -#define MCLog(...) mailcore::logInternal(NULL, __FILE__, __LINE__, 0, __VA_ARGS__) +#define MCLog(...) MCLogInternal(NULL, __FILE__, __LINE__, 0, __VA_ARGS__) namespace mailcore { - extern bool logEnabled; + extern int MCLogEnabled; #ifndef __printflike #define __printflike(a,b) #endif - void logInternal(const char * user, - const char * filename, - unsigned int line, - int dumpStack, - const char * format, ...) __printflike(5, 6); - +#ifdef __cplusplus +extern "C" { +#endif + void MCLogInternal(const char * user, + const char * filename, + unsigned int line, + int dumpStack, + const char * format, ...) __printflike(5, 6); +#ifdef __cplusplus +} +#endif + } #endif diff --git a/src/objc/imap/MCOIMAPSession.mm b/src/objc/imap/MCOIMAPSession.mm index 43f366e6..0c23f1e2 100644 --- a/src/objc/imap/MCOIMAPSession.mm +++ b/src/objc/imap/MCOIMAPSession.mm @@ -35,7 +35,7 @@ public: mSession = session; } - virtual void log(void * context, void * sender, ConnectionLogType logType, Data * data) + virtual void log(void * sender, ConnectionLogType logType, Data * data) { [mSession _logWithSender:sender connectionType:(MCOConnectionLogType)logType data:MCO_TO_OBJC(data)]; } diff --git a/src/objc/pop/MCOPOPSession.mm b/src/objc/pop/MCOPOPSession.mm index 42c76646..fb48cb1e 100644 --- a/src/objc/pop/MCOPOPSession.mm +++ b/src/objc/pop/MCOPOPSession.mm @@ -31,7 +31,7 @@ public: mSession = session; } - virtual void log(void * context, void * sender, ConnectionLogType logType, Data * data) + virtual void log(void * sender, ConnectionLogType logType, Data * data) { [mSession _logWithSender:sender connectionType:(MCOConnectionLogType)logType data:MCO_TO_OBJC(data)]; } diff --git a/src/objc/smtp/MCOSMTPSession.mm b/src/objc/smtp/MCOSMTPSession.mm index 1538d53a..1cadf4ad 100644 --- a/src/objc/smtp/MCOSMTPSession.mm +++ b/src/objc/smtp/MCOSMTPSession.mm @@ -32,7 +32,7 @@ public: mSession = session; } - virtual void log(void * context, void * sender, ConnectionLogType logType, Data * data) + virtual void log(void * sender, ConnectionLogType logType, Data * data) { [mSession _logWithSender:sender connectionType:(MCOConnectionLogType)logType data:MCO_TO_OBJC(data)]; } |