aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-12-18 20:19:03 +0000
committerstuconnolly <stuart02@gmail.com>2009-12-18 20:19:03 +0000
commit9ed7bc2eaa45f6c06477d37ccf206575e06f2187 (patch)
tree60cb6dc91a5b6b29f116f29103a3266f7e3f3c7a /Source
parente895f8dcba0784e2fee9ba855ee0de12e8deaefb (diff)
downloadsequelpro-9ed7bc2eaa45f6c06477d37ccf206575e06f2187.tar.gz
sequelpro-9ed7bc2eaa45f6c06477d37ccf206575e06f2187.tar.bz2
sequelpro-9ed7bc2eaa45f6c06477d37ccf206575e06f2187.zip
Random source tidy up changes.
Diffstat (limited to 'Source')
-rw-r--r--Source/CustomQuery.m12
-rw-r--r--Source/SPQueryFavoriteManager.m9
-rw-r--r--Source/SPTableRelations.h2
3 files changed, 6 insertions, 17 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 0982e16f..4805ea45 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -1219,7 +1219,6 @@
// Populate query favorites
[self queryFavoritesHaveBeenUpdated:nil];
-
// Disable runSelectionMenuItem in the gear menu
[runSelectionMenuItem setEnabled:NO];
@@ -2613,15 +2612,14 @@
* Called by the query favorites manager whenever the query favorites have been updated.
*/
- (void)queryFavoritesHaveBeenUpdated:(id)manager
-{
-
+{
NSMenuItem *headerMenuItem;
NSMenu *menu = [queryFavoritesButton menu];
// Remove all favorites beginning from the end
while([queryFavoritesButton numberOfItems] > 7)
[queryFavoritesButton removeItemAtIndex:[queryFavoritesButton numberOfItems]-1];
-
+
// Build document-based list
headerMenuItem = [[NSMenuItem alloc] initWithTitle:
[[[[tableDocumentInstance fileURL] absoluteString] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] lastPathComponent]
@@ -2655,9 +2653,6 @@
[menu addItem:item];
[item release];
}
-
- // [queryFavoritesSearchField setStringValue:@""];
-
}
#pragma mark -
@@ -2789,7 +2784,6 @@
*/
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
{
-
// Control "Save ... to Favorites"
if ( [menuItem tag] == SP_SAVE_SELECTION_FAVORTITE_MENUITEM_TAG ) {
if ([[textView string] length] < 1) return NO;
@@ -2812,10 +2806,8 @@
}
return YES;
-
}
-
#pragma mark -
- (id)init
diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m
index 17818e87..db70e8f5 100644
--- a/Source/SPQueryFavoriteManager.m
+++ b/Source/SPQueryFavoriteManager.m
@@ -190,7 +190,6 @@
*/
- (IBAction)addQueryFavorite:(id)sender
{
-
NSMutableDictionary *favorite;
NSUInteger insertIndex;
@@ -198,16 +197,17 @@
[[self window] makeFirstResponder:favoriteNameTextField];
// Duplicate a selected favorite if sender == self
- if(sender == self)
+ if (sender == self)
favorite = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[[favoriteNameTextField stringValue] stringByAppendingFormat:@" Copy"], [favoriteQueryTextView string], nil] forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]];
// Add a new favorite
else
favorite = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"New Favorite", @"", nil] forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]];
- if([favoritesTableView numberOfSelectedRows] > 0) {
+ if ([favoritesTableView numberOfSelectedRows] > 0) {
insertIndex = [[favoritesTableView selectedRowIndexes] lastIndex]+1;
[favorites insertObject:favorite atIndex:insertIndex];
- } else {
+ }
+ else {
[favorites addObject:favorite];
insertIndex = [favorites count] - 1;
}
@@ -221,7 +221,6 @@
[removeButton setEnabled:([favoritesTableView numberOfSelectedRows] > 0)];
[[self window] makeFirstResponder:favoriteNameTextField];
-
}
/**
diff --git a/Source/SPTableRelations.h b/Source/SPTableRelations.h
index 66424d20..fb32fd12 100644
--- a/Source/SPTableRelations.h
+++ b/Source/SPTableRelations.h
@@ -26,8 +26,6 @@
#import <Cocoa/Cocoa.h>
#import <MCPKit/MCPKit.h>
-@class CMCopyTable;
-
@interface SPTableRelations : NSObject
{
IBOutlet id tableDocumentInstance;