diff options
author | Max <post@wickenrode.com> | 2015-01-04 21:10:26 +0100 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-01-04 21:10:26 +0100 |
commit | 5b55d8c4d24b0c24a5dc74a49cfd70448146d582 (patch) | |
tree | da23678da48ba88a6022f1fee0fc3d61d3f23c9f /Source/SPDatabaseDocument.m | |
parent | 2735e15bf5d4b3a976435ebb29ca9073de0e5071 (diff) | |
download | sequelpro-5b55d8c4d24b0c24a5dc74a49cfd70448146d582.tar.gz sequelpro-5b55d8c4d24b0c24a5dc74a49cfd70448146d582.tar.bz2 sequelpro-5b55d8c4d24b0c24a5dc74a49cfd70448146d582.zip |
Replace some "magic numbers" with constants
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r-- | Source/SPDatabaseDocument.m | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 6940abfb..ab8eafc6 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -2831,10 +2831,10 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [panel setCanSelectHiddenExtension:YES]; // Save Query... - if (sender != nil && ([sender tag] == 1006 || [sender tag] == 1008)) { + if (sender != nil && ([sender tag] == SPMainMenuFileSaveQuery || [sender tag] == SPMainMenuFileSaveQueryAs)) { // If Save was invoked, check whether the file was previously opened, and if so save without the panel - if ([sender tag] == 1006 && [[[self sqlFileURL] path] length]) { + if ([sender tag] == SPMainMenuFileSaveQuery && [[[self sqlFileURL] path] length]) { NSError *error = nil; NSString *content = [NSString stringWithString:[[[customQueryInstance valueForKeyPath:@"textView"] textStorage] string]]; [content writeToURL:sqlFileURL atomically:YES encoding:sqlFileEncoding error:&error]; @@ -2865,11 +2865,11 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // Save As… or Save } - else if (sender == nil || [sender tag] == 1005 || [sender tag] == 1004) { + else if (sender == nil || [sender tag] == SPMainMenuFileSaveConnection || [sender tag] == SPMainMenuFileSaveConnectionAs) { // If Save was invoked check for fileURL and Untitled docs and save the spf file without save panel // otherwise ask for file name - if (sender != nil && [sender tag] == 1004 && [[[self fileURL] path] length] && ![self isUntitled]) { + if (sender != nil && [sender tag] == SPMainMenuFileSaveConnection && [[[self fileURL] path] length] && ![self isUntitled]) { [self saveDocumentWithFilePath:nil inBackground:YES onlyPreferences:NO contextInfo:nil]; return; } @@ -2920,10 +2920,10 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; contextInfo = sender == nil ? @"saveSPFfileAndClose" : @"saveSPFfile"; } // Save Session or Save Session As... - else if (sender == nil || [sender tag] == 1020 || [sender tag] == 1021) + else if (sender == nil || [sender tag] == SPMainMenuFileSaveSession || [sender tag] == SPMainMenuFileSaveSessionAs) { // Save As Session - if ([sender tag] == 1020 && [SPAppDelegate sessionURL]) { + if ([sender tag] == SPMainMenuFileSaveSession && [SPAppDelegate sessionURL]) { [self saveConnectionPanelDidEnd:panel returnCode:1 contextInfo:@"saveAsSession"]; return; } |