From c427a2b0ce515226750a50335aac04dc1161b385 Mon Sep 17 00:00:00 2001 From: jakob Date: Thu, 1 Jul 2010 10:28:50 +0000 Subject: When editing the results from a custom query, reloading will only be performed when the "Reload after editing"-preference is selected (addresses #735) --- Source/CustomQuery.m | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'Source/CustomQuery.m') diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index b5ba5306..fdc7c5d3 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -1694,13 +1694,17 @@ } return; } - - // On success reload table data by executing the last query - reloadingExistingResult = YES; - [self storeCurrentResultViewForRestoration]; - - [self performQueries:[NSArray arrayWithObject:lastExecutedQuery] withCallback:NULL]; + // On success reload table data by executing the last query if reloading is enabled + if ([prefs boolForKey:SPReloadAfterEditingRow]) { + reloadingExistingResult = YES; + [self storeCurrentResultViewForRestoration]; + + [self performQueries:[NSArray arrayWithObject:lastExecutedQuery] withCallback:NULL]; + } else { + // otherwise, just update the data in the data storage + SPDataStorageReplaceObjectAtRowAndColumn(resultData, rowIndex, [[aTableColumn identifier] intValue], anObject); + } } else { SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"Updating field content failed. Couldn't identify field origin unambiguously (%ld match%@). It's very likely that while editing this field the table `%@` was changed by an other user.", @"message of panel when error while updating field to db after enabling it"), -- cgit v1.2.3