aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormltownsend <mltownsend@gmail.com>2009-08-26 23:11:04 +0000
committermltownsend <mltownsend@gmail.com>2009-08-26 23:11:04 +0000
commit8768a5ba73bb1aa181175047a15dfe934e0ec585 (patch)
tree45fdc84546b6307b76887d85da49c60e271d92ef
parent63c47d26eeed7e2602e0925cae8e7386963ce695 (diff)
downloadsequelpro-8768a5ba73bb1aa181175047a15dfe934e0ec585.tar.gz
sequelpro-8768a5ba73bb1aa181175047a15dfe934e0ec585.tar.bz2
sequelpro-8768a5ba73bb1aa181175047a15dfe934e0ec585.zip
Fix favorite length when favorite name is under 32 chars
-rw-r--r--Source/SPPreferenceController.m2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m
index 938accdc..c1a430f9 100644
--- a/Source/SPPreferenceController.m
+++ b/Source/SPPreferenceController.m
@@ -280,7 +280,7 @@
if (([favorite isKindOfClass:[NSDictionary class]]) && ([favorite objectForKey:@"name"]) && ([favorite objectForKey:@"query"])) continue;
// By default make the query's name the first 32 characters of the query with '...' appended
- int idx = ( [favorite length] > 32 ) ? 32 : [favorite length];
+ int idx = ( [favorite length] > 32 ) ? 32 : [favorite length]-1;
NSString *favoriteName = [[[favorite stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]] substringToIndex:idx] stringByAppendingString:@"..."];
[queryFavoritesArray replaceObjectAtIndex:i withObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:favoriteName, favorite, nil] forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]]];