• R/O
  • SSH
  • HTTPS

bchan: 提交


Commit MetaInfo

修訂459 (tree)
時間2012-05-02 18:22:21
作者ornse01

Log Message

add check whether changed or not.

Change Summary

差異

--- bchanl/trunk/src/extbbslist.c (revision 458)
+++ bchanl/trunk/src/extbbslist.c (revision 459)
@@ -217,6 +217,7 @@
217217 LINK *lnk;
218218 W rectype;
219219 UH subtype;
220+ Bool changed;
220221 };
221222
222223 LOCAL extbbslist_item_t* extbbslist_sentinelnode(extbbslist_t *list)
@@ -297,6 +298,7 @@
297298 senti = extbbslist_sentinelnode(list);
298299 extbbslist_item_QueInsert(item, senti);
299300 list->num++;
301+ list->changed = True;
300302
301303 return 0;
302304 }
@@ -316,6 +318,7 @@
316318
317319 extbbslist_item_delete(item);
318320 list->num--;
321+ list->changed = True;
319322
320323 return 0; /* TODO */
321324 }
@@ -333,6 +336,7 @@
333336 item = (extbbslist_item_t*)list->sentinel.prev;
334337 extbbslist_item_delete(item);
335338 }
339+ list->changed = True;
336340 }
337341
338342 EXPORT W extbbslist_number(extbbslist_t *list)
@@ -356,6 +360,7 @@
356360 extbbslist_item_t *item;
357361 W index;
358362 } selected;
363+ Bool changed;
359364 };
360365
361366 #define EXTBBSLIST_ENTRY_HEIGHT 20
@@ -409,6 +414,7 @@
409414 senti = extbbslist_editcontext_sentinelnode(ctx);
410415 extbbslist_item_QueInsert(item, senti);
411416 ctx->num++;
417+ ctx->changed = True;
412418
413419 return 0;
414420 }
@@ -423,6 +429,8 @@
423429 return -1; /* TODO */
424430 }
425431
432+ ctx->changed = True;
433+
426434 err = extbbslist_item_assigntitle(item, title, title_len);
427435 if (err < 0) {
428436 return err;
@@ -577,6 +585,7 @@
577585 } else if (ctx->selected.index == i1) {
578586 ctx->selected.index = i0;
579587 }
588+ ctx->changed = True;
580589
581590 if (i0 + 1 == i1) {
582591 extbbslist_item_QueRemove(item1);
@@ -602,6 +611,7 @@
602611 }
603612 extbbslist_item_delete(item);
604613 ctx->num--;
614+ ctx->changed = True;
605615 if (ctx->selected.index == i) {
606616 ctx->selected.item = NULL;
607617 ctx->selected.index = -1;
@@ -679,6 +689,7 @@
679689 ctx->num = 0;
680690 ctx->selected.item = NULL;
681691 ctx->selected.index = -1;
692+ ctx->changed = False;
682693
683694 return ctx;
684695 }
@@ -738,7 +749,7 @@
738749 extbbslist_item_t *sentinel, *next;
739750 Bool empty;
740751
741- if (update != False) {
752+ if ((update != False)&&(ctx->changed != False)) {
742753 extbbslist_clear(list);
743754
744755 sentinel = extbbslist_editcontext_sentinelnode(ctx);
@@ -755,6 +766,7 @@
755766 } else {
756767 list->num = 0;
757768 }
769+ list->changed = True;
758770 }
759771
760772 list->edit = NULL;
@@ -828,6 +840,7 @@
828840 list->lnk = db_link;
829841 list->rectype = rectype;
830842 list->subtype = subtype;
843+ list->changed = False;
831844 }
832845
833846 LOCAL VOID extbbslist_finalize(extbbslist_t *list)
Show on old repository browser