aboutsummaryrefslogtreecommitdiffstats
path: root/Source/MainController.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-02-25 01:03:29 +0000
committerrowanbeentje <rowan@beent.je>2009-02-25 01:03:29 +0000
commit10a7c5a32983070158a736e479b2c6200ecd70fd (patch)
treebc8c6b5a30886449707b5464bacdc570bfa0e775 /Source/MainController.m
parent27285b94decd7e3ce6e6600ee074e92bd0449f7d (diff)
downloadsequelpro-10a7c5a32983070158a736e479b2c6200ecd70fd.tar.gz
sequelpro-10a7c5a32983070158a736e479b2c6200ecd70fd.tar.bz2
sequelpro-10a7c5a32983070158a736e479b2c6200ecd70fd.zip
Implement a connection keepalive, addressing Issue #171. This runs a ping every sixty seconds (a value stored in prefs, though not exposed via the prefs interface yet) in a background thread, to further improve connectivity handling following r334. Pings are only run when necessary - ie active use of the program extends the next ping interval as appropriate, so general impact should be minimal.
Diffstat (limited to 'Source/MainController.m')
-rw-r--r--Source/MainController.m10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/MainController.m b/Source/MainController.m
index f05d7046..c5e2eeb0 100644
--- a/Source/MainController.m
+++ b/Source/MainController.m
@@ -663,11 +663,13 @@ checks for updates and opens download page in default browser
[NSNumber numberWithBool:YES], @"fetchRowCount",
[NSNumber numberWithBool:YES], @"limitRows",
[NSNumber numberWithInt:1000], @"limitRowsValue",
+ [NSNumber numberWithInt:60], @"keepAliveInterval",
+ [NSNumber numberWithInt:0], @"lastUsedVersion",
nil]];
- // If no version number is present in prefs, and column widths have been saved, walk through
- // them and remove any table widths set to 15 or less (fix for mangled columns caused by Issue #140)
- if ([prefs objectForKey:@"lastUsedVersion"] == nil && [prefs objectForKey:@"tableColumnWidths"] != nil) {
+ // For versions prior to r336, where column widths have been saved, walk through them and remove
+ // any table widths set to 15 or less (fix for mangled columns caused by Issue #140)
+ if ([[prefs objectForKey:@"lastUsedVersion"] intValue] < 336 && [prefs objectForKey:@"tableColumnWidths"] != nil) {
NSEnumerator *databaseEnumerator, *tableEnumerator, *columnEnumerator;
NSString *databaseKey, *tableKey, *columnKey;
NSMutableDictionary *newDatabase, *newTable;
@@ -700,7 +702,7 @@ checks for updates and opens download page in default browser
[prefs setObject:[NSDictionary dictionaryWithDictionary:newTableColumnWidths] forKey:@"tableColumnWidths"];
[newTableColumnWidths release];
}
-
+
// Write the current bundle version to the prefs
[prefs setObject:[NSNumber numberWithInt:currentVersionNumber] forKey:@"lastUsedVersion"];