diff options
author | Hoa V. Dinh <dinh.viet.hoa@gmail.com> | 2015-09-08 16:53:20 -0700 |
---|---|---|
committer | Hoa V. Dinh <dinh.viet.hoa@gmail.com> | 2015-09-08 16:53:20 -0700 |
commit | 5be4a51db5a247d8a1ca25e0bc7b4782491e6425 (patch) | |
tree | 5376c3445f068ce4677bf7f4e194f216d099502e | |
parent | 18b80e588a52607f2eaa76683de5904c7d56119c (diff) |
Fixed build. Fixed warning properly.
-rw-r--r-- | src/objc/abstract/MCOAbstractMessage+Private.h | 27 | ||||
-rw-r--r-- | src/objc/abstract/MCOAbstractMessage.h | 10 | ||||
-rw-r--r-- | src/objc/abstract/MCOAbstractMessage.mm | 3 | ||||
-rw-r--r-- | src/objc/abstract/MCOAbstractPart+Private.h | 29 | ||||
-rw-r--r-- | src/objc/abstract/MCOAbstractPart.h | 10 | ||||
-rw-r--r-- | src/objc/abstract/MCOAbstractPart.mm | 4 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPMessage.mm | 1 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPMessagePart.mm | 1 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPMultipart.mm | 1 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPPart.mm | 1 | ||||
-rw-r--r-- | src/objc/rfc822/MCOAttachment.mm | 3 | ||||
-rw-r--r-- | src/objc/rfc822/MCOMessageBuilder.mm | 1 | ||||
-rw-r--r-- | src/objc/rfc822/MCOMessageParser.mm | 1 | ||||
-rw-r--r-- | src/objc/rfc822/MCOMessagePart.mm | 1 | ||||
-rw-r--r-- | src/objc/rfc822/MCOMultipart.mm | 1 |
15 files changed, 25 insertions, 69 deletions
diff --git a/src/objc/abstract/MCOAbstractMessage+Private.h b/src/objc/abstract/MCOAbstractMessage+Private.h deleted file mode 100644 index e3f37128..00000000 --- a/src/objc/abstract/MCOAbstractMessage+Private.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// MCOAbstractMessage+Private.h -// mailcore2 -// -// Created by DINH Viêt Hoà on 3/23/13. -// Copyright (c) 2013 MailCore. All rights reserved. -// - -#ifndef MAILCORE_MCOABSTRACTMESSAGE_PRIVATE_H - -#define MAILCORE_MCOABSTRACTMESSAGE_PRIVATE_H - -#ifdef __cplusplus - -namespace mailcore { - class AbstractMessage; -} - -@interface MCOAbstractMessage (Private) - -- (id) initWithMCMessage:(mailcore::AbstractMessage *)message; - -@end - -#endif - -#endif diff --git a/src/objc/abstract/MCOAbstractMessage.h b/src/objc/abstract/MCOAbstractMessage.h index d917d82f..aa5db14b 100644 --- a/src/objc/abstract/MCOAbstractMessage.h +++ b/src/objc/abstract/MCOAbstractMessage.h @@ -15,8 +15,18 @@ @class MCOMessageHeader; @class MCOAbstractPart; +#ifdef __cplusplus +namespace mailcore { + class AbstractMessage; +} +#endif + @interface MCOAbstractMessage : NSObject <NSCopying> +#ifdef __cplusplus +- (id) initWithMCMessage:(mailcore::AbstractMessage *)message NS_DESIGNATED_INITIALIZER; +#endif + /** Header of the message. */ @property (nonatomic, strong) MCOMessageHeader * header; diff --git a/src/objc/abstract/MCOAbstractMessage.mm b/src/objc/abstract/MCOAbstractMessage.mm index a1eb4250..8debf90d 100644 --- a/src/objc/abstract/MCOAbstractMessage.mm +++ b/src/objc/abstract/MCOAbstractMessage.mm @@ -30,6 +30,7 @@ - (id) init { + self = [self initWithMCMessage:NULL]; MCAssert(0); return nil; } @@ -38,7 +39,7 @@ { self = [super init]; - message->retain(); + MC_SAFE_RETAIN(message); _message = message; return self; diff --git a/src/objc/abstract/MCOAbstractPart+Private.h b/src/objc/abstract/MCOAbstractPart+Private.h deleted file mode 100644 index f64ea960..00000000 --- a/src/objc/abstract/MCOAbstractPart+Private.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// MCOAbstractPart+Private.h -// mailcore2 -// -// Created by DINH Viêt Hoà on 3/21/13. -// Copyright (c) 2013 MailCore. All rights reserved. -// - -#ifndef MAILCORE_MCOABSTRACTPART_PRIVATE_H - -#define MAILCORE_MCOABSTRACTPART_PRIVATE_H - -#include <MailCore/MCOAbstractPart.h> - -#ifdef __cplusplus - -namespace mailcore { - class AbstractPart; -} - -@interface MCOAbstractPart (Private) - -- (id) initWithMCPart:(mailcore::AbstractPart *)part; - -@end - -#endif - -#endif diff --git a/src/objc/abstract/MCOAbstractPart.h b/src/objc/abstract/MCOAbstractPart.h index 72383f9a..e9febdc0 100644 --- a/src/objc/abstract/MCOAbstractPart.h +++ b/src/objc/abstract/MCOAbstractPart.h @@ -41,8 +41,18 @@ typedef NS_ENUM(NSInteger, MCOPartType) { MCOPartTypeMultipartSigned, }; +#ifdef __cplusplus +namespace mailcore { + class AbstractPart; +} +#endif + @interface MCOAbstractPart : NSObject <NSCopying> +#ifdef __cplusplus +- (id) initWithMCPart:(mailcore::AbstractPart *)part NS_DESIGNATED_INITIALIZER; +#endif + /** Returns type of the part (single / message part / multipart/mixed, multipart/related, multipart/alternative). See MCOPartType.*/ @property (nonatomic, assign) MCOPartType partType; diff --git a/src/objc/abstract/MCOAbstractPart.mm b/src/objc/abstract/MCOAbstractPart.mm index e71c7413..e0d3a244 100644 --- a/src/objc/abstract/MCOAbstractPart.mm +++ b/src/objc/abstract/MCOAbstractPart.mm @@ -7,7 +7,6 @@ // #import "MCOAbstractPart.h" -#import "MCOAbstractPart+Private.h" #include "MCAbstractPart.h" #include "MCAbstractMessage.h" @@ -29,6 +28,7 @@ - (id) init { + self = [self initWithMCPart:NULL]; MCAssert(0); return nil; } @@ -37,7 +37,7 @@ { self = [super init]; - part->retain(); + MC_SAFE_RETAIN(part); _part = part; return self; diff --git a/src/objc/imap/MCOIMAPMessage.mm b/src/objc/imap/MCOIMAPMessage.mm index d7d499ef..4c16a17a 100644 --- a/src/objc/imap/MCOIMAPMessage.mm +++ b/src/objc/imap/MCOIMAPMessage.mm @@ -10,7 +10,6 @@ #include "MCIMAP.h" -#import "MCOAbstractMessage+Private.h" #import "MCOUtils.h" #import "MCOAbstractMessageRendererCallback.h" #import "MCOHTMLRendererDelegate.h" diff --git a/src/objc/imap/MCOIMAPMessagePart.mm b/src/objc/imap/MCOIMAPMessagePart.mm index 909d5ea9..05c214d1 100644 --- a/src/objc/imap/MCOIMAPMessagePart.mm +++ b/src/objc/imap/MCOIMAPMessagePart.mm @@ -10,7 +10,6 @@ #include "MCIMAP.h" -#import "MCOAbstractPart+Private.h" #import "MCOUtils.h" @implementation MCOIMAPMessagePart diff --git a/src/objc/imap/MCOIMAPMultipart.mm b/src/objc/imap/MCOIMAPMultipart.mm index 056322b4..5fb94c20 100644 --- a/src/objc/imap/MCOIMAPMultipart.mm +++ b/src/objc/imap/MCOIMAPMultipart.mm @@ -10,7 +10,6 @@ #include "MCIMAP.h" -#import "MCOAbstractPart+Private.h" #import "MCOUtils.h" @implementation MCOIMAPMultipart diff --git a/src/objc/imap/MCOIMAPPart.mm b/src/objc/imap/MCOIMAPPart.mm index da44eb9d..f69ad447 100644 --- a/src/objc/imap/MCOIMAPPart.mm +++ b/src/objc/imap/MCOIMAPPart.mm @@ -10,7 +10,6 @@ #include "MCIMAP.h" -#import "MCOAbstractPart+Private.h" #import "MCOUtils.h" @implementation MCOIMAPPart diff --git a/src/objc/rfc822/MCOAttachment.mm b/src/objc/rfc822/MCOAttachment.mm index afaf96af..d7cbadc4 100644 --- a/src/objc/rfc822/MCOAttachment.mm +++ b/src/objc/rfc822/MCOAttachment.mm @@ -10,7 +10,6 @@ #include "MCAttachment.h" -#import "MCOAbstractPart+Private.h" #import "MCOUtils.h" #import "NSString+MCO.h" #import "NSObject+MCO.h" @@ -35,7 +34,7 @@ - (id) init { mailcore::Attachment * attachment = new mailcore::Attachment(); - self = [self initWithMCPart:attachment]; + self = [super initWithMCPart:attachment]; attachment->release(); return self; diff --git a/src/objc/rfc822/MCOMessageBuilder.mm b/src/objc/rfc822/MCOMessageBuilder.mm index 090fc99d..84cff18d 100644 --- a/src/objc/rfc822/MCOMessageBuilder.mm +++ b/src/objc/rfc822/MCOMessageBuilder.mm @@ -11,7 +11,6 @@ #include "MCRFC822.h" #import "MCOUtils.h" -#import "MCOAbstractMessage+Private.h" #import "MCOAbstractMessageRendererCallback.h" @implementation MCOMessageBuilder diff --git a/src/objc/rfc822/MCOMessageParser.mm b/src/objc/rfc822/MCOMessageParser.mm index 2b0866a3..228a27b9 100644 --- a/src/objc/rfc822/MCOMessageParser.mm +++ b/src/objc/rfc822/MCOMessageParser.mm @@ -13,7 +13,6 @@ #import "MCOHTMLRendererDelegate.h" #import "NSObject+MCO.h" -#import "MCOAbstractMessage+Private.h" #import "MCOUtils.h" #import "MCOAbstractMessageRendererCallback.h" diff --git a/src/objc/rfc822/MCOMessagePart.mm b/src/objc/rfc822/MCOMessagePart.mm index 4ed4a6d7..f78a0a3f 100644 --- a/src/objc/rfc822/MCOMessagePart.mm +++ b/src/objc/rfc822/MCOMessagePart.mm @@ -11,7 +11,6 @@ #include "MCRFC822.h" #import "NSObject+MCO.h" -#import "MCOAbstractPart+Private.h" @implementation MCOMessagePart diff --git a/src/objc/rfc822/MCOMultipart.mm b/src/objc/rfc822/MCOMultipart.mm index 78fa1a98..e990ad08 100644 --- a/src/objc/rfc822/MCOMultipart.mm +++ b/src/objc/rfc822/MCOMultipart.mm @@ -11,7 +11,6 @@ #include "MCRFC822.h" #import "NSObject+MCO.h" -#import "MCOAbstractPart+Private.h" @implementation MCOMultipart |