Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

New features

  • Loading branch information...
commit 96c64502e551b001beac802db594593886e81a28 1 parent 67e769d
authored
View
2  AppController.h
@@ -17,6 +17,6 @@
-(IBAction)save:(id)sender;
-(IBAction)reset:(id)sender;
--(IBAction)test1:(id)sender;
+-(IBAction)loadFiles:(id)sender;
@end
View
7 AppController.m
@@ -10,6 +10,7 @@
#import "CoreDataManager.h"
#import "ModelManager.h"
#import "ViewerController.h"
+#import "QueueManager.h"
#import "ResourceTransfer.h"
@implementation AppController
@@ -71,10 +72,10 @@ - (BOOL)application:(NSApplication *)theApplication
#pragma mark -
#pragma mark test functions
--(IBAction)test1:(id)sender
+-(IBAction)loadFiles:(id)sender
{
- ResourceTransfer* ex = [[[ResourceTransfer alloc] init] autorelease];
-
+ QueueManager* qm = [QueueManager sharedManager];
+ [qm loadFiles];
}
@end
View
8 BlogAssistant.xcodeproj/project.pbxproj
@@ -8,6 +8,8 @@
/* Begin PBXBuildFile section */
224339580A6F05F3000348D4 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 224339570A6F05F3000348D4 /* WebKit.framework */; };
+ 4C5E7F531118D76900D0F7FE /* QueueManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C5E7F521118D76900D0F7FE /* QueueManager.m */; };
+ 4C5E7F541118D76900D0F7FE /* QueueManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C5E7F521118D76900D0F7FE /* QueueManager.m */; };
4C9E245A11042F9E00BBF548 /* Resource.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9E245911042F9E00BBF548 /* Resource.m */; };
4CC455F510E2E35100311A67 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CC455F410E2E35100311A67 /* MainMenu.xib */; };
4CC455F610E2E36000311A67 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC455F010E2E2D500311A67 /* main.m */; };
@@ -62,6 +64,8 @@
224339570A6F05F3000348D4 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = "<absolute>"; };
32DBCF980370C29C00C91783 /* BlogAssistant_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlogAssistant_Prefix.pch; sourceTree = "<group>"; };
4C3435D8110957D6002593EF /* BlogAssistant.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BlogAssistant.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 4C5E7F511118D76900D0F7FE /* QueueManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QueueManager.h; sourceTree = "<group>"; };
+ 4C5E7F521118D76900D0F7FE /* QueueManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QueueManager.m; sourceTree = "<group>"; };
4C9E245811042F9E00BBF548 /* Resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Resource.h; sourceTree = "<group>"; };
4C9E245911042F9E00BBF548 /* Resource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Resource.m; sourceTree = "<group>"; };
4CC455E810E2E18A00311A67 /* BlogAssistant.App-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BlogAssistant.App-Info.plist"; sourceTree = "<group>"; };
@@ -251,6 +255,8 @@
4CD402BE10FD7C810008CFE2 /* PathManager.m */,
4CF7A11E1117F589004775E7 /* ImageManager.h */,
4CF7A11F1117F589004775E7 /* ImageManager.m */,
+ 4C5E7F511118D76900D0F7FE /* QueueManager.h */,
+ 4C5E7F521118D76900D0F7FE /* QueueManager.m */,
);
name = Models;
sourceTree = "<group>";
@@ -375,6 +381,7 @@
4C9E245A11042F9E00BBF548 /* Resource.m in Sources */,
4CC52E70111687120017AC6B /* ResourceTransfer.m in Sources */,
4CF7A1211117F589004775E7 /* ImageManager.m in Sources */,
+ 4C5E7F541118D76900D0F7FE /* QueueManager.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -389,6 +396,7 @@
4CD402BF10FD7C810008CFE2 /* PathManager.m in Sources */,
4CC52E6F111687120017AC6B /* ResourceTransfer.m in Sources */,
4CF7A1201117F589004775E7 /* ImageManager.m in Sources */,
+ 4C5E7F531118D76900D0F7FE /* QueueManager.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
444 MainMenu.xib
@@ -1,20 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
-<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.02">
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
- <string key="IBDocument.SystemVersion">9L30</string>
- <string key="IBDocument.InterfaceBuilderVersion">672</string>
- <string key="IBDocument.AppKitVersion">949.54</string>
- <string key="IBDocument.HIToolboxVersion">353.00</string>
+ <string key="IBDocument.SystemVersion">10C540</string>
+ <string key="IBDocument.InterfaceBuilderVersion">740</string>
+ <string key="IBDocument.AppKitVersion">1038.25</string>
+ <string key="IBDocument.HIToolboxVersion">458.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="NS.object.0">740</string>
+ </object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="450"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>com.apple.InterfaceBuilderKit</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomObject" id="1021">
@@ -71,7 +83,7 @@
</object>
<object class="NSMenuItem" id="609285721">
<reference key="NSMenu" ref="110575045"/>
- <string type="base64-UTF8" key="NSTitle">UHJlZmVyZW5jZXPigKY</string>
+ <string key="NSTitle">Preferences…</string>
<string key="NSKeyEquiv">,</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
@@ -186,7 +198,7 @@
</object>
<object class="NSMenuItem" id="722745758">
<reference key="NSMenu" ref="720053764"/>
- <string type="base64-UTF8" key="NSTitle">T3BlbuKApg</string>
+ <string key="NSTitle">Open…</string>
<string key="NSKeyEquiv">o</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
@@ -247,7 +259,7 @@
</object>
<object class="NSMenuItem" id="117038363">
<reference key="NSMenu" ref="720053764"/>
- <string type="base64-UTF8" key="NSTitle">U2F2ZSBBc+KApg</string>
+ <string key="NSTitle">Save As…</string>
<string key="NSKeyEquiv">S</string>
<int key="NSKeyEquivModMask">1179648</int>
<int key="NSMnemonicLoc">2147483647</int>
@@ -284,7 +296,7 @@
</object>
<object class="NSMenuItem" id="49223823">
<reference key="NSMenu" ref="720053764"/>
- <string type="base64-UTF8" key="NSTitle">UHJpbnTigKY</string>
+ <string key="NSTitle">Print…</string>
<string key="NSKeyEquiv">p</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
@@ -402,7 +414,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMenuItem" id="447796847">
<reference key="NSMenu" ref="963351320"/>
- <string type="base64-UTF8" key="NSTitle">RmluZOKApg</string>
+ <string key="NSTitle">Find…</string>
<string key="NSKeyEquiv">f</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
@@ -466,7 +478,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMenuItem" id="679648819">
<reference key="NSMenu" ref="769623530"/>
- <string type="base64-UTF8" key="NSTitle">U2hvdyBTcGVsbGluZ+KApg</string>
+ <string key="NSTitle">Show Spelling…</string>
<string key="NSKeyEquiv">:</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
@@ -986,7 +998,7 @@
</object>
<object class="NSMenuItem" id="237841660">
<reference key="NSMenu" ref="466310130"/>
- <string type="base64-UTF8" key="NSTitle">Q3VzdG9taXplIFRvb2xiYXLigKY</string>
+ <string key="NSTitle">Customize Toolbar…</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="90941078"/>
@@ -1122,21 +1134,21 @@
<object class="NSMutableArray" key="NSTableColumns">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSTableColumn" id="453096846">
- <double key="NSWidth">2.500000e+02</double>
- <double key="NSMinWidth">4.000000e+01</double>
- <double key="NSMaxWidth">1.000000e+03</double>
+ <double key="NSWidth">250</double>
+ <double key="NSMinWidth">40</double>
+ <double key="NSMaxWidth">1000</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
- <int key="NSCellFlags">75628032</int>
- <int key="NSCellFlags2">0</int>
+ <int key="NSCellFlags">75628096</int>
+ <int key="NSCellFlags2">2048</int>
<string key="NSContents">title</string>
<object class="NSFont" key="NSSupport" id="26">
<string key="NSName">LucidaGrande</string>
- <double key="NSSize">1.100000e+01</double>
+ <double key="NSSize">11</double>
<int key="NSfFlags">3100</int>
</object>
<object class="NSColor" key="NSBackgroundColor" id="848016028">
<int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MC4zMzMzMzI5OQA</bytes>
+ <bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
</object>
<object class="NSColor" key="NSTextColor" id="1040013546">
<int key="NSColorSpace">6</int>
@@ -1154,7 +1166,7 @@
<string key="NSContents">Text Cell</string>
<object class="NSFont" key="NSSupport" id="393231002">
<string key="NSName">LucidaGrande</string>
- <double key="NSSize">1.300000e+01</double>
+ <double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<reference key="NSControlView" ref="273973925"/>
@@ -1164,7 +1176,7 @@
<string key="NSColorName">controlBackgroundColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MC42NjY2NjY2OQA</bytes>
+ <bytes key="NSWhite">MC42NjY2NjY2ODY1AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor" id="229315641">
@@ -1180,12 +1192,12 @@
<reference key="NSTableView" ref="273973925"/>
</object>
<object class="NSTableColumn" id="565738269">
- <double key="NSWidth">1.200000e+02</double>
- <double key="NSMinWidth">1.000000e+01</double>
- <double key="NSMaxWidth">3.402823e+38</double>
+ <double key="NSWidth">120</double>
+ <double key="NSMinWidth">10</double>
+ <double key="NSMaxWidth">3.4028230607370965e+38</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
- <int key="NSCellFlags">75628032</int>
- <int key="NSCellFlags2">0</int>
+ <int key="NSCellFlags">75628096</int>
+ <int key="NSCellFlags2">2048</int>
<string key="NSContents">createdDate</string>
<reference key="NSSupport" ref="26"/>
<object class="NSColor" key="NSBackgroundColor" id="310547737">
@@ -1214,12 +1226,12 @@
<reference key="NSTableView" ref="273973925"/>
</object>
<object class="NSTableColumn" id="908016302">
- <double key="NSWidth">1.240000e+02</double>
- <double key="NSMinWidth">4.000000e+01</double>
- <double key="NSMaxWidth">1.000000e+03</double>
+ <double key="NSWidth">124</double>
+ <double key="NSMinWidth">40</double>
+ <double key="NSMaxWidth">1000</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
- <int key="NSCellFlags">75628032</int>
- <int key="NSCellFlags2">0</int>
+ <int key="NSCellFlags">75628096</int>
+ <int key="NSCellFlags2">2048</int>
<string key="NSContents">imageFilename</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSBackgroundColor" ref="848016028"/>
@@ -1240,12 +1252,12 @@
<reference key="NSTableView" ref="273973925"/>
</object>
<object class="NSTableColumn" id="1024950090">
- <double key="NSWidth">2.530000e+02</double>
- <double key="NSMinWidth">1.000000e+01</double>
- <double key="NSMaxWidth">3.402823e+38</double>
+ <double key="NSWidth">253</double>
+ <double key="NSMinWidth">10</double>
+ <double key="NSMaxWidth">3.4028230607370965e+38</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
- <int key="NSCellFlags">75628032</int>
- <int key="NSCellFlags2">0</int>
+ <int key="NSCellFlags">75628096</int>
+ <int key="NSCellFlags2">2048</int>
<string key="NSContents">url</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSBackgroundColor" ref="310547737"/>
@@ -1266,8 +1278,8 @@
<reference key="NSTableView" ref="273973925"/>
</object>
</object>
- <double key="NSIntercellSpacingWidth">3.000000e+00</double>
- <double key="NSIntercellSpacingHeight">2.000000e+00</double>
+ <double key="NSIntercellSpacingWidth">3</double>
+ <double key="NSIntercellSpacingHeight">2</double>
<reference key="NSBackgroundColor" ref="58824710"/>
<object class="NSColor" key="NSGridColor">
<int key="NSColorSpace">6</int>
@@ -1278,12 +1290,15 @@
<bytes key="NSWhite">MC41AA</bytes>
</object>
</object>
- <double key="NSRowHeight">1.700000e+01</double>
+ <double key="NSRowHeight">17</double>
<int key="NSTvFlags">-700448768</int>
+ <reference key="NSDelegate"/>
+ <reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">4</int>
<int key="NSDraggingSourceMaskForLocal">15</int>
<int key="NSDraggingSourceMaskForNonLocal">0</int>
<bool key="NSAllowsTypeSelect">YES</bool>
+ <int key="NSTableViewDraggingDestinationStyle">0</int>
</object>
</object>
<string key="NSFrame">{{1, 17}, {759, 252}}</string>
@@ -1300,8 +1315,8 @@
<reference key="NSSuperview" ref="408868439"/>
<reference key="NSTarget" ref="408868439"/>
<string key="NSAction">_doScroller:</string>
- <double key="NSCurValue">3.700000e+01</double>
- <double key="NSPercent">1.947368e-01</double>
+ <double key="NSCurValue">37</double>
+ <double key="NSPercent">0.1947367936372757</double>
</object>
<object class="NSScroller" id="158571649">
<reference key="NSNextResponder" ref="408868439"/>
@@ -1311,7 +1326,7 @@
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="408868439"/>
<string key="NSAction">_doScroller:</string>
- <double key="NSPercent">9.986842e-01</double>
+ <double key="NSPercent">0.99868422746658325</double>
</object>
<object class="NSClipView" id="781727329">
<reference key="NSNextResponder" ref="408868439"/>
@@ -1429,7 +1444,7 @@
<object class="NSButtonCell" key="NSCell" id="669793305">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">134217728</int>
- <string key="NSContents">test1</string>
+ <string key="NSContents">loadFiles</string>
<reference key="NSSupport" ref="393231002"/>
<reference key="NSControlView" ref="716215009"/>
<int key="NSButtonFlags">-2038284033</int>
@@ -2088,34 +2103,40 @@
</object>
<int key="connectionID">522</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">loadFiles:</string>
+ <reference key="source" ref="910320110"/>
+ <reference key="destination" ref="716215009"/>
+ </object>
+ <int key="connectionID">525</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
- <object class="NSArray" key="object" id="1049">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
+ <reference key="object" ref="0"/>
<reference key="children" ref="1048"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="1021"/>
- <reference key="parent" ref="1049"/>
- <string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1014"/>
- <reference key="parent" ref="1049"/>
+ <reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="1050"/>
- <reference key="parent" ref="1049"/>
+ <reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
@@ -2131,7 +2152,7 @@
<reference ref="586577488"/>
<reference ref="410009974"/>
</object>
- <reference key="parent" ref="1049"/>
+ <reference key="parent" ref="0"/>
<string key="objectName">MainMenu</string>
</object>
<object class="IBObjectRecord">
@@ -2663,7 +2684,7 @@
<object class="IBObjectRecord">
<int key="objectID">371</int>
<reference key="object" ref="979998279"/>
- <reference key="parent" ref="1049"/>
+ <reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">373</int>
@@ -2973,7 +2994,7 @@
<object class="IBObjectRecord">
<int key="objectID">448</int>
<reference key="object" ref="910320110"/>
- <reference key="parent" ref="1049"/>
+ <reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">449</int>
@@ -2982,7 +3003,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="810384753"/>
</object>
- <reference key="parent" ref="1049"/>
+ <reference key="parent" ref="0"/>
<string key="objectName">Debug</string>
</object>
<object class="IBObjectRecord">
@@ -3111,7 +3132,7 @@
<object class="IBObjectRecord">
<int key="objectID">506</int>
<reference key="object" ref="229822322"/>
- <reference key="parent" ref="1049"/>
+ <reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">513</int>
@@ -3173,10 +3194,8 @@
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMutableArray" key="dict.sortedKeys">
+ <object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>-1.IBPluginDependency</string>
- <string>-2.IBPluginDependency</string>
<string>-3.IBPluginDependency</string>
<string>103.IBPluginDependency</string>
<string>103.ImportedFromIB2</string>
@@ -3361,7 +3380,6 @@
<string>415.IBPluginDependency</string>
<string>416.IBPluginDependency</string>
<string>417.IBPluginDependency</string>
- <string>448.IBPluginDependency</string>
<string>449.IBEditorWindowLastContentRect</string>
<string>449.IBPluginDependency</string>
<string>449.IBWindowTemplateEditedContentRect</string>
@@ -3372,10 +3390,12 @@
<string>453.IBPluginDependency</string>
<string>454.IBPluginDependency</string>
<string>455.IBPluginDependency</string>
+ <string>456.IBPluginDependency</string>
<string>457.IBPluginDependency</string>
<string>458.IBPluginDependency</string>
<string>459.IBPluginDependency</string>
<string>460.IBPluginDependency</string>
+ <string>461.IBPluginDependency</string>
<string>467.IBPluginDependency</string>
<string>468.IBPluginDependency</string>
<string>470.IBPluginDependency</string>
@@ -3387,6 +3407,8 @@
<string>514.IBPluginDependency</string>
<string>517.IBPluginDependency</string>
<string>518.IBPluginDependency</string>
+ <string>520.IBPluginDependency</string>
+ <string>521.IBPluginDependency</string>
<string>523.IBPluginDependency</string>
<string>524.IBPluginDependency</string>
<string>56.IBPluginDependency</string>
@@ -3427,124 +3449,122 @@
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilderKit</string>
- <string>com.apple.InterfaceBuilderKit</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1" id="9"/>
+ <integer value="1"/>
<string>{{553, 524}, {216, 23}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{596, 852}, {216, 23}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{479, 484}, {132, 23}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{522, 812}, {146, 23}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{436, 809}, {64, 6}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{565, 284}, {275, 83}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{608, 612}, {275, 83}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{322, 304}, {243, 243}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{365, 632}, {243, 243}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{565, 284}, {153, 43}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{608, 612}, {167, 43}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{565, 284}, {241, 103}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{608, 612}, {241, 103}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{482, 474}, {197, 73}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{525, 802}, {197, 73}}</string>
<string>{{379, 341}, {478, 20}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{74, 862}</string>
<string>{{11, 977}, {478, 20}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3554,19 +3574,20 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{565, 284}, {215, 63}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{608, 612}, {215, 63}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3611,12 +3632,12 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{402, 524}, {774, 332}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{402, 524}, {774, 332}}</string>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{402, 529}, {774, 332}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{402, 529}, {774, 332}}</string>
- <reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3632,7 +3653,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3641,46 +3662,46 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
<string>{{148, 364}, {245, 183}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{23, 794}, {245, 183}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{523, 138}, {199, 203}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>{{323, 672}, {199, 203}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <reference ref="9"/>
+ <integer value="1"/>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
+ <reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
@@ -3688,15 +3709,13 @@
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
+ <reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">524</int>
+ <int key="maxID">525</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -3706,8 +3725,9 @@
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="actions">
<bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMutableArray" key="dict.sortedKeys">
+ <object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <string>loadFiles:</string>
<string>reset:</string>
<string>save:</string>
</object>
@@ -3715,6 +3735,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
+ <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
@@ -3735,8 +3756,141 @@
</object>
</object>
</object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSManagedObjectContext</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">CoreData.framework/Headers/NSManagedObjectContext.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">WebKit.framework/Headers/WebDownload.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">WebKit.framework/Headers/WebEditingDelegate.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">WebKit.framework/Headers/WebFrameLoadDelegate.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">WebKit.framework/Headers/WebJavaPlugIn.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">WebKit.framework/Headers/WebPlugin.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">WebKit.framework/Headers/WebPluginContainer.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">WebKit.framework/Headers/WebPolicyDelegate.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">WebKit.framework/Headers/WebResourceLoadDelegate.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">WebKit.framework/Headers/WebScriptObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">WebKit.framework/Headers/WebUIDelegate.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">WebView</string>
+ <string key="superclassName">NSView</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>goBack:</string>
+ <string>goForward:</string>
+ <string>makeTextLarger:</string>
+ <string>makeTextSmaller:</string>
+ <string>makeTextStandardSize:</string>
+ <string>reload:</string>
+ <string>reloadFromOrigin:</string>
+ <string>stopLoading:</string>
+ <string>takeStringURLFrom:</string>
+ <string>toggleContinuousSpellChecking:</string>
+ <string>toggleSmartInsertDelete:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">WebKit.framework/Headers/WebView.h</string>
+ </object>
+ </object>
+ </object>
</object>
<int key="IBDocument.localizationMode">0</int>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+ <integer value="1050" key="NS.object.0"/>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+ <integer value="1050" key="NS.object.0"/>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">BlogAssistant.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
View
3  ModelManager.h
@@ -9,12 +9,13 @@
#import <Cocoa/Cocoa.h>
@class Resource;
+@class ResourceTransfer;
@interface ModelManager : NSObject {
}
+ (ModelManager*)sharedManager;
-(void)save;
--(Resource*)createResource;
+-(BOOL)insertResourceWithTransfer:(ResourceTransfer*)resTran;
@end
View
22 ModelManager.m
@@ -10,6 +10,8 @@
#import "CoreDataManager.h"
#import "PathManager.h"
#import "Resource.h"
+#import "ResourceTransfer.h"
+#import "Utility.h"
@implementation ModelManager
@@ -65,19 +67,31 @@ -(void)save
}
}
+
#pragma mark -
#pragma mark Resource management
-
--(Resource*)createResource
+-(BOOL)insertResourceWithTransfer:(ResourceTransfer*)resTran
{
NSManagedObjectContext* moc = [[CoreDataManager sharedManager] managedObjectContext];
Resource* resource =
(Resource*)[NSEntityDescription insertNewObjectForEntityForName:@"Resource"
inManagedObjectContext:moc];
+
+ NSArray* keys = [Utility getPropertyNamesOf:resTran];
+ for (NSString* key in keys) {
+ [resource setValue:[resTran valueForKey:key] forKey:key];
+ }
+ NSError* error = nil;
+
+ [moc save:&error];
+
+ if (error) {
+ NSLog(@"ERROR(insertResourceWithTransfer:): %@", error);
+ return NO;
+ }
- resource.imageFilename = [[PathManager sharedManager] newImageFilename];
- return resource;
+ return YES;
}
@end
View
19 QueueManager.h
@@ -0,0 +1,19 @@
+//
+// QueueManager.h
+// BlogAssistant
+//
+// Created by 湖 on 10/02/03.
+// Copyright 2010 Hiroshi Hashiguchi. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface QueueManager : NSObject {
+
+}
++ (QueueManager*)sharedManager;
+
+- (void)loadFiles;
+
+@end
View
62 QueueManager.m
@@ -0,0 +1,62 @@
+//
+// QueueManager.m
+// BlogAssistant
+//
+// Created by 湖 on 10/02/03.
+// Copyright 2010 Hiroshi Hashiguchi. All rights reserved.
+//
+
+#import "QueueManager.h"
+#import "PathManager.h"
+#import "ModelManager.h"
+#import "Resource.h"
+#import "ResourceTransfer.h"
+
+@implementation QueueManager
+
+#pragma mark -
+#pragma mark Initilizer and Deallocation
+static QueueManager* _sharedManager = nil;
+
++ (QueueManager*)sharedManager
+{
+ if (!_sharedManager) {
+ _sharedManager = [[QueueManager alloc] init];
+ }
+ return _sharedManager;
+}
+
+- (void) dealloc
+{
+ [super dealloc];
+}
+
+
+#pragma mark -
+#pragma mark Public methods
+
+- (void)loadFiles
+{
+ NSFileManager* fm = [NSFileManager defaultManager];
+ NSString* path = [[PathManager sharedManager] queuePath];
+ NSError* error = nil;
+
+ NSArray* files = [fm contentsOfDirectoryAtPath:path
+ error:&error];
+ if (error) {
+ NSLog(@"ERROR(loadFiles): %@", error);
+ return;
+ }
+ ModelManager* mm = [ModelManager sharedManager];
+ for (NSString* filename in files) {
+ if ([[filename pathExtension] isEqualToString:@"plist"]) {
+ ResourceTransfer* resTran =
+ [ResourceTransfer resourceTransferWithContentsOfFile:filename];
+ if (resTran) {
+ [mm insertResourceWithTransfer:resTran];
+ }
+ }
+ }
+}
+
+@end
View
5 ResourceTransfer.h
@@ -23,7 +23,8 @@
@property (retain) NSString * url;
@property (retain) NSString * uuid;
--(BOOL)save;
-
+- (BOOL)save;
+- (id)initWithContentsOfFile:(NSString*)filename;
++ (ResourceTransfer*)resourceTransferWithContentsOfFile:(NSString*)filename;
@end
View
35 ResourceTransfer.m
@@ -5,10 +5,9 @@
// Created by Hiroshi Hashiguchi on 10/02/01.
// Copyright 2010 xcatsan.com. All rights reserved.
//
-#import <objc/runtime.h>
-
#import "ResourceTransfer.h"
#import "PathManager.h"
+#import "Utility.h"
@implementation ResourceTransfer
@@ -42,6 +41,26 @@ - (id)init
return self;
}
+- (id)initWithContentsOfFile:(NSString*)filename
+{
+ self = [super init];
+ if (self) {
+ NSString* path = [[[PathManager sharedManager] queuePath] stringByAppendingPathComponent:filename];
+ NSDictionary* inputDict = [NSDictionary dictionaryWithContentsOfFile:path];
+ if (inputDict) {
+ for (NSString* key in [inputDict allKeys]) {
+ [self setValue:[inputDict valueForKey:key] forKey:key];
+ }
+ }
+ }
+ return self;
+}
+
++ (ResourceTransfer*)resourceTransferWithContentsOfFile:(NSString*)filename
+{
+ return [[[ResourceTransfer alloc] initWithContentsOfFile:filename] autorelease];
+}
+
- (void) dealloc
{
self.createdDate = nil;
@@ -53,24 +72,16 @@ - (void) dealloc
[super dealloc];
}
-
#pragma mark -
#pragma mark Public operation methods
-(BOOL)save
{
NSMutableDictionary* outputDict = [NSMutableDictionary dictionary];
- unsigned int outCount, i;
- objc_property_t *properties =
- class_copyPropertyList([self class], &outCount);
-
- for(i = 0; i < outCount; i++) {
- objc_property_t property = properties[i];
- NSString *propertyName =
- [NSString stringWithUTF8String:property_getName(property)];
+ NSArray* propertyNames = [Utility getPropertyNamesOf:self];
+ for (NSString* propertyName in propertyNames) {
[outputDict setObject:[self valueForKey:propertyName]
forKey:propertyName];
}
- free(properties);
NSString* filename = [self.uuid stringByAppendingPathExtension:@"plist"];
NSString* path = [[[PathManager sharedManager] queuePath] stringByAppendingPathComponent:filename];
View
1  Utility.h
@@ -14,5 +14,6 @@
}
+ (NSString*)localizedStringForKey:(NSString*)key;
++ (NSArray*)getPropertyNamesOf:(id)object;
@end
View
21 Utility.m
@@ -5,7 +5,7 @@
// Created by 橋口 湖 on 10/01/08.
// Copyright 2010 xcatsan.com. All rights reserved.
//
-
+#import <objc/runtime.h>
#import "Utility.h"
@@ -17,4 +17,23 @@ + (NSString*)localizedStringForKey:(NSString*)key
return [bundle localizedStringForKey:key value:@"" table:nil];
}
++ (NSArray*)getPropertyNamesOf:(id)object
+{
+ NSMutableArray* propertyNames = [NSMutableArray array];
+
+ unsigned int outCount, i;
+ objc_property_t *properties =
+ class_copyPropertyList([object class], &outCount);
+
+ for(i = 0; i < outCount; i++) {
+ objc_property_t property = properties[i];
+ NSString *propertyName =
+ [NSString stringWithUTF8String:property_getName(property)];
+ [propertyNames addObject:propertyName];
+ }
+ free(properties);
+
+ return propertyNames;
+}
+
@end
Please sign in to comment.
Something went wrong with that request. Please try again.