• R/O
  • HTTP
  • SSH
  • HTTPS

提交

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

BathyScapheのSQLiteデータベース内を覗くアプリ


Commit MetaInfo

修订版1a0185e4c8ac650f5189d10bb15ceacc84689b19 (tree)
时间2008-07-06 10:19:03
作者masakih <masakih@user...>
Commitermasakih

Log Message

情報削除時に同時にFavoritesも削除。

git-svn-id: svn+ssh://macmini/usr/local/svnrepos/BSDBViewer/BSDBViewer@13 477addb1-df5c-4826-a637-c2b1bdcd60d4

更改概述

差异

--- a/BSDBViewer.m
+++ b/BSDBViewer.m
@@ -228,7 +228,7 @@ final:
228228 - (void)deleteThreadInformations:(NSArray *)infos
229229 {
230230 NSString *query =
231- @"DELETE FROM ThreadInfo "
231+ @"DELETE FROM ? "
232232 @"WHERE "
233233 @"boardid = ? "
234234 @"AND "
@@ -246,18 +246,37 @@ final:
246246 while(obj = [enume nextObject]) {
247247 id info = [obj objectForKey:@"threadid"];
248248 if(!info) continue;
249- NSArray *values = [NSArray arrayWithObjects:targetBoardID, info, nil];
249+ NSArray *values = [NSArray arrayWithObjects:
250+ @"ThreadInfo",
251+ targetBoardID, info, nil];
250252 [deleQ cursorForBindValues:values];
251253 if([db lastErrorID] != 0) {
252254 NSLog(@"Fail DELETE thread info: %@", obj);
253255 NSLog(@"Fail Sending Query: %@", query);
254256 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;
255268 }
256269 }
257270 [db commitTransaction];
258271
259272 [threadSource update:self];
260273 [self decrementProgressStack];
274+
275+ return;
276+
277+abort:
278+ [db rollbackTransaction];
279+ [self decrementProgressStack];
261280 }
262281
263282 - (NSArray *)targetObjectsInTableView:(id)view arrayController:(NSArrayController *)ac
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,8 @@ all:
2121
2222 tagging:
2323 @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)
2526
2627 Localizable: BSTRADocument.m
2728 genstrings -o English.lproj $<