Revision: 2780
http://skim-app.svn.sourceforge.net/skim-app/?rev=2780&view=rev
Author: hofman
Date: 2007-08-30 05:17:29 -0700 (Thu, 30 Aug 2007)
Log Message:
-----------
Avoid possible warning from uninitialized FSRef.
Modified Paths:
--------------
trunk/SKApplicationController.m
Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m 2007-08-30 12:15:29 UTC (rev 2779)
+++ trunk/SKApplicationController.m 2007-08-30 12:17:29 UTC (rev 2780)
@@ -363,33 +363,35 @@
pathDict = CFDictionaryCreateMutable(NULL, 3, NULL,
&kCFTypeDictionaryValueCallBacks);
NSString *path = (NSString *)CFDictionaryGetValue(pathDict, (void
*)domain);
- FSRef foundRef;
- OSStatus err = noErr;
if (path == nil || (create && [[NSFileManager defaultManager]
fileExistsAtPath:path] == NO)) {
+ FSRef foundRef;
+ OSStatus err = noErr;
+
err = FSFindFolder(domain, kApplicationSupportFolderType, create ?
kCreateFolder : kDontCreateFolder, &foundRef);
if (err != noErr) {
if (create)
NSLog(@"Error %d: the system was unable to find your
Application Support folder.", err);
return nil;
}
- }
- if (path == nil) {
- CFURLRef url = CFURLCreateFromFSRef(kCFAllocatorDefault, &foundRef);
- if (url != nil) {
- path = [(NSURL *)url path];
- CFRelease(url);
+ if (path == nil) {
+ CFURLRef url = CFURLCreateFromFSRef(kCFAllocatorDefault,
&foundRef);
+
+ if (url != nil) {
+ path = [(NSURL *)url path];
+ CFRelease(url);
+ }
+
+ NSString *appName = [[NSBundle mainBundle]
objectForInfoDictionaryKey:(NSString *)kCFBundleExecutableKey];
+
+ if(appName == nil)
+ [NSException raise:NSObjectNotAvailableException
format:NSLocalizedString(@"Unable to find CFBundleIdentifier for %@",
@"Exception message"), [NSApp description]];
+
+ path = [path stringByAppendingPathComponent:appName];
+
+ CFDictionarySetValue(pathDict, (void *)domain, (void *)path);
}
-
- NSString *appName = [[NSBundle mainBundle]
objectForInfoDictionaryKey:(NSString *)kCFBundleExecutableKey];
-
- if(appName == nil)
- [NSException raise:NSObjectNotAvailableException
format:NSLocalizedString(@"Unable to find CFBundleIdentifier for %@",
@"Exception message"), [NSApp description]];
-
- path = [path stringByAppendingPathComponent:appName];
-
- CFDictionarySetValue(pathDict, (void *)domain, (void *)path);
}
// the call to FSFindFolder creates the parent hierarchy, but not the
directory we're looking for
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit