Revision: 7711
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7711&view=rev
Author:   hofman
Date:     2012-08-29 17:33:57 +0000 (Wed, 29 Aug 2012)
Log Message:
-----------
check number value of bookmark scripting type rather than integer value, 
because zero is a valid value

Modified Paths:
--------------
    trunk/SKBookmark.m

Modified: trunk/SKBookmark.m
===================================================================
--- trunk/SKBookmark.m  2012-08-28 12:12:32 UTC (rev 7710)
+++ trunk/SKBookmark.m  2012-08-29 17:33:57 UTC (rev 7711)
@@ -620,15 +620,16 @@
         NSURL *aURL = [properties objectForKey:@"scriptingFile"] ?: 
contentsValue;
         NSString *aPath = [aURL respondsToSelector:@selector(path)] ? [aURL 
path] : nil;
         NSString *aLabel = [properties objectForKey:@"label"];
-        NSInteger type = [[properties objectForKey:@"bookmarkType"] 
integerValue];
-        if (type == 0) {
-            if (aURL == nil)
-                type = SKBookmarkTypeSession;
-            else if ([[NSWorkspace sharedWorkspace] type:[[NSWorkspace 
sharedWorkspace] typeOfFile:aPath error:NULL] conformsToType:(NSString 
*)kUTTypeFolder])
-                type = SKBookmarkTypeFolder;
-            else
-                type = SKBookmarkTypeBookmark;
-        }
+        NSNumber *aType = [properties objectForKey:@"bookmarkType"];
+        NSInteger type;
+        if ([aType respondsToSelector:@selector(integerValue)])
+            type = [aType integerValue];
+        else if (aURL == nil)
+            type = SKBookmarkTypeSession;
+        else if ([[NSWorkspace sharedWorkspace] type:[[NSWorkspace 
sharedWorkspace] typeOfFile:aPath error:NULL] conformsToType:(NSString 
*)kUTTypeFolder])
+            type = SKBookmarkTypeFolder;
+        else
+            type = SKBookmarkTypeBookmark;
         switch (type) {
             case SKBookmarkTypeBookmark:
             {

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


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to