Skip to content

Commit

Permalink
Add a method to clear the SVG cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddTheSane committed Jun 19, 2013
1 parent a0fb38d commit 1277a09
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 2 deletions.
1 change: 0 additions & 1 deletion Source/Parsers/SVGKParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ static void structuredError (void * userData,
default:
break;
}

}

static xmlSAXHandler SAXHandler = {
Expand Down
1 change: 1 addition & 0 deletions XCodeProjectData/Demo-OSX/SKAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
@property (assign) IBOutlet NSWindow *quickWindow;
@property (assign) IBOutlet SVGKFastImageView *fastView;

- (IBAction)clearSVGCache:(id)sender;

@end
6 changes: 6 additions & 0 deletions XCodeProjectData/Demo-OSX/SKAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import "SKAppDelegate.h"
#import "SKSVGObject.h"
#import "SVGKit.h"

@interface SKAppDelegate ()
@property (readwrite, retain) NSArray *svgArray;
Expand Down Expand Up @@ -116,4 +117,9 @@ - (void)tableViewSelectionDidChange:(NSNotification *)notification
}
}

- (IBAction)clearSVGCache:(id)sender
{
[SVGKImage clearSVGImageCache];
}

@end
80 changes: 79 additions & 1 deletion XCodeProjectData/Demo-OSX/en.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,14 @@
<reference key="NSOnImage" ref="35465992"/>
<reference key="NSMixedImage" ref="502551668"/>
</object>
<object class="NSMenuItem" id="584433445">
<reference key="NSMenu" ref="720053764"/>
<string key="NSTitle">Clear Cache</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="35465992"/>
<reference key="NSMixedImage" ref="502551668"/>
</object>
<object class="NSMenuItem" id="1010469920">
<reference key="NSMenu" ref="720053764"/>
<bool key="NSIsDisabled">YES</bool>
Expand Down Expand Up @@ -1450,6 +1458,7 @@
<string key="NSFrame">{{1, 119}, {223, 15}}</string>
<reference key="NSSuperview" ref="750426548"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:60</string>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<int key="NSsFlags">1</int>
Expand Down Expand Up @@ -1539,6 +1548,7 @@
<string key="NSFrame">{{465, 1}, {16, 270}}</string>
<reference key="NSSuperview" ref="507102939"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:15</string>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<reference key="NSTarget" ref="507102939"/>
Expand Down Expand Up @@ -1631,6 +1641,7 @@
<string key="NSFrame">{{465, 1}, {16, 270}}</string>
<reference key="NSSuperview" ref="200596080"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:15</string>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<reference key="NSTarget" ref="200596080"/>
Expand Down Expand Up @@ -2400,6 +2411,14 @@
</object>
<int key="connectionID">564</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">clearSVGCache:</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="584433445"/>
</object>
<int key="connectionID">589</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
Expand Down Expand Up @@ -2527,6 +2546,7 @@
<reference ref="425164168"/>
<reference ref="579971712"/>
<reference ref="1010469920"/>
<reference ref="584433445"/>
</array>
<reference key="parent" ref="379814623"/>
</object>
Expand Down Expand Up @@ -3817,6 +3837,11 @@
<reference key="object" ref="630272081"/>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">588</int>
<reference key="object" ref="584433445"/>
<reference key="parent" ref="720053764"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
Expand Down Expand Up @@ -4018,6 +4043,7 @@
<string key="578.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="579.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="58.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="588.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="72.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="73.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="74.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
Expand All @@ -4034,10 +4060,51 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">587</int>
<int key="maxID">589</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">NSDocument</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="printDocument:">id</string>
<string key="revertDocumentToSaved:">id</string>
<string key="runPageLayout:">id</string>
<string key="saveDocument:">id</string>
<string key="saveDocumentAs:">id</string>
<string key="saveDocumentTo:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="printDocument:">
<string key="name">printDocument:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="revertDocumentToSaved:">
<string key="name">revertDocumentToSaved:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="runPageLayout:">
<string key="name">runPageLayout:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="saveDocument:">
<string key="name">saveDocument:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="saveDocumentAs:">
<string key="name">saveDocumentAs:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="saveDocumentTo:">
<string key="name">saveDocumentTo:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/NSDocument.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSLayoutConstraint</string>
<string key="superclassName">NSObject</string>
Expand All @@ -4049,6 +4116,17 @@
<object class="IBPartialClassDescription">
<string key="className">SKAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">clearSVGCache:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">clearSVGCache:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">clearSVGCache:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="fastView">SVGKFastImageView</string>
<string key="layeredView">SVGKLayeredImageView</string>
Expand Down

0 comments on commit 1277a09

Please sign in to comment.