Mercurial > geeqie.yaz
comparison src/collect.c @ 1420:3a9fb1b52559
Use gboolean where applicable, for the sake of consistency.
author | zas_ |
---|---|
date | Thu, 12 Mar 2009 21:06:37 +0000 |
parents | fe4da037be21 |
children | cf4029d10d38 |
comparison
equal
deleted
inserted
replaced
1419:c520cfd40aef | 1420:3a9fb1b52559 |
---|---|
92 if (pixbuf) g_object_ref(pixbuf); | 92 if (pixbuf) g_object_ref(pixbuf); |
93 collection_info_free_thumb(ci); | 93 collection_info_free_thumb(ci); |
94 ci->pixbuf = pixbuf; | 94 ci->pixbuf = pixbuf; |
95 } | 95 } |
96 | 96 |
97 gint collection_info_load_thumb(CollectInfo *ci) | 97 gboolean collection_info_load_thumb(CollectInfo *ci) |
98 { | 98 { |
99 if (!ci) return FALSE; | 99 if (!ci) return FALSE; |
100 | 100 |
101 collection_info_free_thumb(ci); | 101 collection_info_free_thumb(ci); |
102 | 102 |
593 ci = collection_info_new(fd, st, NULL); | 593 ci = collection_info_new(fd, st, NULL); |
594 if (ci) g_hash_table_insert(cd->existence, fd->path, ""); | 594 if (ci) g_hash_table_insert(cd->existence, fd->path, ""); |
595 return ci; | 595 return ci; |
596 } | 596 } |
597 | 597 |
598 gint collection_add_check(CollectionData *cd, FileData *fd, gint sorted, gint must_exist) | 598 gboolean collection_add_check(CollectionData *cd, FileData *fd, gboolean sorted, gboolean must_exist) |
599 { | 599 { |
600 struct stat st; | 600 struct stat st; |
601 gint valid; | 601 gboolean valid; |
602 | 602 |
603 if (must_exist) | 603 if (must_exist) |
604 { | 604 { |
605 valid = (stat_utf8(fd->path, &st) && !S_ISDIR(st.st_mode)); | 605 valid = (stat_utf8(fd->path, &st) && !S_ISDIR(st.st_mode)); |
606 } | 606 } |
633 } | 633 } |
634 | 634 |
635 return valid; | 635 return valid; |
636 } | 636 } |
637 | 637 |
638 gint collection_add(CollectionData *cd, FileData *fd, gint sorted) | 638 gboolean collection_add(CollectionData *cd, FileData *fd, gboolean sorted) |
639 { | 639 { |
640 return collection_add_check(cd, fd, sorted, TRUE); | 640 return collection_add_check(cd, fd, sorted, TRUE); |
641 } | 641 } |
642 | 642 |
643 gint collection_insert(CollectionData *cd, FileData *fd, CollectInfo *insert_ci, gint sorted) | 643 gboolean collection_insert(CollectionData *cd, FileData *fd, CollectInfo *insert_ci, gboolean sorted) |
644 { | 644 { |
645 struct stat st; | 645 struct stat st; |
646 | 646 |
647 if (!insert_ci) return collection_add(cd, fd, sorted); | 647 if (!insert_ci) return collection_add(cd, fd, sorted); |
648 | 648 |
664 } | 664 } |
665 | 665 |
666 return FALSE; | 666 return FALSE; |
667 } | 667 } |
668 | 668 |
669 gint collection_remove(CollectionData *cd, FileData *fd) | 669 gboolean collection_remove(CollectionData *cd, FileData *fd) |
670 { | 670 { |
671 CollectInfo *ci; | 671 CollectInfo *ci; |
672 | 672 |
673 ci = collection_list_find_fd(cd->list, fd); | 673 ci = collection_list_find_fd(cd->list, fd); |
674 | 674 |
718 cd->changed = (cd->list != NULL); | 718 cd->changed = (cd->list != NULL); |
719 | 719 |
720 collection_window_refresh(collection_window_find(cd)); | 720 collection_window_refresh(collection_window_find(cd)); |
721 } | 721 } |
722 | 722 |
723 gint collection_rename(CollectionData *cd, FileData *fd) | 723 gboolean collection_rename(CollectionData *cd, FileData *fd) |
724 { | 724 { |
725 CollectInfo *ci; | 725 CollectInfo *ci; |
726 ci = collection_list_find_fd(cd->list, fd); | 726 ci = collection_list_find_fd(cd->list, fd); |
727 | 727 |
728 if (!ci) return FALSE; | 728 if (!ci) return FALSE; |
774 *------------------------------------------------------------------- | 774 *------------------------------------------------------------------- |
775 * window key presses | 775 * window key presses |
776 *------------------------------------------------------------------- | 776 *------------------------------------------------------------------- |
777 */ | 777 */ |
778 | 778 |
779 static gint collection_window_keypress(GtkWidget *widget, GdkEventKey *event, gpointer data) | 779 static gboolean collection_window_keypress(GtkWidget *widget, GdkEventKey *event, gpointer data) |
780 { | 780 { |
781 CollectWindow *cw = data; | 781 CollectWindow *cw = data; |
782 gint stop_signal = FALSE; | 782 gboolean stop_signal = FALSE; |
783 gint edit_val = -1; | 783 gint edit_val = -1; |
784 GList *list; | 784 GList *list; |
785 | 785 |
786 if (event->state & GDK_CONTROL_MASK) | 786 if (event->state & GDK_CONTROL_MASK) |
787 { | 787 { |
1135 | 1135 |
1136 cw = collection_window_find(cd); | 1136 cw = collection_window_find(cd); |
1137 if (cw) collection_window_close_final(cw); | 1137 if (cw) collection_window_close_final(cw); |
1138 } | 1138 } |
1139 | 1139 |
1140 gint collection_window_modified_exists(void) | 1140 gboolean collection_window_modified_exists(void) |
1141 { | 1141 { |
1142 GList *work; | 1142 GList *work; |
1143 | 1143 |
1144 work = collection_window_list; | 1144 work = collection_window_list; |
1145 while (work) | 1145 while (work) |
1150 } | 1150 } |
1151 | 1151 |
1152 return FALSE; | 1152 return FALSE; |
1153 } | 1153 } |
1154 | 1154 |
1155 static gint collection_window_delete(GtkWidget *widget, GdkEvent *event, gpointer data) | 1155 static gboolean collection_window_delete(GtkWidget *widget, GdkEvent *event, gpointer data) |
1156 { | 1156 { |
1157 CollectWindow *cw = data; | 1157 CollectWindow *cw = data; |
1158 collection_window_close(cw); | 1158 collection_window_close(cw); |
1159 | 1159 |
1160 return TRUE; | 1160 return TRUE; |