Mercurial > geeqie.yaz
changeset 1420:3a9fb1b52559
Use gboolean where applicable, for the sake of consistency.
author | zas_ |
---|---|
date | Thu, 12 Mar 2009 21:06:37 +0000 |
parents | c520cfd40aef |
children | 130054d9dd8a |
files | src/cache-loader.h src/cache.c src/cache.h src/cache_maint.c src/cache_maint.h src/collect-dlg.c src/collect-io.c src/collect-io.h src/collect-table.c src/collect.c src/collect.h src/color-man.c src/dnd.c src/dupe.c src/dupe.h src/similar.c src/similar.h |
diffstat | 17 files changed, 162 insertions(+), 166 deletions(-) [+] |
line wrap: on
line diff
--- a/src/cache-loader.h Wed Mar 11 23:36:01 2009 +0000 +++ b/src/cache-loader.h Thu Mar 12 21:06:37 2009 +0000 @@ -42,7 +42,7 @@ CacheLoaderDoneFunc done_func; gpointer done_data; - gint error; + gboolean error; ImageLoader *il; gint idle_id;
--- a/src/cache.c Wed Mar 11 23:36:01 2009 +0000 +++ b/src/cache.c Thu Mar 12 21:06:37 2009 +0000 @@ -74,7 +74,7 @@ *------------------------------------------------------------------- */ -static gint cache_sim_write_dimensions(SecureSaveInfo *ssi, CacheData *cd) +static gboolean cache_sim_write_dimensions(SecureSaveInfo *ssi, CacheData *cd) { if (!cd || !cd->dimensions) return FALSE; @@ -83,7 +83,7 @@ return TRUE; } -static gint cache_sim_write_date(SecureSaveInfo *ssi, CacheData *cd) +static gboolean cache_sim_write_date(SecureSaveInfo *ssi, CacheData *cd) { if (!cd || !cd->have_date) return FALSE; @@ -92,7 +92,7 @@ return TRUE; } -static gint cache_sim_write_checksum(SecureSaveInfo *ssi, CacheData *cd) +static gboolean cache_sim_write_checksum(SecureSaveInfo *ssi, CacheData *cd) { if (!cd || !cd->have_checksum) return FALSE; @@ -101,7 +101,7 @@ return TRUE; } -static gint cache_sim_write_md5sum(SecureSaveInfo *ssi, CacheData *cd) +static gboolean cache_sim_write_md5sum(SecureSaveInfo *ssi, CacheData *cd) { gchar *text; @@ -114,7 +114,7 @@ return TRUE; } -static gint cache_sim_write_similarity(SecureSaveInfo *ssi, CacheData *cd) +static gboolean cache_sim_write_similarity(SecureSaveInfo *ssi, CacheData *cd) { guint x, y; guint8 buf[3 * 32]; @@ -145,7 +145,7 @@ return TRUE; } -gint cache_sim_data_save(CacheData *cd) +gboolean cache_sim_data_save(CacheData *cd) { SecureSaveInfo *ssi; gchar *pathl; @@ -185,7 +185,7 @@ *------------------------------------------------------------------- */ -static gint cache_sim_read_skipline(FILE *f, gint s) +static gboolean cache_sim_read_skipline(FILE *f, gint s) { if (!f) return FALSE; @@ -202,7 +202,7 @@ return FALSE; } -static gint cache_sim_read_comment(FILE *f, gchar *buf, gint s, CacheData *cd) +static gboolean cache_sim_read_comment(FILE *f, gchar *buf, gint s, CacheData *cd) { if (!f || !buf || !cd) return FALSE; @@ -211,7 +211,7 @@ return cache_sim_read_skipline(f, s - 1); } -static gint cache_sim_read_dimensions(FILE *f, gchar *buf, gint s, CacheData *cd) +static gboolean cache_sim_read_dimensions(FILE *f, gchar *buf, gint s, CacheData *cd) { if (!f || !buf || !cd) return FALSE; @@ -254,7 +254,7 @@ return FALSE; } -static gint cache_sim_read_date(FILE *f, gchar *buf, gint s, CacheData *cd) +static gboolean cache_sim_read_date(FILE *f, gchar *buf, gint s, CacheData *cd) { if (!f || !buf || !cd) return FALSE; @@ -294,7 +294,7 @@ return FALSE; } -static gint cache_sim_read_checksum(FILE *f, gchar *buf, gint s, CacheData *cd) +static gboolean cache_sim_read_checksum(FILE *f, gchar *buf, gint s, CacheData *cd) { if (!f || !buf || !cd) return FALSE; @@ -334,7 +334,7 @@ return FALSE; } -static gint cache_sim_read_md5sum(FILE *f, gchar *buf, gint s, CacheData *cd) +static gboolean cache_sim_read_md5sum(FILE *f, gchar *buf, gint s, CacheData *cd) { if (!f || !buf || !cd) return FALSE; @@ -371,7 +371,7 @@ return FALSE; } -static gint cache_sim_read_similarity(FILE *f, gchar *buf, gint s, CacheData *cd) +static gboolean cache_sim_read_similarity(FILE *f, gchar *buf, gint s, CacheData *cd) { if (!f || !buf || !cd) return FALSE; @@ -570,7 +570,7 @@ cd->similarity = TRUE; } -gint cache_sim_data_filled(ImageSimilarityData *sd) +gboolean cache_sim_data_filled(ImageSimilarityData *sd) { if (!sd) return FALSE; return sd->filled; @@ -678,7 +678,7 @@ const gchar *cache_rc; const gchar *cache_local; const gchar *cache_ext; - gint prefer_local; + gboolean prefer_local; if (!source) return NULL; @@ -726,13 +726,13 @@ return path; } -gint cache_time_valid(const gchar *cache, const gchar *path) +gboolean cache_time_valid(const gchar *cache, const gchar *path) { struct stat cache_st; struct stat path_st; gchar *cachel; gchar *pathl; - gint ret = FALSE; + gboolean ret = FALSE; if (!cache || !path) return FALSE;
--- a/src/cache.h Wed Mar 11 23:36:01 2009 +0000 +++ b/src/cache.h Thu Mar 12 21:06:37 2009 +0000 @@ -48,20 +48,20 @@ guchar md5sum[16]; ImageSimilarityData *sim; - gint dimensions; - gint have_date; - gint have_checksum; - gint have_md5sum; - gint similarity; + gboolean dimensions; + gboolean have_date; + gboolean have_checksum; + gboolean have_md5sum; + gboolean similarity; }; -gint cache_time_valid(const gchar *cache, const gchar *path); +gboolean cache_time_valid(const gchar *cache, const gchar *path); CacheData *cache_sim_data_new(void); void cache_sim_data_free(CacheData *cd); -gint cache_sim_data_save(CacheData *cd); +gboolean cache_sim_data_save(CacheData *cd); CacheData *cache_sim_data_load(const gchar *path); void cache_sim_data_set_dimensions(CacheData *cd, gint w, gint h);
--- a/src/cache_maint.c Wed Mar 11 23:36:01 2009 +0000 +++ b/src/cache_maint.c Thu Mar 12 21:06:37 2009 +0000 @@ -36,8 +36,8 @@ GtkWidget *spinner; GtkWidget *button_stop; GtkWidget *button_close; - gint clear; - gint metadata; + gboolean clear; + gboolean metadata; }; #define PURGE_DIALOG_WIDTH 400 @@ -83,7 +83,7 @@ return dot; } -static gint isempty(const gchar *path) +static gboolean isempty(const gchar *path) { DIR *dp; struct dirent *dir; @@ -133,7 +133,7 @@ gtk_widget_set_sensitive(cm->button_close, TRUE); } -static gint cache_maintain_home_cb(gpointer data) +static gboolean cache_maintain_home_cb(gpointer data) { CMData *cm = data; GList *dlist = NULL; @@ -269,7 +269,7 @@ } /* sorry for complexity (cm->done_list), but need it to remove empty dirs */ -void cache_maintain_home(gint metadata, gint clear, GtkWidget *parent) +void cache_maintain_home(gboolean metadata, gboolean clear, GtkWidget *parent) { CMData *cm; GList *dlist; @@ -671,7 +671,7 @@ GList *list_dir; gint days; - gint clear; + gboolean clear; GtkWidget *button_close; GtkWidget *button_stop; @@ -685,8 +685,8 @@ gint count_total; gint count_done; - gint local; - gint recurse; + gboolean local; + gboolean recurse; gint idle_id; }; @@ -755,7 +755,7 @@ cd->list_dir = g_list_concat(list_d, cd->list_dir); } -static gint cache_manager_render_file(CleanData *cd); +static gboolean cache_manager_render_file(CleanData *cd); static void cache_manager_render_thumb_done_cb(ThumbLoader *tl, gpointer data) { @@ -767,7 +767,7 @@ while (cache_manager_render_file(cd)); } -static gint cache_manager_render_file(CleanData *cd) +static gboolean cache_manager_render_file(CleanData *cd) { if (cd->list) { @@ -987,7 +987,7 @@ return FALSE; } -static void cache_manager_standard_clean_valid_cb(const gchar *path, gint valid, gpointer data) +static void cache_manager_standard_clean_valid_cb(const gchar *path, gboolean valid, gpointer data) { CleanData *cd = data; @@ -1075,7 +1075,7 @@ } } -static void cache_manager_standard_process(GtkWidget *widget, gint clear) +static void cache_manager_standard_process(GtkWidget *widget, gboolean clear) { CleanData *cd; const gchar *stock_id;
--- a/src/cache_maint.h Wed Mar 11 23:36:01 2009 +0000 +++ b/src/cache_maint.h Thu Mar 12 21:06:37 2009 +0000 @@ -15,7 +15,7 @@ #define CACHE_MAINT_H -void cache_maintain_home(gint metadata, gint clear, GtkWidget *parent); +void cache_maintain_home(gboolean metadata, gboolean clear, GtkWidget *parent); #if 0 gint cache_maintain_home_dir(const gchar *dir, gint recursive, gint clear);
--- a/src/collect-dlg.c Wed Mar 11 23:36:01 2009 +0000 +++ b/src/collect-dlg.c Thu Mar 12 21:06:37 2009 +0000 @@ -30,7 +30,7 @@ }; -static gint collection_save_confirmed(FileDialog *fd, gint overwrite, CollectionData *cd); +static gboolean collection_save_confirmed(FileDialog *fd, gboolean overwrite, CollectionData *cd); static void collection_confirm_ok_cb(GenericDialog *gd, gpointer data) @@ -50,7 +50,7 @@ /* this is a no-op, so the cancel button is added */ } -static gint collection_save_confirmed(FileDialog *fd, gint overwrite, CollectionData *cd) +static gboolean collection_save_confirmed(FileDialog *fd, gboolean overwrite, CollectionData *cd) { gchar *buf;
--- a/src/collect-io.c Wed Mar 11 23:36:01 2009 +0000 +++ b/src/collect-io.c Thu Mar 12 21:06:37 2009 +0000 @@ -38,7 +38,7 @@ static gint collect_manager_process_action(CollectManagerEntry *entry, gchar **path_ptr); -static gint scan_geometry(gchar *buffer, gint *x, gint *y, gint *w, gint *h) +static gboolean scan_geometry(gchar *buffer, gint *x, gint *y, gint *w, gint *h) { gint nx, ny, nw, nh; @@ -52,17 +52,17 @@ return TRUE; } -static gint collection_load_private(CollectionData *cd, const gchar *path, CollectionLoadFlags flags) +static gboolean collection_load_private(CollectionData *cd, const gchar *path, CollectionLoadFlags flags) { gchar s_buf[GQ_COLLECTION_READ_BUFSIZE]; FILE *f; gchar *pathl; - gint limit_failures = TRUE; - gint success = TRUE; - gint has_official_header = FALSE; - gint has_geometry_header = FALSE; - gint has_gqview_header = FALSE; - gint need_header = TRUE; + gboolean limit_failures = TRUE; + gboolean success = TRUE; + gboolean has_official_header = FALSE; + gboolean has_geometry_header = FALSE; + gboolean has_gqview_header = FALSE; + gboolean need_header = TRUE; guint total = 0; guint fail = 0; gboolean changed = FALSE; @@ -210,7 +210,7 @@ return success; } -gint collection_load(CollectionData *cd, const gchar *path, CollectionLoadFlags flags) +gboolean collection_load(CollectionData *cd, const gchar *path, CollectionLoadFlags flags) { if (collection_load_private(cd, path, flags | COLLECTION_LOAD_FLUSH)) { @@ -307,7 +307,7 @@ if (!cd->thumb_loader) collection_load_thumb_step(cd); } -gint collection_load_begin(CollectionData *cd, const gchar *path, CollectionLoadFlags flags) +gboolean collection_load_begin(CollectionData *cd, const gchar *path, CollectionLoadFlags flags) { if (!collection_load(cd, path, flags)) return FALSE; @@ -324,7 +324,7 @@ cd->thumb_loader = NULL; } -static gint collection_save_private(CollectionData *cd, const gchar *path) +static gboolean collection_save_private(CollectionData *cd, const gchar *path) { SecureSaveInfo *ssi; GList *work; @@ -391,7 +391,7 @@ return TRUE; } -gint collection_save(CollectionData *cd, const gchar *path) +gboolean collection_save(CollectionData *cd, const gchar *path) { if (collection_save_private(cd, path)) { @@ -402,7 +402,7 @@ return FALSE; } -gint collection_load_only_geometry(CollectionData *cd, const gchar *path) +gboolean collection_load_only_geometry(CollectionData *cd, const gchar *path) { return collection_load(cd, path, COLLECTION_LOAD_GEOMETRY); } @@ -633,7 +633,7 @@ collect_manager_action_ref(action); } -static gint collect_manager_process_action(CollectManagerEntry *entry, gchar **path_ptr) +static gboolean collect_manager_process_action(CollectManagerEntry *entry, gchar **path_ptr) { gchar *path = *path_ptr; CollectManagerAction *action; @@ -781,10 +781,10 @@ } } -static gint collect_manager_process_entry(CollectManagerEntry *entry) +static gboolean collect_manager_process_entry(CollectManagerEntry *entry) { CollectionData *cd; - gint success; + gboolean success; if (entry->empty) return FALSE; @@ -796,7 +796,7 @@ return TRUE; } -static gint collect_manager_process_entry_list(void) +static gboolean collect_manager_process_entry_list(void) { GList *work; @@ -815,7 +815,7 @@ -static gint collect_manager_process_cb(gpointer data) +static gboolean collect_manager_process_cb(gpointer data) { if (collection_manager_action_list) collect_manager_refresh(); collect_manager_process_actions(COLLECT_MANAGER_ACTIONS_PER_IDLE); @@ -827,7 +827,7 @@ return FALSE; } -static gint collect_manager_timer_cb(gpointer data) +static gboolean collect_manager_timer_cb(gpointer data) { DEBUG_1("collection manager timer expired"); @@ -934,7 +934,6 @@ void collect_manager_notify_cb(FileData *fd, NotifyType type, gpointer data) { - if (type != NOTIFY_TYPE_CHANGE || !fd->change) return; switch (fd->change->type)
--- a/src/collect-io.h Wed Mar 11 23:36:01 2009 +0000 +++ b/src/collect-io.h Thu Mar 12 21:06:37 2009 +0000 @@ -21,16 +21,16 @@ COLLECTION_LOAD_GEOMETRY= 1 << 2, } CollectionLoadFlags; -gint collection_load(CollectionData *cd, const gchar *path, CollectionLoadFlags flags); +gboolean collection_load(CollectionData *cd, const gchar *path, CollectionLoadFlags flags); -gint collection_load_begin(CollectionData *cd, const gchar *path, CollectionLoadFlags flags); +gboolean collection_load_begin(CollectionData *cd, const gchar *path, CollectionLoadFlags flags); void collection_load_stop(CollectionData *cd); void collection_load_thumb_idle(CollectionData *cd); -gint collection_save(CollectionData *cd, const gchar *path); +gboolean collection_save(CollectionData *cd, const gchar *path); -gint collection_load_only_geometry(CollectionData *cd, const gchar *path); +gboolean collection_load_only_geometry(CollectionData *cd, const gchar *path); /* these are used to update collections contained in user's collection
--- a/src/collect-table.c Wed Mar 11 23:36:01 2009 +0000 +++ b/src/collect-table.c Thu Mar 12 21:06:37 2009 +0000 @@ -65,7 +65,7 @@ #define INFO_SELECTED(x) (x->flag_mask & SELECTION_SELECTED) -static void collection_table_populate_at_new_size(CollectTable *ct, gint w, gint h, gint force); +static void collection_table_populate_at_new_size(CollectTable *ct, gint w, gint h, gboolean force); /* @@ -74,7 +74,7 @@ *------------------------------------------------------------------- */ -static gint collection_table_find_position(CollectTable *ct, CollectInfo *info, gint *row, gint *col) +static gboolean collection_table_find_position(CollectTable *ct, CollectInfo *info, gint *row, gint *col) { gint n; @@ -88,7 +88,7 @@ return TRUE; } -static gint collection_table_find_iter(CollectTable *ct, CollectInfo *info, GtkTreeIter *iter, gint *column) +static gboolean collection_table_find_iter(CollectTable *ct, CollectInfo *info, GtkTreeIter *iter, gint *column) { GtkTreeModel *store; gint row, col; @@ -227,7 +227,7 @@ g_free(buf); } -static void collection_table_update_extras(CollectTable *ct, gint loading, gdouble value) +static void collection_table_update_extras(CollectTable *ct, gboolean loading, gdouble value) { gchar *text; @@ -422,7 +422,7 @@ collection_table_update_status(ct); } -static void collection_table_select_util(CollectTable *ct, CollectInfo *info, gint select) +static void collection_table_select_util(CollectTable *ct, CollectInfo *info, gboolean select) { if (select) { @@ -434,7 +434,7 @@ } } -static void collection_table_select_region_util(CollectTable *ct, CollectInfo *start, CollectInfo *end, gint select) +static void collection_table_select_region_util(CollectTable *ct, CollectInfo *start, CollectInfo *end, gboolean select) { gint row1, col1; gint row2, col2; @@ -548,7 +548,7 @@ ct->tip_window = NULL; } -static gint tip_schedule_cb(gpointer data) +static gboolean tip_schedule_cb(gpointer data) { CollectTable *ct = data; @@ -844,7 +844,7 @@ ct->editmenu_fd_list = NULL; } -static GtkWidget *collection_table_popup_menu(CollectTable *ct, gint over_icon) +static GtkWidget *collection_table_popup_menu(CollectTable *ct, gboolean over_icon) { GtkWidget *menu; GtkWidget *item; @@ -969,7 +969,7 @@ } } -static void collection_table_move_focus(CollectTable *ct, gint row, gint col, gint relative) +static void collection_table_move_focus(CollectTable *ct, gint row, gint col, gboolean relative) { gint new_row; gint new_col; @@ -1115,15 +1115,14 @@ popup_menu_position_clamp(menu, x, y, 0); } -static gint collection_table_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) +static gboolean collection_table_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) { CollectTable *ct = data; gint focus_row = 0; gint focus_col = 0; CollectInfo *info; - gint stop_signal; - - stop_signal = TRUE; + gboolean stop_signal = TRUE; + switch (event->keyval) { case GDK_Left: case GDK_KP_Left: @@ -1240,8 +1239,8 @@ *------------------------------------------------------------------- */ -static CollectInfo *collection_table_insert_find(CollectTable *ct, CollectInfo *source, gint *after, GdkRectangle *cell, - gint use_coord, gint x, gint y) +static CollectInfo *collection_table_insert_find(CollectTable *ct, CollectInfo *source, gboolean *after, GdkRectangle *cell, + gboolean use_coord, gint x, gint y) { CollectInfo *info = NULL; GtkTreeModel *store; @@ -1264,7 +1263,7 @@ gtk_tree_path_free(tpath); info = source; - *after = (x > cell->x + (cell->width / 2)); + *after = !!(x > cell->x + (cell->width / 2)); } return info; } @@ -1284,7 +1283,7 @@ if (info) { gtk_tree_view_get_background_area(GTK_TREE_VIEW(ct->listview), tpath, column, cell); - *after = (x > cell->x + (cell->width / 2)); + *after = !!(x > cell->x + (cell->width / 2)); } gtk_tree_path_free(tpath); @@ -1319,7 +1318,7 @@ { CollectInfo *info; GdkRectangle cell; - gint after = FALSE; + gboolean after = FALSE; info = collection_table_insert_find(ct, NULL, &after, &cell, TRUE, x, y); @@ -1341,10 +1340,10 @@ return info; } -static void collection_table_insert_marker(CollectTable *ct, CollectInfo *info, gint enable) +static void collection_table_insert_marker(CollectTable *ct, CollectInfo *info, gboolean enable) { gint row, col; - gint after = FALSE; + gboolean after = FALSE; GdkRectangle cell; if (!enable) @@ -1430,7 +1429,7 @@ *------------------------------------------------------------------- */ -static void collection_table_motion_update(CollectTable *ct, gint x, gint y, gint drop_event) +static void collection_table_motion_update(CollectTable *ct, gint x, gint y, gboolean drop_event) { CollectInfo *info; @@ -1447,7 +1446,7 @@ } } -static gint collection_table_auto_scroll_idle_cb(gpointer data) +static gboolean collection_table_auto_scroll_idle_cb(gpointer data) { CollectTable *ct = data; GdkWindow *window; @@ -1468,7 +1467,7 @@ return FALSE; } -static gint collection_table_auto_scroll_notify_cb(GtkWidget *widget, gint x, gint y, gpointer data) +static gboolean collection_table_auto_scroll_notify_cb(GtkWidget *widget, gint x, gint y, gpointer data) { CollectTable *ct = data; @@ -1477,7 +1476,7 @@ return TRUE; } -static void collection_table_scroll(CollectTable *ct, gint scroll) +static void collection_table_scroll(CollectTable *ct, gboolean scroll) { if (!scroll) { @@ -1503,7 +1502,7 @@ *------------------------------------------------------------------- */ -static gint collection_table_motion_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) +static gboolean collection_table_motion_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) { CollectTable *ct = data; @@ -1512,7 +1511,7 @@ return FALSE; } -static gint collection_table_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) +static gboolean collection_table_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) { CollectTable *ct = data; GtkTreeIter iter; @@ -1551,7 +1550,7 @@ return TRUE; } -static gint collection_table_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) +static gboolean collection_table_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) { CollectTable *ct = data; GtkTreeIter iter; @@ -1559,7 +1558,7 @@ tip_schedule(ct); - if ((gint)bevent->x != 0 || (gint) bevent->y != 0) + if ((gint)bevent->x != 0 || (gint)bevent->y != 0) { info = collection_table_find_data_by_coord(ct, (gint)bevent->x, (gint)bevent->y, &iter); } @@ -1576,9 +1575,8 @@ if (bevent->state & GDK_CONTROL_MASK) { - gint select; - - select = !INFO_SELECTED(info); + gboolean select = !INFO_SELECTED(info); + if ((bevent->state & GDK_SHIFT_MASK) && ct->prev_selection) { collection_table_select_region_util(ct, ct->prev_selection, info, select); @@ -1612,7 +1610,7 @@ return TRUE; } -static gint collection_table_leave_cb(GtkWidget *widget, GdkEventCrossing *event, gpointer data) +static gboolean collection_table_leave_cb(GtkWidget *widget, GdkEventCrossing *event, gpointer data) { CollectTable *ct = data; @@ -1661,7 +1659,7 @@ return list; } -static void collection_table_populate(CollectTable *ct, gint resize) +static void collection_table_populate(CollectTable *ct, gboolean resize) { gint row; GList *work; @@ -1725,7 +1723,7 @@ collection_table_update_status(ct); } -static void collection_table_populate_at_new_size(CollectTable *ct, gint w, gint h, gint force) +static void collection_table_populate_at_new_size(CollectTable *ct, gint w, gint h, gboolean force) { gint new_cols; gint thumb_width; @@ -1809,7 +1807,7 @@ collection_table_update_status(ct); } -static gint collection_table_sync_idle_cb(gpointer data) +static gboolean collection_table_sync_idle_cb(gpointer data) { CollectTable *ct = data; @@ -1993,7 +1991,7 @@ *------------------------------------------------------------------- */ -static void collection_table_add_dir_recursive(CollectTable *ct, FileData *dir_fd, gint recursive) +static void collection_table_add_dir_recursive(CollectTable *ct, FileData *dir_fd, gboolean recursive) { GList *d; GList *f; @@ -2021,7 +2019,7 @@ filelist_free(d); } -static void confirm_dir_list_do(CollectTable *ct, GList *list, gint recursive) +static void confirm_dir_list_do(CollectTable *ct, GList *list, gboolean recursive) { GList *work = list; while (work) @@ -2102,7 +2100,7 @@ guint time, gpointer data) { CollectTable *ct = data; - gint selected; + gboolean selected; GList *list = NULL; gchar *uri_text = NULL; gint total; @@ -2513,4 +2511,5 @@ { return collection_table_find_data(ct, ct->focus_row, ct->focus_column, NULL); } + /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
--- a/src/collect.c Wed Mar 11 23:36:01 2009 +0000 +++ b/src/collect.c Thu Mar 12 21:06:37 2009 +0000 @@ -94,7 +94,7 @@ ci->pixbuf = pixbuf; } -gint collection_info_load_thumb(CollectInfo *ci) +gboolean collection_info_load_thumb(CollectInfo *ci) { if (!ci) return FALSE; @@ -595,10 +595,10 @@ return ci; } -gint collection_add_check(CollectionData *cd, FileData *fd, gint sorted, gint must_exist) +gboolean collection_add_check(CollectionData *cd, FileData *fd, gboolean sorted, gboolean must_exist) { struct stat st; - gint valid; + gboolean valid; if (must_exist) { @@ -635,12 +635,12 @@ return valid; } -gint collection_add(CollectionData *cd, FileData *fd, gint sorted) +gboolean collection_add(CollectionData *cd, FileData *fd, gboolean sorted) { return collection_add_check(cd, fd, sorted, TRUE); } -gint collection_insert(CollectionData *cd, FileData *fd, CollectInfo *insert_ci, gint sorted) +gboolean collection_insert(CollectionData *cd, FileData *fd, CollectInfo *insert_ci, gboolean sorted) { struct stat st; @@ -666,7 +666,7 @@ return FALSE; } -gint collection_remove(CollectionData *cd, FileData *fd) +gboolean collection_remove(CollectionData *cd, FileData *fd) { CollectInfo *ci; @@ -720,7 +720,7 @@ collection_window_refresh(collection_window_find(cd)); } -gint collection_rename(CollectionData *cd, FileData *fd) +gboolean collection_rename(CollectionData *cd, FileData *fd) { CollectInfo *ci; ci = collection_list_find_fd(cd->list, fd); @@ -776,10 +776,10 @@ *------------------------------------------------------------------- */ -static gint collection_window_keypress(GtkWidget *widget, GdkEventKey *event, gpointer data) +static gboolean collection_window_keypress(GtkWidget *widget, GdkEventKey *event, gpointer data) { CollectWindow *cw = data; - gint stop_signal = FALSE; + gboolean stop_signal = FALSE; gint edit_val = -1; GList *list; @@ -1137,7 +1137,7 @@ if (cw) collection_window_close_final(cw); } -gint collection_window_modified_exists(void) +gboolean collection_window_modified_exists(void) { GList *work; @@ -1152,7 +1152,7 @@ return FALSE; } -static gint collection_window_delete(GtkWidget *widget, GdkEvent *event, gpointer data) +static gboolean collection_window_delete(GtkWidget *widget, GdkEvent *event, gpointer data) { CollectWindow *cw = data; collection_window_close(cw);
--- a/src/collect.h Wed Mar 11 23:36:01 2009 +0000 +++ b/src/collect.h Thu Mar 12 21:06:37 2009 +0000 @@ -21,7 +21,7 @@ void collection_info_free(CollectInfo *ci); void collection_info_set_thumb(CollectInfo *ci, GdkPixbuf *pixbuf); -gint collection_info_load_thumb(CollectInfo *ci); +gboolean collection_info_load_thumb(CollectInfo *ci); void collection_list_free(GList *list); @@ -62,12 +62,12 @@ void collection_set_update_info_func(CollectionData *cd, void (*func)(CollectionData *, CollectInfo *, gpointer), gpointer data); -gint collection_add(CollectionData *cd, FileData *fd, gint sorted); -gint collection_add_check(CollectionData *cd, FileData *fd, gint sorted, gint must_exist); -gint collection_insert(CollectionData *cd, FileData *fd, CollectInfo *insert_ci, gint sorted); -gint collection_remove(CollectionData *cd, FileData *fd); +gboolean collection_add(CollectionData *cd, FileData *fd, gboolean sorted); +gboolean collection_add_check(CollectionData *cd, FileData *fd, gboolean sorted, gboolean must_exist); +gboolean collection_insert(CollectionData *cd, FileData *fd, CollectInfo *insert_ci, gboolean sorted); +gboolean collection_remove(CollectionData *cd, FileData *fd); void collection_remove_by_info_list(CollectionData *cd, GList *list); -gint collection_rename(CollectionData *cd, FileData *fd); +gboolean collection_rename(CollectionData *cd, FileData *fd); void collection_update_geometry(CollectionData *cd); @@ -75,7 +75,7 @@ void collection_window_close_by_collection(CollectionData *cd); CollectWindow *collection_window_find(CollectionData *cd); CollectWindow *collection_window_find_by_path(const gchar *path); -gint collection_window_modified_exists(void); +gboolean collection_window_modified_exists(void); #endif
--- a/src/color-man.c Wed Mar 11 23:36:01 2009 +0000 +++ b/src/color-man.c Thu Mar 12 21:06:37 2009 +0000 @@ -36,7 +36,7 @@ ColorManProfileType profile_out_type; gchar *profile_out_file; - gint has_alpha; + gboolean has_alpha; gint refcount; }; @@ -47,7 +47,7 @@ static void color_man_lib_init(void) { - static gint init_done = FALSE; + static gboolean init_done = FALSE; if (init_done) return; init_done = TRUE; @@ -136,7 +136,7 @@ static ColorManCache *color_man_cache_new(ColorManProfileType in_type, const gchar *in_file, guchar *in_data, guint in_data_len, ColorManProfileType out_type, const gchar *out_file, - gint has_alpha) + gboolean has_alpha) { ColorManCache *cc; @@ -213,7 +213,7 @@ static ColorManCache *color_man_cache_find(ColorManProfileType in_type, const gchar *in_file, ColorManProfileType out_type, const gchar *out_file, - gint has_alpha) + gboolean has_alpha) { GList *work; @@ -221,7 +221,7 @@ while (work) { ColorManCache *cc; - gint match = FALSE; + gboolean match = FALSE; cc = work->data; work = work->next; @@ -253,7 +253,7 @@ static ColorManCache *color_man_cache_get(ColorManProfileType in_type, const gchar *in_file, guchar *in_data, guint in_data_len, ColorManProfileType out_type, const gchar *out_file, - gint has_alpha) + gboolean has_alpha) { ColorManCache *cc; @@ -315,11 +315,12 @@ } -static gint color_man_idle_cb(gpointer data) +static gboolean color_man_idle_cb(gpointer data) { ColorMan *cm = data; gint width, height; gint rh; + if (!cm->pixbuf) return FALSE; if (cm->imd && @@ -359,7 +360,7 @@ ColorManProfileType screen_type, const gchar *screen_file) { ColorMan *cm; - gint has_alpha; + gboolean has_alpha; if (imd) pixbuf = image_get_pixbuf(imd);
--- a/src/dnd.c Wed Mar 11 23:36:01 2009 +0000 +++ b/src/dnd.c Thu Mar 12 21:06:37 2009 +0000 @@ -38,7 +38,7 @@ static void pixbuf_draw_border(GdkPixbuf *pixbuf, gint w, gint h) { - gint alpha; + gboolean alpha; gint rs; guchar *pix; guchar *p; @@ -74,7 +74,7 @@ static void pixbuf_draw_rect(GdkPixbuf *pixbuf, gint x, gint y, gint w, gint h, guint8 val) { - gint alpha; + gboolean alpha; gint rs; guchar *pix; guchar *p;
--- a/src/dupe.c Wed Mar 11 23:36:01 2009 +0000 +++ b/src/dupe.c Thu Mar 12 21:06:37 2009 +0000 @@ -91,7 +91,7 @@ */ -static void dupe_window_update_count(DupeWindow *dw, gint count_only) +static void dupe_window_update_count(DupeWindow *dw, gboolean count_only) { gchar *text; @@ -133,7 +133,7 @@ return (n * ((n + 1) / 2)); } -static void dupe_window_update_progress(DupeWindow *dw, const gchar *status, gdouble value, gint force) +static void dupe_window_update_progress(DupeWindow *dw, const gchar *status, gdouble value, gboolean force) { const gchar *status_text; @@ -681,13 +681,13 @@ return g_list_reverse(list); } -static gint dupe_listview_item_is_selected(DupeWindow *dw, DupeItem *di, GtkWidget *listview) +static gboolean dupe_listview_item_is_selected(DupeWindow *dw, DupeItem *di, GtkWidget *listview) { GtkTreeModel *store; GtkTreeSelection *selection; GList *slist; GList *work; - gint found = FALSE; + gboolean found = FALSE; selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(listview)); slist = gtk_tree_selection_get_selected_rows(selection, &store); @@ -788,7 +788,7 @@ dupe_match_unlink_child(b, a); } -static void dupe_match_link_clear(DupeItem *parent, gint unlink_children) +static void dupe_match_link_clear(DupeItem *parent, gboolean unlink_children) { GList *work; @@ -1112,7 +1112,7 @@ * ------------------------------------------------------------------ */ -static gint dupe_match(DupeItem *a, DupeItem *b, DupeMatchType mask, gdouble *rank, gint fast) +static gboolean dupe_match(DupeItem *a, DupeItem *b, DupeMatchType mask, gdouble *rank, gint fast) { *rank = 0.0; @@ -1420,7 +1420,7 @@ return NULL; } -static gint dupe_check_cb(gpointer data) +static gboolean dupe_check_cb(gpointer data) { DupeWindow *dw = data; @@ -1696,7 +1696,7 @@ dupe_window_update_count(dw, FALSE); } -static gint dupe_item_remove_by_path(DupeWindow *dw, const gchar *path) +static gboolean dupe_item_remove_by_path(DupeWindow *dw, const gchar *path) { DupeItem *di; @@ -1709,7 +1709,7 @@ } static void dupe_files_add(DupeWindow *dw, CollectionData *collection, CollectInfo *info, - FileData *fd, gint recurse) + FileData *fd, gboolean recurse) { DupeItem *di = NULL; @@ -1777,7 +1777,7 @@ dupe_check_start(dw); } -void dupe_window_add_files(DupeWindow *dw, GList *list, gint recurse) +void dupe_window_add_files(DupeWindow *dw, GList *list, gboolean recurse) { GList *work; @@ -2293,7 +2293,7 @@ return menu; } -static gint dupe_listview_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) +static gboolean dupe_listview_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) { DupeWindow *dw = data; GtkTreeModel *store; @@ -2376,7 +2376,7 @@ return FALSE; } -static gint dupe_listview_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) +static gboolean dupe_listview_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) { DupeWindow *dw = data; GtkTreeModel *store; @@ -2555,11 +2555,8 @@ static GtkWidget *dupe_menu_popup_second(DupeWindow *dw, DupeItem *di) { GtkWidget *menu; - gint notempty; - gint on_row; - - on_row = (di != NULL); - notempty = (dw->second_list != NULL); + gboolean notempty = (dw->second_list != NULL); + gboolean on_row = (di != NULL); menu = popup_menu_short_lived(); menu_item_add_sensitive(menu, _("_View"), on_row, @@ -2724,7 +2721,7 @@ "cell-background-set", set, NULL); } -static void dupe_listview_add_column(DupeWindow *dw, GtkWidget *listview, gint n, const gchar *title, gint image, gint right_justify) +static void dupe_listview_add_column(DupeWindow *dw, GtkWidget *listview, gint n, const gchar *title, gboolean image, gboolean right_justify) { GtkTreeViewColumn *column; GtkCellRenderer *renderer; @@ -2768,7 +2765,7 @@ gtk_tree_view_append_column(GTK_TREE_VIEW(listview), column); } -static void dupe_listview_set_height(GtkWidget *listview, gint thumb) +static void dupe_listview_set_height(GtkWidget *listview, gboolean thumb) { GtkTreeViewColumn *column; GtkCellRenderer *cell; @@ -2855,11 +2852,11 @@ *y = cy; } -static gint dupe_window_keypress_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) +static gboolean dupe_window_keypress_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) { DupeWindow *dw = data; - gint stop_signal = FALSE; - gint on_second; + gboolean stop_signal = FALSE; + gboolean on_second; GtkWidget *listview; GtkTreeModel *store; GtkTreeSelection *selection; @@ -3470,7 +3467,7 @@ } } -static void dupe_dest_set(GtkWidget *widget, gint enable) +static void dupe_dest_set(GtkWidget *widget, gboolean enable) { if (enable) {
--- a/src/dupe.h Wed Mar 11 23:36:01 2009 +0000 +++ b/src/dupe.h Thu Mar 12 21:06:37 2009 +0000 @@ -79,7 +79,7 @@ GtkWidget *extra_label; GtkWidget *button_thumbs; - gint show_thumbs; + gboolean show_thumbs; gint idle_id; GList *working; @@ -100,15 +100,15 @@ /* second set comparison stuff */ - gint second_set; /* second set enabled ? */ + gboolean second_set; /* second set enabled ? */ GList *second_list; /* second set dropped files */ - gint second_drop; /* drop is on second set */ + gboolean second_drop; /* drop is on second set */ GtkWidget *second_vbox; /* box of second widgets */ GtkWidget *second_listview; GtkWidget *second_status_label; - gint color_frozen; + gboolean color_frozen; /* file list for edit menu */ GList *editmenu_fd_list; @@ -122,7 +122,7 @@ void dupe_window_close(DupeWindow *dw); void dupe_window_add_collection(DupeWindow *dw, CollectionData *collection); -void dupe_window_add_files(DupeWindow *dw, GList *list, gint recurse); +void dupe_window_add_files(DupeWindow *dw, GList *list, gboolean recurse); /* cell max with/height hack utility */ void cell_renderer_height_override(GtkCellRenderer *renderer);
--- a/src/similar.c Wed Mar 11 23:36:01 2009 +0000 +++ b/src/similar.c Thu Mar 12 21:06:37 2009 +0000 @@ -44,14 +44,14 @@ * improve the result, and hopes to reduce false positives. */ -static gint alternate_enabled = FALSE; +static gboolean alternate_enabled = FALSE; -void image_sim_alternate_set(gint enable) +void image_sim_alternate_set(gboolean enable) { alternate_enabled = enable; } -gint image_sim_alternate_enabled(void) +gboolean image_sim_alternate_enabled(void) { return alternate_enabled; } @@ -183,8 +183,8 @@ gint x_inc, y_inc, xy_inc; gint xs, ys; - gint x_small = FALSE; /* if less than 32 w or h, set TRUE */ - gint y_small = FALSE; + gboolean x_small = FALSE; /* if less than 32 w or h, set TRUE */ + gboolean y_small = FALSE; if (!sd || !pixbuf) return;
--- a/src/similar.h Wed Mar 11 23:36:01 2009 +0000 +++ b/src/similar.h Thu Mar 12 21:06:37 2009 +0000 @@ -22,7 +22,7 @@ guint8 avg_g[1024]; guint8 avg_b[1024]; - gint filled; + gboolean filled; }; @@ -36,8 +36,8 @@ gdouble image_sim_compare_fast(ImageSimilarityData *a, ImageSimilarityData *b, gdouble min); -void image_sim_alternate_set(gint enable); -gint image_sim_alternate_enabled(void); +void image_sim_alternate_set(gboolean enable); +gboolean image_sim_alternate_enabled(void); void image_sim_alternate_processing(ImageSimilarityData *sd);