Revision: 7460
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7460&view=rev
Author:   hofman
Date:     2011-08-30 18:12:44 +0000 (Tue, 30 Aug 2011)
Log Message:
-----------
remove convenience method for normalized template name, implement in place

Modified Paths:
--------------
    trunk/SKMainDocument.m
    trunk/SKTemplateManager.h
    trunk/SKTemplateManager.m

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2011-08-30 17:29:16 UTC (rev 7459)
+++ trunk/SKMainDocument.m      2011-08-30 18:12:44 UTC (rev 7460)
@@ -1837,8 +1837,14 @@
             normalizedType = SKDVIDocumentType;
         else if ([fileType isEqualToString:@"XDV"])
             normalizedType = SKXDVDocumentType;
-        else if ([[self writableTypesForSaveOperation:NSSaveToOperation] 
containsObject:fileType] == NO)
-            normalizedType = [[SKTemplateManager sharedManager] 
normalizedTemplateType:fileType];
+        else if ([[self writableTypesForSaveOperation:NSSaveToOperation] 
containsObject:fileType] == NO) {
+            for (NSString *typeName in [[SKTemplateManager sharedManager] 
customTemplateTypes]) {
+                if ([[[SKTemplateManager sharedManager] 
displayNameForTemplateType:fileType] isEqualToString:fileType]) {
+                    normalizedType = typeName;
+                    break;
+                }
+            }
+        }
         if (normalizedType) {
             fileType = normalizedType;
             NSMutableDictionary *arguments = [[command arguments] mutableCopy];

Modified: trunk/SKTemplateManager.h
===================================================================
--- trunk/SKTemplateManager.h   2011-08-30 17:29:16 UTC (rev 7459)
+++ trunk/SKTemplateManager.h   2011-08-30 18:12:44 UTC (rev 7460)
@@ -51,7 +51,6 @@
 - (NSString *)pathForTemplateType:(NSString *)typeName;
 - (NSString *)fileNameExtensionForTemplateType:(NSString *)typeName;
 - (NSString *)displayNameForTemplateType:(NSString *)typeName;
-- (NSString *)normalizedTemplateType:(NSString *)typeName;
 
 - (BOOL)isRichTextTemplateType:(NSString *)typeName;
 

Modified: trunk/SKTemplateManager.m
===================================================================
--- trunk/SKTemplateManager.m   2011-08-30 17:29:16 UTC (rev 7459)
+++ trunk/SKTemplateManager.m   2011-08-30 18:12:44 UTC (rev 7460)
@@ -103,13 +103,6 @@
     return [[self customTemplateTypes] containsObject:typeName] ? [typeName 
stringByDeletingPathExtension] : nil;
 }
 
-- (NSString *)normalizedTemplateType:(NSString *)typeName {
-    NSArray *templateTypes = [self customTemplateTypes];
-    NSArray *templateTypesWithoutExtension = [templateTypes 
valueForKey:@"stringByDeletingPathExtension"];
-    NSUInteger idx = [templateTypesWithoutExtension indexOfObject:typeName];
-    return idx != NSNotFound ? [templateTypes objectAtIndex:idx] : nil;
-}
-
 - (BOOL)isRichTextTemplateType:(NSString *)isRichTextTemplateFile {
     static NSSet *types = nil;
     if (types == nil)

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to