BathyScapheのSQLiteデータベース内を覗くアプリ
修订版 | 1a0185e4c8ac650f5189d10bb15ceacc84689b19 (tree) |
---|---|
时间 | 2008-07-06 10:19:03 |
作者 | masakih <masakih@user...> |
Commiter | masakih |
情報削除時に同時にFavoritesも削除。
git-svn-id: svn+ssh://macmini/usr/local/svnrepos/BSDBViewer/BSDBViewer@13 477addb1-df5c-4826-a637-c2b1bdcd60d4
@@ -228,7 +228,7 @@ final: | ||
228 | 228 | - (void)deleteThreadInformations:(NSArray *)infos |
229 | 229 | { |
230 | 230 | NSString *query = |
231 | - @"DELETE FROM ThreadInfo " | |
231 | + @"DELETE FROM ? " | |
232 | 232 | @"WHERE " |
233 | 233 | @"boardid = ? " |
234 | 234 | @"AND " |
@@ -246,18 +246,37 @@ final: | ||
246 | 246 | while(obj = [enume nextObject]) { |
247 | 247 | id info = [obj objectForKey:@"threadid"]; |
248 | 248 | if(!info) continue; |
249 | - NSArray *values = [NSArray arrayWithObjects:targetBoardID, info, nil]; | |
249 | + NSArray *values = [NSArray arrayWithObjects: | |
250 | + @"ThreadInfo", | |
251 | + targetBoardID, info, nil]; | |
250 | 252 | [deleQ cursorForBindValues:values]; |
251 | 253 | if([db lastErrorID] != 0) { |
252 | 254 | NSLog(@"Fail DELETE thread info: %@", obj); |
253 | 255 | NSLog(@"Fail Sending Query: %@", query); |
254 | 256 | NSLog(@"SQLite Error: %@", [db lastError]); |
257 | + goto abort; | |
258 | + } | |
259 | + values = [NSArray arrayWithObjects: | |
260 | + @"Favorites", | |
261 | + targetBoardID, info, nil]; | |
262 | + [deleQ cursorForBindValues:values]; | |
263 | + if([db lastErrorID] != 0) { | |
264 | + NSLog(@"Fail DELETE Favorites: %@", obj); | |
265 | + NSLog(@"Fail Sending Query: %@", query); | |
266 | + NSLog(@"SQLite Error: %@", [db lastError]); | |
267 | + goto abort; | |
255 | 268 | } |
256 | 269 | } |
257 | 270 | [db commitTransaction]; |
258 | 271 | |
259 | 272 | [threadSource update:self]; |
260 | 273 | [self decrementProgressStack]; |
274 | + | |
275 | + return; | |
276 | + | |
277 | +abort: | |
278 | + [db rollbackTransaction]; | |
279 | + [self decrementProgressStack]; | |
261 | 280 | } |
262 | 281 | |
263 | 282 | - (NSArray *)targetObjectsInTableView:(id)view arrayController:(NSArrayController *)ac |
@@ -21,7 +21,8 @@ all: | ||
21 | 21 | |
22 | 22 | tagging: |
23 | 23 | @echo "Tagging the $(VERSION) release of BSDBViewer project." |
24 | - echo svn copy $(HEAD) $(TAGS_DIR)/release-$(VERSION) | |
24 | + @echo | |
25 | + @echo svn copy $(HEAD) $(TAGS_DIR)/release-$(VERSION) | |
25 | 26 | |
26 | 27 | Localizable: BSTRADocument.m |
27 | 28 | genstrings -o English.lproj $< |