aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseData.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-04-09 19:03:14 +0000
committerrowanbeentje <rowan@beent.je>2012-04-09 19:03:14 +0000
commit6e9ab89e7c9085072036179b9c71906e53318ee0 (patch)
treec77f4e4994fac64b76479fae53a20cfe8f4e29f1 /Source/SPDatabaseData.m
parent761ee77727eb18e0ed6980ea98ea723cb8b3e817 (diff)
downloadsequelpro-6e9ab89e7c9085072036179b9c71906e53318ee0.tar.gz
sequelpro-6e9ab89e7c9085072036179b9c71906e53318ee0.tar.bz2
sequelpro-6e9ab89e7c9085072036179b9c71906e53318ee0.zip
- Alphabetically sort table engines, addressing Issue #1316
- If a table has no rows, don't show the data loss warning when altering table engine
Diffstat (limited to 'Source/SPDatabaseData.m')
-rw-r--r--Source/SPDatabaseData.m12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/SPDatabaseData.m b/Source/SPDatabaseData.m
index d7fa2eb8..cc782b5e 100644
--- a/Source/SPDatabaseData.m
+++ b/Source/SPDatabaseData.m
@@ -31,8 +31,8 @@
@interface SPDatabaseData (PrivateAPI)
- (NSArray *)_getDatabaseDataForQuery:(NSString *)query;
-
NSInteger _sortMySQL4CharsetEntry(NSDictionary *itemOne, NSDictionary *itemTwo, void *context);
+NSInteger _sortStorageEngineEntry(NSDictionary *itemOne, NSDictionary *itemTwo, void *context);
@end
@@ -228,7 +228,7 @@ NSInteger _sortMySQL4CharsetEntry(NSDictionary *itemOne, NSDictionary *itemTwo,
}
}
- return storageEngines;
+ return [storageEngines sortedArrayUsingFunction:_sortStorageEngineEntry context:nil];
}
/**
@@ -327,4 +327,12 @@ NSInteger _sortMySQL4CharsetEntry(NSDictionary *itemOne, NSDictionary *itemTwo,
return [[itemOne objectForKey:@"Charset"] compare:[itemTwo objectForKey:@"Charset"]];
}
+/**
+ * Sorts a storage engine array by the Engine key.
+ */
+NSInteger _sortStorageEngineEntry(NSDictionary *itemOne, NSDictionary *itemTwo, void *context)
+{
+ return [[itemOne objectForKey:@"Engine"] compare:[itemTwo objectForKey:@"Engine"]];
+}
+
@end