From e3ae2f0b8a83e939f37dff0b32f33b5c7b7e2d8e Mon Sep 17 00:00:00 2001 From: CodaFi Date: Thu, 20 Jun 2013 16:31:54 -0600 Subject: Redo commits --- src/objc/imap/MCOIMAPMessage.mm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/objc/imap/MCOIMAPMessage.mm') diff --git a/src/objc/imap/MCOIMAPMessage.mm b/src/objc/imap/MCOIMAPMessage.mm index 9984443e..2f6be457 100644 --- a/src/objc/imap/MCOIMAPMessage.mm +++ b/src/objc/imap/MCOIMAPMessage.mm @@ -27,6 +27,30 @@ MCORegisterClass(self, &typeid(nativeType)); } +- (id) initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + + [self setUid:[aDecoder decodeInt32ForKey:@"uid"]]; + [self setFlags:(MCOMessageFlag)[aDecoder decodeIntForKey:@"flags"]]; + [self setOriginalFlags:(MCOMessageFlag)[aDecoder decodeIntForKey:@"originalFlags"]]; + [self setModSeqValue:[aDecoder decodeInt64ForKey:@"modSeqValue"]]; + [self setMainPart:[aDecoder decodeObjectForKey:@"mainPart"]]; + [self setGmailLabels:[aDecoder decodeObjectForKey:@"gmailLabels"]]; + + return self; +} + +- (void) encodeWithCoder:(NSCoder *)aCoder +{ + [super encodeWithCoder:aCoder]; + [aCoder encodeInt32:[self uid] forKey:@"uid"]; + [aCoder encodeInt:[self flags] forKey:@"flags"]; + [aCoder encodeInt:[self originalFlags] forKey:@"originalFlags"]; + [aCoder encodeInt64:[self modSeqValue] forKey:@"modSeqValue"]; + [aCoder encodeObject:[self mainPart] forKey:@"mainPart"]; + [aCoder encodeObject:[self gmailLabels] forKey:@"gmailLabels"]; +} + - (id) copyWithZone:(NSZone *)zone { nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); -- cgit v1.2.3 From 4a7f9949a20bc0b724bd510668ad4e07ab613683 Mon Sep 17 00:00:00 2001 From: CodaFi Date: Fri, 28 Jun 2013 12:46:24 -0600 Subject: Reduce PR --- src/objc/abstract/MCOAbstractMessage.h | 2 +- src/objc/abstract/MCOAbstractMessage.mm | 28 +++++--------------- src/objc/abstract/MCOAbstractMessagePart.h | 2 +- src/objc/abstract/MCOAbstractMessagePart.mm | 16 ------------ src/objc/abstract/MCOAbstractMultipart.h | 2 +- src/objc/abstract/MCOAbstractMultipart.mm | 14 ---------- src/objc/abstract/MCOAbstractPart.h | 2 +- src/objc/abstract/MCOAbstractPart.mm | 40 ++++++----------------------- src/objc/imap/MCOIMAPMessage.h | 2 +- src/objc/imap/MCOIMAPMessage.mm | 24 ----------------- src/objc/imap/MCOIMAPMessagePart.h | 2 +- src/objc/imap/MCOIMAPMessagePart.mm | 14 ---------- src/objc/imap/MCOIMAPMultipart.h | 2 +- src/objc/imap/MCOIMAPMultipart.mm | 14 ---------- src/objc/imap/MCOIMAPPart.h | 2 +- src/objc/imap/MCOIMAPPart.mm | 18 ------------- 16 files changed, 22 insertions(+), 162 deletions(-) (limited to 'src/objc/imap/MCOIMAPMessage.mm') diff --git a/src/objc/abstract/MCOAbstractMessage.h b/src/objc/abstract/MCOAbstractMessage.h index d60bfe8c..1e6dd2e6 100644 --- a/src/objc/abstract/MCOAbstractMessage.h +++ b/src/objc/abstract/MCOAbstractMessage.h @@ -15,7 +15,7 @@ @class MCOMessageHeader; @class MCOAbstractPart; -@interface MCOAbstractMessage : NSObject +@interface MCOAbstractMessage : NSObject /** Header of the message. */ @property (nonatomic, strong) MCOMessageHeader * header; diff --git a/src/objc/abstract/MCOAbstractMessage.mm b/src/objc/abstract/MCOAbstractMessage.mm index 83f19732..0affe783 100644 --- a/src/objc/abstract/MCOAbstractMessage.mm +++ b/src/objc/abstract/MCOAbstractMessage.mm @@ -38,30 +38,14 @@ return self; } -- (id) initWithCoder:(NSCoder *)decoder -{ - MCOAbstractMessage * abstractPart = [[[[self class] alloc] init] autorelease]; - mailcore::AbstractMessage * message = (mailcore::AbstractMessage *) [abstractPart mco_mcObject]; - message->setHeader((mailcore::MessageHeader *) [[decoder decodeObjectForKey:@"header"] mco_mcObject]); - - self = [self initWithMCMessage:message]; - - return self; -} - -- (void) encodeWithCoder:(NSCoder *)encoder -{ - [encoder encodeObject:[self header] forKey:@"header"]; -} - - (id) copyWithZone:(NSZone *)zone { - MCOAbstractMessage *message; - - message = [[[self class] alloc] initWithMCMessage:(mailcore::AbstractMessage *)_message->copy()->autorelease()]; - [message setHeader:[[[self header] copy] autorelease]]; - - return message; + MCOAbstractMessage *message; + + message = [[[self class] alloc] initWithMCMessage:(mailcore::AbstractMessage *)_message->copy()->autorelease()]; + [message setHeader:[[[self header] copy] autorelease]]; + + return message; } - (void) dealloc diff --git a/src/objc/abstract/MCOAbstractMessagePart.h b/src/objc/abstract/MCOAbstractMessagePart.h index d69b6012..69a6a8f8 100644 --- a/src/objc/abstract/MCOAbstractMessagePart.h +++ b/src/objc/abstract/MCOAbstractMessagePart.h @@ -15,7 +15,7 @@ @class MCOMessageHeader; -@interface MCOAbstractMessagePart : MCOAbstractPart +@interface MCOAbstractMessagePart : MCOAbstractPart // Returns the header of the embedded message. @property (nonatomic, strong) MCOMessageHeader * header; diff --git a/src/objc/abstract/MCOAbstractMessagePart.mm b/src/objc/abstract/MCOAbstractMessagePart.mm index 55a0a828..7d66a355 100644 --- a/src/objc/abstract/MCOAbstractMessagePart.mm +++ b/src/objc/abstract/MCOAbstractMessagePart.mm @@ -18,22 +18,6 @@ #define nativeType mailcore::AbstractMessagePart -- (id) initWithCoder:(NSCoder *)decoder -{ - self = [super init]; - - [self setHeader:[decoder decodeObjectForKey:@"header"]]; - [self setMainPart:[decoder decodeObjectForKey:@"mainPart"]]; - - return self; -} - -- (void) encodeWithCoder:(NSCoder *)encoder -{ - [encoder encodeObject:[self header] forKey:@"header"]; - [encoder encodeObject:[self mainPart] forKey:@"mainPart"]; -} - MCO_OBJC_SYNTHESIZE(MessageHeader, setHeader, header) MCO_OBJC_SYNTHESIZE(AbstractMessagePart, setMainPart, mainPart) diff --git a/src/objc/abstract/MCOAbstractMultipart.h b/src/objc/abstract/MCOAbstractMultipart.h index b3b202db..e43a3e41 100644 --- a/src/objc/abstract/MCOAbstractMultipart.h +++ b/src/objc/abstract/MCOAbstractMultipart.h @@ -13,7 +13,7 @@ #import #import -@interface MCOAbstractMultipart : MCOAbstractPart +@interface MCOAbstractMultipart : MCOAbstractPart /** Returns the subparts of that multipart.*/ @property (nonatomic, copy) NSArray * /* MCOAbstractPart */ parts; diff --git a/src/objc/abstract/MCOAbstractMultipart.mm b/src/objc/abstract/MCOAbstractMultipart.mm index a644a15f..25e633cd 100644 --- a/src/objc/abstract/MCOAbstractMultipart.mm +++ b/src/objc/abstract/MCOAbstractMultipart.mm @@ -16,20 +16,6 @@ #define nativeType mailcore::AbstractMultipart -- (id) initWithCoder:(NSCoder *)decoder -{ - self = [super initWithCoder:decoder]; - - [self setParts:[decoder decodeObjectForKey:@"parts"]]; - - return self; -} - -- (void) encodeWithCoder:(NSCoder *)encoder -{ - [encoder encodeObject:[self parts] forKey:@"parts"]; -} - MCO_OBJC_SYNTHESIZE_ARRAY(setParts, parts) @end diff --git a/src/objc/abstract/MCOAbstractPart.h b/src/objc/abstract/MCOAbstractPart.h index 0703a783..07e44920 100644 --- a/src/objc/abstract/MCOAbstractPart.h +++ b/src/objc/abstract/MCOAbstractPart.h @@ -37,7 +37,7 @@ typedef enum { MCOPartTypeMultipartAlternative, } MCOPartType; -@interface MCOAbstractPart : NSObject +@interface MCOAbstractPart : NSObject /** Returns type of the part (single / message part / multipart/mixed, multipart/related, multipart/alternative). See MCOPartType.*/ diff --git a/src/objc/abstract/MCOAbstractPart.mm b/src/objc/abstract/MCOAbstractPart.mm index 5b108663..a6996a91 100644 --- a/src/objc/abstract/MCOAbstractPart.mm +++ b/src/objc/abstract/MCOAbstractPart.mm @@ -37,44 +37,20 @@ return self; } -- (id) initWithCoder:(NSCoder *)decoder -{ - MCOAbstractPart *abstractPart = [[[[self class] alloc] init] autorelease]; - mailcore::AbstractPart * part = (mailcore::AbstractPart *) [abstractPart mco_mcObject]; - part->setPartType((mailcore::PartType)[decoder decodeIntForKey:@"partType"]); - part->setFilename([[decoder decodeObjectForKey:@"filename"] mco_mcString]); - part->setMimeType([[decoder decodeObjectForKey:@"mimeType"] mco_mcString]); - part->setCharset([[decoder decodeObjectForKey:@"charset"] mco_mcString]); - part->setUniqueID([[decoder decodeObjectForKey:@"uniqueID"] mco_mcString]); - part->setContentID([[decoder decodeObjectForKey:@"contentID"] mco_mcString]); - part->setContentLocation([[decoder decodeObjectForKey:@"contentLocation"] mco_mcString]); - part->setInlineAttachment([decoder decodeBoolForKey:@"inlineAttachment"]); - - self = [self initWithMCPart:part]; - - part->release(); - - return self; -} - -- (void) encodeWithCoder:(NSCoder *)encoder -{ - [encoder encodeInt:[self partType] forKey:@"partType"]; - [encoder encodeObject:[self filename] forKey:@"filename"]; - [encoder encodeObject:[self mimeType] forKey:@"mimeType"]; - [encoder encodeObject:[self charset] forKey:@"charset"]; - [encoder encodeObject:[self uniqueID] forKey:@"uniqueID"]; - [encoder encodeObject:[self contentID] forKey:@"contentID"]; - [encoder encodeObject:[self contentLocation] forKey:@"contentLocation"]; - [encoder encodeBool:[self isInlineAttachment] forKey:@"inlineAttachment"]; -} - - (void) dealloc { _part->release(); [super dealloc]; } +- (id) copyWithZone:(NSZone *)zone +{ + nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); + id result = [[self class] mco_objectWithMCObject:nativeObject]; + MC_SAFE_RELEASE(nativeObject); + return [result retain]; +} + - (NSString *) description { return MCO_OBJC_BRIDGE_GET(description); diff --git a/src/objc/imap/MCOIMAPMessage.h b/src/objc/imap/MCOIMAPMessage.h index 8baae3e9..06e437d8 100644 --- a/src/objc/imap/MCOIMAPMessage.h +++ b/src/objc/imap/MCOIMAPMessage.h @@ -29,7 +29,7 @@ @protocol MCOHTMLRendererIMAPDelegate; -@interface MCOIMAPMessage : MCOAbstractMessage +@interface MCOIMAPMessage : MCOAbstractMessage /** IMAP UID of the message. */ @property (nonatomic, assign) uint32_t uid; diff --git a/src/objc/imap/MCOIMAPMessage.mm b/src/objc/imap/MCOIMAPMessage.mm index 1d31f7b5..c9bfcbb9 100644 --- a/src/objc/imap/MCOIMAPMessage.mm +++ b/src/objc/imap/MCOIMAPMessage.mm @@ -27,30 +27,6 @@ MCORegisterClass(self, &typeid(nativeType)); } -- (id) initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - - [self setUid:[aDecoder decodeInt32ForKey:@"uid"]]; - [self setFlags:(MCOMessageFlag)[aDecoder decodeIntForKey:@"flags"]]; - [self setOriginalFlags:(MCOMessageFlag)[aDecoder decodeIntForKey:@"originalFlags"]]; - [self setModSeqValue:[aDecoder decodeInt64ForKey:@"modSeqValue"]]; - [self setMainPart:[aDecoder decodeObjectForKey:@"mainPart"]]; - [self setGmailLabels:[aDecoder decodeObjectForKey:@"gmailLabels"]]; - - return self; -} - -- (void) encodeWithCoder:(NSCoder *)aCoder -{ - [super encodeWithCoder:aCoder]; - [aCoder encodeInt32:[self uid] forKey:@"uid"]; - [aCoder encodeInt:[self flags] forKey:@"flags"]; - [aCoder encodeInt:[self originalFlags] forKey:@"originalFlags"]; - [aCoder encodeInt64:[self modSeqValue] forKey:@"modSeqValue"]; - [aCoder encodeObject:[self mainPart] forKey:@"mainPart"]; - [aCoder encodeObject:[self gmailLabels] forKey:@"gmailLabels"]; -} - - (id) copyWithZone:(NSZone *)zone { nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); diff --git a/src/objc/imap/MCOIMAPMessagePart.h b/src/objc/imap/MCOIMAPMessagePart.h index c40c2673..b602d93a 100644 --- a/src/objc/imap/MCOIMAPMessagePart.h +++ b/src/objc/imap/MCOIMAPMessagePart.h @@ -14,7 +14,7 @@ #import -@interface MCOIMAPMessagePart : MCOAbstractMessagePart +@interface MCOIMAPMessagePart : MCOAbstractMessagePart /** A part identifier is of the form 1.2.1*/ @property (nonatomic, copy) NSString * partID; diff --git a/src/objc/imap/MCOIMAPMessagePart.mm b/src/objc/imap/MCOIMAPMessagePart.mm index 35c13162..827636b3 100644 --- a/src/objc/imap/MCOIMAPMessagePart.mm +++ b/src/objc/imap/MCOIMAPMessagePart.mm @@ -22,14 +22,6 @@ MCORegisterClass(self, &typeid(nativeType)); } -- (id) initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - - [self setPartID:[aDecoder decodeObjectForKey:@"partID"]]; - - return self; -} - - (id) copyWithZone:(NSZone *)zone { nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); @@ -38,12 +30,6 @@ return [result retain]; } -- (void) encodeWithCoder:(NSCoder *)aCoder -{ - [super encodeWithCoder:aCoder]; - [aCoder encodeObject:[self partID] forKey:@"partID"]; -} - + (NSObject *) mco_objectWithMCObject:(mailcore::Object *)object { mailcore::IMAPMessagePart * part = (mailcore::IMAPMessagePart *) object; diff --git a/src/objc/imap/MCOIMAPMultipart.h b/src/objc/imap/MCOIMAPMultipart.h index d6eb55cb..0e0bb0eb 100644 --- a/src/objc/imap/MCOIMAPMultipart.h +++ b/src/objc/imap/MCOIMAPMultipart.h @@ -14,7 +14,7 @@ #import -@interface MCOIMAPMultipart : MCOAbstractMultipart +@interface MCOIMAPMultipart : MCOAbstractMultipart /** A part identifier looks like 1.2.1 */ @property (nonatomic, copy) NSString * partID; diff --git a/src/objc/imap/MCOIMAPMultipart.mm b/src/objc/imap/MCOIMAPMultipart.mm index 1cc60e05..fdfe4e7a 100644 --- a/src/objc/imap/MCOIMAPMultipart.mm +++ b/src/objc/imap/MCOIMAPMultipart.mm @@ -22,20 +22,6 @@ MCORegisterClass(self, &typeid(nativeType)); } -- (id) initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - - [self setPartID:[aDecoder decodeObjectForKey:@"partID"]]; - - return self; -} - -- (void) encodeWithCoder:(NSCoder *)aCoder -{ - [super encodeWithCoder:aCoder]; - [aCoder encodeObject:[self partID] forKey:@"partID"]; -} - - (id) copyWithZone:(NSZone *)zone { nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); diff --git a/src/objc/imap/MCOIMAPPart.h b/src/objc/imap/MCOIMAPPart.h index bf897f2f..029135bf 100644 --- a/src/objc/imap/MCOIMAPPart.h +++ b/src/objc/imap/MCOIMAPPart.h @@ -16,7 +16,7 @@ /** Represents a single IMAP message part */ -@interface MCOIMAPPart : MCOAbstractPart +@interface MCOIMAPPart : MCOAbstractPart /** A part identifier looks like 1.2.1 */ @property (nonatomic, copy) NSString * partID; diff --git a/src/objc/imap/MCOIMAPPart.mm b/src/objc/imap/MCOIMAPPart.mm index 26d5a961..80b86d23 100644 --- a/src/objc/imap/MCOIMAPPart.mm +++ b/src/objc/imap/MCOIMAPPart.mm @@ -22,24 +22,6 @@ MCORegisterClass(self, &typeid(nativeType)); } -- (id) initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - - [self setPartID:[aDecoder decodeObjectForKey:@"partID"]]; - [self setSize:(unsigned int) [aDecoder decodeIntForKey:@"size"]]; - [self setEncoding:(MCOEncoding) [aDecoder decodeIntForKey:@"encoding"]]; - - return self; -} - -- (void) encodeWithCoder:(NSCoder *)aCoder -{ - [super encodeWithCoder:aCoder]; - [aCoder encodeObject:[self partID] forKey:@"partID"]; - [aCoder encodeInt:[self size] forKey:@"size"]; - [aCoder encodeInt:[self encoding] forKey:@"encoding"]; -} - - (id) copyWithZone:(NSZone *)zone { nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); -- cgit v1.2.3 From 1c7c1d4a5474b093f82f43d514bbb043047d4489 Mon Sep 17 00:00:00 2001 From: Robert Widmann Date: Wed, 3 Jul 2013 21:54:40 -0600 Subject: NSCopying only in base classes --- src/objc/imap/MCOIMAPMessage.h | 2 +- src/objc/imap/MCOIMAPMessage.mm | 8 -------- src/objc/imap/MCOIMAPMessagePart.h | 2 +- src/objc/imap/MCOIMAPMessagePart.mm | 8 -------- src/objc/imap/MCOIMAPMultipart.h | 2 +- src/objc/imap/MCOIMAPMultipart.mm | 8 -------- src/objc/imap/MCOIMAPPart.h | 2 +- src/objc/imap/MCOIMAPPart.mm | 8 -------- src/objc/rfc822/MCOAttachment.h | 2 +- src/objc/rfc822/MCOAttachment.mm | 8 -------- src/objc/rfc822/MCOMessageParser.h | 2 +- src/objc/rfc822/MCOMessageParser.mm | 8 -------- src/objc/rfc822/MCOMessagePart.mm | 8 -------- src/objc/rfc822/MCOMultipart.h | 2 +- src/objc/rfc822/MCOMultipart.mm | 8 -------- 15 files changed, 7 insertions(+), 71 deletions(-) (limited to 'src/objc/imap/MCOIMAPMessage.mm') diff --git a/src/objc/imap/MCOIMAPMessage.h b/src/objc/imap/MCOIMAPMessage.h index 06e437d8..7de1fd69 100644 --- a/src/objc/imap/MCOIMAPMessage.h +++ b/src/objc/imap/MCOIMAPMessage.h @@ -29,7 +29,7 @@ @protocol MCOHTMLRendererIMAPDelegate; -@interface MCOIMAPMessage : MCOAbstractMessage +@interface MCOIMAPMessage : MCOAbstractMessage /** IMAP UID of the message. */ @property (nonatomic, assign) uint32_t uid; diff --git a/src/objc/imap/MCOIMAPMessage.mm b/src/objc/imap/MCOIMAPMessage.mm index c9bfcbb9..2dc71217 100644 --- a/src/objc/imap/MCOIMAPMessage.mm +++ b/src/objc/imap/MCOIMAPMessage.mm @@ -27,14 +27,6 @@ MCORegisterClass(self, &typeid(nativeType)); } -- (id) copyWithZone:(NSZone *)zone -{ - nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); - id result = [[self class] mco_objectWithMCObject:nativeObject]; - MC_SAFE_RELEASE(nativeObject); - return [result retain]; -} - + (NSObject *) mco_objectWithMCObject:(mailcore::Object *)object { mailcore::IMAPMessage * msg = (mailcore::IMAPMessage *) object; diff --git a/src/objc/imap/MCOIMAPMessagePart.h b/src/objc/imap/MCOIMAPMessagePart.h index b602d93a..1e2be559 100644 --- a/src/objc/imap/MCOIMAPMessagePart.h +++ b/src/objc/imap/MCOIMAPMessagePart.h @@ -14,7 +14,7 @@ #import -@interface MCOIMAPMessagePart : MCOAbstractMessagePart +@interface MCOIMAPMessagePart : MCOAbstractMessagePart /** A part identifier is of the form 1.2.1*/ @property (nonatomic, copy) NSString * partID; diff --git a/src/objc/imap/MCOIMAPMessagePart.mm b/src/objc/imap/MCOIMAPMessagePart.mm index 827636b3..05a7e102 100644 --- a/src/objc/imap/MCOIMAPMessagePart.mm +++ b/src/objc/imap/MCOIMAPMessagePart.mm @@ -22,14 +22,6 @@ MCORegisterClass(self, &typeid(nativeType)); } -- (id) copyWithZone:(NSZone *)zone -{ - nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); - id result = [[self class] mco_objectWithMCObject:nativeObject]; - MC_SAFE_RELEASE(nativeObject); - return [result retain]; -} - + (NSObject *) mco_objectWithMCObject:(mailcore::Object *)object { mailcore::IMAPMessagePart * part = (mailcore::IMAPMessagePart *) object; diff --git a/src/objc/imap/MCOIMAPMultipart.h b/src/objc/imap/MCOIMAPMultipart.h index 0e0bb0eb..408b6593 100644 --- a/src/objc/imap/MCOIMAPMultipart.h +++ b/src/objc/imap/MCOIMAPMultipart.h @@ -14,7 +14,7 @@ #import -@interface MCOIMAPMultipart : MCOAbstractMultipart +@interface MCOIMAPMultipart : MCOAbstractMultipart /** A part identifier looks like 1.2.1 */ @property (nonatomic, copy) NSString * partID; diff --git a/src/objc/imap/MCOIMAPMultipart.mm b/src/objc/imap/MCOIMAPMultipart.mm index fdfe4e7a..c3761ade 100644 --- a/src/objc/imap/MCOIMAPMultipart.mm +++ b/src/objc/imap/MCOIMAPMultipart.mm @@ -22,14 +22,6 @@ MCORegisterClass(self, &typeid(nativeType)); } -- (id) copyWithZone:(NSZone *)zone -{ - nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); - id result = [[self class] mco_objectWithMCObject:nativeObject]; - MC_SAFE_RELEASE(nativeObject); - return [result retain]; -} - + (NSObject *) mco_objectWithMCObject:(mailcore::Object *)object { mailcore::IMAPMultipart * part = (mailcore::IMAPMultipart *) object; diff --git a/src/objc/imap/MCOIMAPPart.h b/src/objc/imap/MCOIMAPPart.h index 029135bf..f7bec632 100644 --- a/src/objc/imap/MCOIMAPPart.h +++ b/src/objc/imap/MCOIMAPPart.h @@ -16,7 +16,7 @@ /** Represents a single IMAP message part */ -@interface MCOIMAPPart : MCOAbstractPart +@interface MCOIMAPPart : MCOAbstractPart /** A part identifier looks like 1.2.1 */ @property (nonatomic, copy) NSString * partID; diff --git a/src/objc/imap/MCOIMAPPart.mm b/src/objc/imap/MCOIMAPPart.mm index 80b86d23..80fc2f1e 100644 --- a/src/objc/imap/MCOIMAPPart.mm +++ b/src/objc/imap/MCOIMAPPart.mm @@ -22,14 +22,6 @@ MCORegisterClass(self, &typeid(nativeType)); } -- (id) copyWithZone:(NSZone *)zone -{ - nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); - id result = [[self class] mco_objectWithMCObject:nativeObject]; - MC_SAFE_RELEASE(nativeObject); - return [result retain]; -} - + (NSObject *) mco_objectWithMCObject:(mailcore::Object *)object { mailcore::IMAPPart * part = (mailcore::IMAPPart *) object; diff --git a/src/objc/rfc822/MCOAttachment.h b/src/objc/rfc822/MCOAttachment.h index 50a2d1a7..560f4590 100644 --- a/src/objc/rfc822/MCOAttachment.h +++ b/src/objc/rfc822/MCOAttachment.h @@ -16,7 +16,7 @@ It can either parsed from RFC 822 message data or created to build a message.*/ -@interface MCOAttachment : MCOAbstractPart +@interface MCOAttachment : MCOAbstractPart /** Returns a MIME type for a filename.*/ + (NSString *) mimeTypeForFilename:(NSString *)filename; diff --git a/src/objc/rfc822/MCOAttachment.mm b/src/objc/rfc822/MCOAttachment.mm index 423ac0df..5b20e583 100644 --- a/src/objc/rfc822/MCOAttachment.mm +++ b/src/objc/rfc822/MCOAttachment.mm @@ -26,14 +26,6 @@ MCORegisterClass(self, &typeid(nativeType)); } -- (id) copyWithZone:(NSZone *)zone -{ - nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); - id result = [[self class] mco_objectWithMCObject:nativeObject]; - MC_SAFE_RELEASE(nativeObject); - return [result retain]; -} - + (NSObject *) mco_objectWithMCObject:(mailcore::Object *)object { mailcore::Attachment * attachment = (mailcore::Attachment *) object; diff --git a/src/objc/rfc822/MCOMessageParser.h b/src/objc/rfc822/MCOMessageParser.h index fa46132b..fac86b89 100644 --- a/src/objc/rfc822/MCOMessageParser.h +++ b/src/objc/rfc822/MCOMessageParser.h @@ -20,7 +20,7 @@ @protocol MCOHTMLRendererDelegate; -@interface MCOMessageParser : MCOAbstractMessage +@interface MCOMessageParser : MCOAbstractMessage /** returns a parsed message from the given RFC 822 data.*/ + (MCOMessageParser *) messageParserWithData:(NSData *)data; diff --git a/src/objc/rfc822/MCOMessageParser.mm b/src/objc/rfc822/MCOMessageParser.mm index 05f52f54..7d7f9fcb 100644 --- a/src/objc/rfc822/MCOMessageParser.mm +++ b/src/objc/rfc822/MCOMessageParser.mm @@ -26,14 +26,6 @@ MCORegisterClass(self, &typeid(nativeType)); } -- (id) copyWithZone:(NSZone *)zone -{ - nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); - id result = [[self class] mco_objectWithMCObject:nativeObject]; - MC_SAFE_RELEASE(nativeObject); - return [result retain]; -} - + (id) mco_objectWithMCObject:(mailcore::Object *)object { mailcore::MessageParser * msg = (mailcore::MessageParser *) object; diff --git a/src/objc/rfc822/MCOMessagePart.mm b/src/objc/rfc822/MCOMessagePart.mm index f1535049..4ed4a6d7 100644 --- a/src/objc/rfc822/MCOMessagePart.mm +++ b/src/objc/rfc822/MCOMessagePart.mm @@ -22,14 +22,6 @@ MCORegisterClass(self, &typeid(nativeType)); } -- (id) copyWithZone:(NSZone *)zone -{ - nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); - id result = [[self class] mco_objectWithMCObject:nativeObject]; - MC_SAFE_RELEASE(nativeObject); - return [result retain]; -} - + (id) mco_objectWithMCObject:(mailcore::Object *)object { mailcore::MessagePart * part = (mailcore::MessagePart *) object; diff --git a/src/objc/rfc822/MCOMultipart.h b/src/objc/rfc822/MCOMultipart.h index e45d4a0c..a730b8a4 100644 --- a/src/objc/rfc822/MCOMultipart.h +++ b/src/objc/rfc822/MCOMultipart.h @@ -14,7 +14,7 @@ /** Multipart parsed from RFC 822 message data. */ -@interface MCOMultipart : MCOAbstractMultipart +@interface MCOMultipart : MCOAbstractMultipart @end diff --git a/src/objc/rfc822/MCOMultipart.mm b/src/objc/rfc822/MCOMultipart.mm index 2267f775..78fa1a98 100644 --- a/src/objc/rfc822/MCOMultipart.mm +++ b/src/objc/rfc822/MCOMultipart.mm @@ -22,14 +22,6 @@ MCORegisterClass(self, &typeid(nativeType)); } -- (id) copyWithZone:(NSZone *)zone -{ - nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy(); - id result = [[self class] mco_objectWithMCObject:nativeObject]; - MC_SAFE_RELEASE(nativeObject); - return [result retain]; -} - + (id) mco_objectWithMCObject:(mailcore::Object *)object { mailcore::Attachment * attachment = (mailcore::Attachment *) object; -- cgit v1.2.3