diff options
author | stuconnolly <stuart02@gmail.com> | 2009-10-17 00:35:09 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-10-17 00:35:09 +0000 |
commit | 6a4e2994d17220eb43015162522deec1efdd429b (patch) | |
tree | f1d2abc0691948bcbd901929c82347137ee0de85 /Source/SPAppController.m | |
parent | c3eb7de88f2baf7774749f4311a84b75ef833eb7 (diff) | |
download | sequelpro-6a4e2994d17220eb43015162522deec1efdd429b.tar.gz sequelpro-6a4e2994d17220eb43015162522deec1efdd429b.tar.bz2 sequelpro-6a4e2994d17220eb43015162522deec1efdd429b.zip |
Replace the use of hard coded preference keys with constants to prevent issues such as the one fixed in revision 1419. All future preference usage should be done so using these constants.
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r-- | Source/SPAppController.m | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m index b0cf4ed5..3b8cde01 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -29,15 +29,10 @@ #import "SPPreferenceController.h" #import "TableDump.h" #import "SPEncodingPopupAccessory.h" +#import "SPConstants.h" #import <Sparkle/Sparkle.h> -#define SEQUEL_PRO_HOME_PAGE_URL @"http://www.sequelpro.com/" -#define SEQUEL_PRO_DONATIONS_URL @"http://www.sequelpro.com/donate.html" -#define SEQUEL_PRO_FAQ_URL @"http://www.sequelpro.com/frequently-asked-questions.html" -#define SEQUEL_PRO_DOCS_URL @"http://www.sequelpro.com/docs" -#define SEQUEL_PRO_CONTACT_URL @"http://www.sequelpro.com/docs/Contact_the_developers" - @implementation SPAppController /** @@ -137,12 +132,12 @@ [panel setResolvesAliases:YES]; // If no lastSqlFileEncoding in prefs set it to UTF-8 - if(![[NSUserDefaults standardUserDefaults] integerForKey:@"lastSqlFileEncoding"]) { - [[NSUserDefaults standardUserDefaults] setInteger:4 forKey:@"lastSqlFileEncoding"]; + if(![[NSUserDefaults standardUserDefaults] integerForKey:SPLastSQLFileEncoding]) { + [[NSUserDefaults standardUserDefaults] setInteger:4 forKey:SPLastSQLFileEncoding]; [[NSUserDefaults standardUserDefaults] synchronize]; } - [panel setAccessoryView:[SPEncodingPopupAccessory encodingAccessory:[[NSUserDefaults standardUserDefaults] integerForKey:@"lastSqlFileEncoding"] + [panel setAccessoryView:[SPEncodingPopupAccessory encodingAccessory:[[NSUserDefaults standardUserDefaults] integerForKey:SPLastSQLFileEncoding] includeDefaultEntry:NO encodingPopUp:&encodingPopUp]]; // it will enabled if user selects a *.sql file @@ -233,7 +228,7 @@ // if encodingPopUp is defined the filename comes from an openPanel and // the encodingPopUp contains the chosen encoding; otherwise autodetect encoding if(encodingPopUp) - [[NSUserDefaults standardUserDefaults] setInteger:[[encodingPopUp selectedItem] tag] forKey:@"lastSqlFileEncoding"]; + [[NSUserDefaults standardUserDefaults] setInteger:[[encodingPopUp selectedItem] tag] forKey:SPLastSQLFileEncoding]; // Check if at least one document exists if (![[[NSDocumentController sharedDocumentController] documents] count]) { |