Revision: 18062
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18062&view=rev
Author:   hofman
Date:     2011-08-14 11:24:25 +0000 (Sun, 14 Aug 2011)

Log Message:
-----------
use hidden default for downloads directory in webview when present

Modified Paths:
--------------
    trunk/bibdesk/BDSKEditor.m
    trunk/bibdesk/BDSKStringConstants.h
    trunk/bibdesk/BDSKStringConstants.m
    trunk/bibdesk/BDSKWebView.m

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2011-08-14 06:35:15 UTC (rev 18061)
+++ trunk/bibdesk/BDSKEditor.m  2011-08-14 11:24:25 UTC (rev 18062)
@@ -88,8 +88,6 @@
 
 #define WEAK_NULL NULL
 
-#define BDSKDownloadsDirectoryKey @"BDSKDownloadsDirectory"
-
 #define BDSKEditorFrameAutosaveName @"BDSKEditor window autosave name"
 #define BDSKEditorMainSplitViewAutosaveName @"BDSKEditorMainSplitView"
 #define BDSKEditorFileSplitViewAutosaveName @"BDSKEditorFileSplitView"
@@ -1748,7 +1746,7 @@
     BOOL isDir;
     
     if (downloadsDirectory == nil && [[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKFilePapersAutomaticallyKey] && [NSString 
isEmptyString:extension] == NO)
-        downloadsDirectory = 
[NSSearchPathForDirectoriesInDomains(NSDownloadsDirectory, NSUserDomainMask, 
YES) firstObject];
+        downloadsDirectory = [[[NSFileManager defaultManager] 
downloadFolderURL] path];
     
     if ([NSString isEmptyString:extension] == NO && [[NSFileManager 
defaultManager] fileExistsAtPath:downloadsDirectory isDirectory:&isDir] && 
isDir) {
         fileURL = [NSURL fileURLWithPath:[downloadsDirectory 
stringByAppendingPathComponent:filename]];

Modified: trunk/bibdesk/BDSKStringConstants.h
===================================================================
--- trunk/bibdesk/BDSKStringConstants.h 2011-08-14 06:35:15 UTC (rev 18061)
+++ trunk/bibdesk/BDSKStringConstants.h 2011-08-14 11:24:25 UTC (rev 18062)
@@ -198,6 +198,8 @@
 extern NSString *BDSKEditorFileViewIconScaleKey;
 extern NSString *BDSKEditorFileViewDisplayModeKey;
 
+extern NSString *BDSKDownloadsDirectoryKey;
+
 #pragma mark BibTeX types strings
 
 extern NSString *BDSKBibtexString;

Modified: trunk/bibdesk/BDSKStringConstants.m
===================================================================
--- trunk/bibdesk/BDSKStringConstants.m 2011-08-14 06:35:15 UTC (rev 18061)
+++ trunk/bibdesk/BDSKStringConstants.m 2011-08-14 11:24:25 UTC (rev 18062)
@@ -215,6 +215,8 @@
 NSString *BDSKWarnOnCiteKeyChangeKey = @"BDSKWarnOnCiteKeyChangeKey";
 NSString *BDSKSpotlightVersionInfoKey = @"BDSKSpotlightVersionInfo";
 
+NSString *BDSKDownloadsDirectoryKey = @"BDSKDownloadsDirectory";
+
 #pragma mark Field name strings
 
 NSString *BDSKAnnoteString = @"Annote";

Modified: trunk/bibdesk/BDSKWebView.m
===================================================================
--- trunk/bibdesk/BDSKWebView.m 2011-08-14 06:35:15 UTC (rev 18061)
+++ trunk/bibdesk/BDSKWebView.m 2011-08-14 11:24:25 UTC (rev 18062)
@@ -446,7 +446,7 @@
 // This is a private WebUIDelegate method that is called by WebPDFView
 - (void)webView:(WebView *)sender saveFrameView:(WebFrameView *)frameView 
showingPanel:(BOOL)showingPanel {
     WebDataSource *dataSource = [[frameView webFrame] dataSource];
-    NSString *downloadsDir = 
[NSSearchPathForDirectoriesInDomains(NSDownloadsDirectory, NSUserDomainMask, 
YES) firstObject];
+    NSString *downloadsDir = [[NSUserDefaults standardUserDefaults] 
stringForKey:BDSKDownloadsDirectoryKey] ?: [[[NSFileManager defaultManager] 
downloadFolderURL] path];
     NSString *filename = [[dataSource response] suggestedFilename];
     filename = [[NSFileManager defaultManager] uniqueFilePathWithName:filename 
atPath:downloadsDir];
     if (showingPanel) {


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

------------------------------------------------------------------------------
FREE DOWNLOAD - uberSVN with Social Coding for Subversion.
Subversion made easy with a complete admin console. Easy 
to use, easy to manage, easy to install, easy to extend. 
Get a Free download of the new open ALM Subversion platform now.
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to