Revision: 7451
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7451&view=rev
Author:   hofman
Date:     2011-08-27 21:51:57 +0000 (Sat, 27 Aug 2011)
Log Message:
-----------
abbreviate downloads path ion prefs using tilde

Modified Paths:
--------------
    trunk/SKApplicationController.m
    trunk/SKDownload.m
    trunk/SKDownloadPreferenceController.m

Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m     2011-08-27 21:43:31 UTC (rev 7450)
+++ trunk/SKApplicationController.m     2011-08-27 21:51:57 UTC (rev 7451)
@@ -123,7 +123,7 @@
     
     NSArray *downloadDirs = 
NSSearchPathForDirectoriesInDomains(NSDownloadsDirectory, NSUserDomainMask, 
YES);
     if ([downloadDirs count] > 0)
-        [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary 
dictionaryWithObject:[downloadDirs objectAtIndex:0] 
forKey:SKDownloadsDirectoryKey]];
+        [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary 
dictionaryWithObject:[[downloadDirs objectAtIndex:0] 
stringByAbbreviatingWithTildeInPath] forKey:SKDownloadsDirectoryKey]];
     
     // if your application supports resetting a subset of the defaults to 
     // factory values, you should set those values 

Modified: trunk/SKDownload.m
===================================================================
--- trunk/SKDownload.m  2011-08-27 21:43:31 UTC (rev 7450)
+++ trunk/SKDownload.m  2011-08-27 21:51:57 UTC (rev 7451)
@@ -355,7 +355,7 @@
 }
 
 - (void)download:(NSURLDownload *)download 
decideDestinationWithSuggestedFilename:(NSString *)filename {
-    NSString *downloadDir = [[NSUserDefaults standardUserDefaults] 
stringForKey:SKDownloadsDirectoryKey];
+    NSString *downloadDir = [[[NSUserDefaults standardUserDefaults] 
stringForKey:SKDownloadsDirectoryKey] stringByExpandingTildeInPath];
     if (downloadDir == nil) {
         NSArray *downloadDirs = 
NSSearchPathForDirectoriesInDomains(NSDownloadsDirectory, NSUserDomainMask, 
YES);
         if ([downloadDirs count] > 0)

Modified: trunk/SKDownloadPreferenceController.m
===================================================================
--- trunk/SKDownloadPreferenceController.m      2011-08-27 21:43:31 UTC (rev 
7450)
+++ trunk/SKDownloadPreferenceController.m      2011-08-27 21:51:57 UTC (rev 
7451)
@@ -59,7 +59,7 @@
 }
 
 - (void)updateDownloadsFolderPopUp {
-    NSString *downloadsFolder = [[NSUserDefaults standardUserDefaults] 
stringForKey:SKDownloadsDirectoryKey];
+    NSString *downloadsFolder = [[[NSUserDefaults standardUserDefaults] 
stringForKey:SKDownloadsDirectoryKey] stringByExpandingTildeInPath];
     NSMenuItem *menuItem = [downloadsFolderPopUp itemAtIndex:0];
     [menuItem setImageAndSize:[[NSWorkspace sharedWorkspace] 
iconForFile:downloadsFolder]];
     [menuItem setTitle:[[NSFileManager defaultManager] 
displayNameAtPath:downloadsFolder]];
@@ -84,7 +84,7 @@
 
 - (void)openPanelDidEnd:(NSOpenPanel *)openPanel 
returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo {
     if (returnCode == NSFileHandlingPanelOKButton) {
-        [[NSUserDefaults standardUserDefaults] setObject:[[openPanel URL] 
path] forKey:SKDownloadsDirectoryKey];
+        [[NSUserDefaults standardUserDefaults] setObject:[[[openPanel URL] 
path] stringByAbbreviatingWithTildeInPath] forKey:SKDownloadsDirectoryKey];
         [self updateDownloadsFolderPopUp];
     }
 }
@@ -93,7 +93,7 @@
     if ([sender selectedItem] == [sender lastItem]) {
         [sender selectItemAtIndex:0];
         
-        NSString *downloadsFolder = [[NSUserDefaults standardUserDefaults] 
stringForKey:SKDownloadsDirectoryKey];
+        NSString *downloadsFolder = [[[NSUserDefaults standardUserDefaults] 
stringForKey:SKDownloadsDirectoryKey] stringByExpandingTildeInPath];
         
         NSOpenPanel *openPanel = [NSOpenPanel openPanel];
         [openPanel setCanChooseDirectories:YES];

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


------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to