Develop and Download Open Source Software

Browse CVS Repository

Contents of /undmail/guiproto/DUMMailBoxManager.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Wed Jan 29 18:56:31 2003 UTC (21 years, 2 months ago) by footashida
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +16 -0 lines
*** empty log message ***

1 #import "DUMMailBoxManager.h"
2 #import "DUMMailBox.h"
3
4 @implementation DUMMailBoxManager
5 -(id)init{
6 DUMMailBox *inbox;
7 DUMMailBox *outbox;
8 DUMMailBox *sent;
9 DUMMailBox *draft;
10 DUMMailBox *trash;
11 NSBundle *mainBundle;
12 NSString *resourcePath;
13
14 self = [super init];
15 mainBundle = [NSBundle mainBundle];
16 resourcePath = [mainBundle pathForResource:@"undmail-dev" ofType:@"txt"];
17
18 // デフォルトのメールボックスを作成
19 root = [[self createMailBox:@"/"] retain];
20 inbox = [[DUMMailBox alloc] initWithName:
21 [mainBundle localizedStringForKey:@"FolderLabel_Inbox"
22 value:nil
23 table:nil]
24 dataFilePath:resourcePath];
25 outbox = [[DUMMailBox alloc] initWithName:
26 [mainBundle localizedStringForKey:@"FolderLabel_Outbox"
27 value:nil
28 table:nil]
29 dataFilePath:nil];
30 sent = [[DUMMailBox alloc] initWithName:
31 [mainBundle localizedStringForKey:@"FolderLabel_Sent"
32 value:nil
33 table:nil]
34 dataFilePath:nil];
35 draft = [[DUMMailBox alloc] initWithName:
36 [mainBundle localizedStringForKey:@"FolderLabel_Draft"
37 value:nil
38 table:nil]
39 dataFilePath:nil];
40 trash = [[DUMMailBox alloc] initWithName:
41 [mainBundle localizedStringForKey:@"FolderLabel_Trash"
42 value:nil
43 table:nil]
44 dataFilePath:nil];
45
46 [root addMailBox:inbox];
47 [root addMailBox:outbox];
48 [root addMailBox:sent];
49 [root addMailBox:draft];
50 [root addMailBox:trash];
51
52 [inbox release];
53 [outbox release];
54 [sent release];
55 [draft release];
56 [trash release];
57
58 return self;
59 }
60 -(void)dealloc{
61 [root release];
62 [super dealloc];
63 }
64 -(DUMMailBox *)rootMailBox{
65 return root;
66 }
67 -(DUMMailBox *)createMailBox:(NSString *)name{
68 return [[[DUMMailBox alloc] initWithName:name dataFilePath:nil] autorelease];
69 }
70
71 @end

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26