# HG changeset patch # User zas_ # Date 1237061243 0 # Node ID b106af9689db174ed49f146bfa561eb7b3f88705 # Parent b4ad1d2012790523648638e8584015600357dc52 More gboolean. diff -r b4ad1d201279 -r b106af9689db src/menu.c --- a/src/menu.c Sat Mar 14 19:25:21 2009 +0000 +++ b/src/menu.c Sat Mar 14 20:07:23 2009 +0000 @@ -155,7 +155,7 @@ static GtkWidget *submenu_add_sort_item(GtkWidget *menu, GtkWidget *parent, GCallback func, SortType type, - gint show_current, SortType show_type) + gboolean show_current, SortType show_type) { GtkWidget *item; @@ -175,8 +175,8 @@ } GtkWidget *submenu_add_sort(GtkWidget *menu, GCallback func, gpointer data, - gint include_none, gint include_path, - gint show_current, SortType type) + gboolean include_none, gboolean include_path, + gboolean show_current, SortType type) { GtkWidget *submenu; GtkWidget *parent; diff -r b4ad1d201279 -r b106af9689db src/menu.h --- a/src/menu.h Sat Mar 14 19:25:21 2009 +0000 +++ b/src/menu.h Sat Mar 14 20:07:23 2009 +0000 @@ -21,8 +21,8 @@ gchar *sort_type_get_text(SortType method); GtkWidget *submenu_add_sort(GtkWidget *menu, GCallback func, gpointer data, - gint include_none, gint include_path, - gint show_current, SortType type); + gboolean include_none, gboolean include_path, + gboolean show_current, SortType type); gchar *alter_type_get_text(AlterType type); GtkWidget *submenu_add_alter(GtkWidget *menu, GCallback func, gpointer data); diff -r b4ad1d201279 -r b106af9689db src/metadata.c --- a/src/metadata.c Sat Mar 14 19:25:21 2009 +0000 +++ b/src/metadata.c Sat Mar 14 20:07:23 2009 +0000 @@ -35,7 +35,7 @@ static const gchar *group_keys[] = {KEYWORD_KEY, COMMENT_KEY, NULL}; /* tags that will be written to all files in a group */ static gboolean metadata_write_queue_idle_cb(gpointer data); -static gint metadata_legacy_write(FileData *fd); +static gboolean metadata_legacy_write(FileData *fd); static void metadata_legacy_delete(FileData *fd, const gchar *except); @@ -238,7 +238,7 @@ *------------------------------------------------------------------- */ -static gint metadata_file_write(gchar *path, GHashTable *modified_xmp) +static gboolean metadata_file_write(gchar *path, GHashTable *modified_xmp) { SecureSaveInfo *ssi; GList *keywords = g_hash_table_lookup(modified_xmp, KEYWORD_KEY); @@ -268,12 +268,12 @@ return (secure_close(ssi) == 0); } -static gint metadata_legacy_write(FileData *fd) +static gboolean metadata_legacy_write(FileData *fd) { - gint success = FALSE; + gboolean success = FALSE; + gchar *metadata_pathl; g_assert(fd->change && fd->change->dest); - gchar *metadata_pathl; DEBUG_1("Saving comment: %s", fd->change->dest); @@ -286,7 +286,7 @@ return success; } -static gint metadata_file_read(gchar *path, GList **keywords, gchar **comment) +static gboolean metadata_file_read(gchar *path, GList **keywords, gchar **comment) { FILE *f; gchar s_buf[1024]; @@ -404,11 +404,12 @@ } } -static gint metadata_legacy_read(FileData *fd, GList **keywords, gchar **comment) +static gboolean metadata_legacy_read(FileData *fd, GList **keywords, gchar **comment) { gchar *metadata_path; gchar *metadata_pathl; - gint success = FALSE; + gboolean success = FALSE; + if (!fd) return FALSE; metadata_path = cache_find_location(CACHE_TYPE_METADATA, fd->path); diff -r b4ad1d201279 -r b106af9689db src/pan-folder.c --- a/src/pan-folder.c Sat Mar 14 19:25:21 2009 +0000 +++ b/src/pan-folder.c Sat Mar 14 20:07:23 2009 +0000 @@ -109,7 +109,7 @@ group->y += y; } -#define PI 3.14159 +#define PI 3.14159265 static void pan_flower_position(FlowerGroup *group, FlowerGroup *parent, gint *result_x, gint *result_y) diff -r b4ad1d201279 -r b106af9689db src/pan-item.c --- a/src/pan-item.c Sat Mar 14 19:25:21 2009 +0000 +++ b/src/pan-item.c Sat Mar 14 20:07:23 2009 +0000 @@ -722,7 +722,7 @@ /* when ignore_case and partial are TRUE, path should be converted to lower case */ static GList *pan_item_find_by_path_l(GList *list, GList *search_list, PanItemType type, const gchar *path, - gint ignore_case, gint partial) + gboolean ignore_case, gboolean partial) { GList *work; @@ -734,7 +734,7 @@ pi = work->data; if ((pi->type == type || type == PAN_ITEM_NONE) && pi->fd) { - gint match = FALSE; + gboolean match = FALSE; if (path[0] == G_DIR_SEPARATOR) { @@ -777,7 +777,7 @@ /* when ignore_case and partial are TRUE, path should be converted to lower case */ GList *pan_item_find_by_path(PanWindow *pw, PanItemType type, const gchar *path, - gint ignore_case, gint partial) + gboolean ignore_case, gboolean partial) { GList *list = NULL; @@ -791,7 +791,7 @@ } GList *pan_item_find_by_fd(PanWindow *pw, PanItemType type, FileData *fd, - gint ignore_case, gint partial) + gboolean ignore_case, gboolean partial) { if (!fd) return NULL; return pan_item_find_by_path(pw, type, fd->path, ignore_case, partial); diff -r b4ad1d201279 -r b106af9689db src/pan-types.h --- a/src/pan-types.h Sat Mar 14 19:25:21 2009 +0000 +++ b/src/pan-types.h Sat Mar 14 20:07:23 2009 +0000 @@ -165,7 +165,7 @@ gpointer data; - gint queued; + gboolean queued; }; typedef struct _PanWindow PanWindow; @@ -200,12 +200,12 @@ gint thumb_size; gint thumb_gap; gint image_size; - gint exif_date_enable; + gboolean exif_date_enable; gint info_image_size; - gint info_includes_exif; + gboolean info_includes_exif; - gint ignore_symlinks; + gboolean ignore_symlinks; GList *list; GList *list_static; @@ -255,7 +255,7 @@ void pan_cache_sync_date(PanWindow *pw, GList *list); -GList *pan_cache_sort(GList *list, SortType method, gint ascend); +GList *pan_cache_sort(GList *list, SortType method, gboolean ascend); /* pan-item.c */ void pan_item_free(PanItem *pi); @@ -270,9 +270,9 @@ PanItem *pan_item_find_by_key(PanWindow *pw, PanItemType type, const gchar *key); GList *pan_item_find_by_path(PanWindow *pw, PanItemType type, const gchar *path, - gint ignore_case, gint partial); + gboolean ignore_case, gboolean partial); GList *pan_item_find_by_fd(PanWindow *pw, PanItemType type, FileData *fd, - gint ignore_case, gint partial); + gboolean ignore_case, gboolean partial); PanItem *pan_item_find_by_coord(PanWindow *pw, PanItemType type, gint x, gint y, const gchar *key); @@ -338,15 +338,15 @@ PAN_DATE_LENGTH_YEAR } PanDateLengthType; -gint pan_date_compare(time_t a, time_t b, PanDateLengthType length); +gboolean pan_date_compare(time_t a, time_t b, PanDateLengthType length); gint pan_date_value(time_t d, PanDateLengthType length); gchar *pan_date_value_string(time_t d, PanDateLengthType length); time_t pan_date_to_time(gint year, gint month, gint day); -gint pan_is_link_loop(const gchar *s); -gint pan_is_ignored(const gchar *s, gint ignore_symlinks); -GList *pan_list_tree(FileData *dir_fd, SortType sort, gint ascend, - gint ignore_symlinks); +gboolean pan_is_link_loop(const gchar *s); +gboolean pan_is_ignored(const gchar *s, gboolean ignore_symlinks); +GList *pan_list_tree(FileData *dir_fd, SortType sort, gboolean ascend, + gboolean ignore_symlinks); /* the different view types */ diff -r b4ad1d201279 -r b106af9689db src/pan-util.c --- a/src/pan-util.c Sat Mar 14 19:25:21 2009 +0000 +++ b/src/pan-util.c Sat Mar 14 20:07:23 2009 +0000 @@ -22,7 +22,7 @@ *----------------------------------------------------------------------------- */ -gint pan_date_compare(time_t a, time_t b, PanDateLengthType length) +gboolean pan_date_compare(time_t a, time_t b, PanDateLengthType length) { struct tm ta; struct tm tb; @@ -134,11 +134,11 @@ *----------------------------------------------------------------------------- */ -gint pan_is_link_loop(const gchar *s) +gboolean pan_is_link_loop(const gchar *s) { gchar *sl; struct stat st; - gint ret = FALSE; + gboolean ret = FALSE; sl = path_from_utf8(s); @@ -185,7 +185,7 @@ return ret; } -gint pan_is_ignored(const gchar *s, gint ignore_symlinks) +gboolean pan_is_ignored(const gchar *s, gboolean ignore_symlinks) { struct stat st; const gchar *n; @@ -208,8 +208,8 @@ return FALSE; } -GList *pan_list_tree(FileData *dir_fd, SortType sort, gint ascend, - gint ignore_symlinks) +GList *pan_list_tree(FileData *dir_fd, SortType sort, gboolean ascend, + gboolean ignore_symlinks) { GList *flist; GList *dlist; diff -r b4ad1d201279 -r b106af9689db src/pan-view.c --- a/src/pan-view.c Sat Mar 14 19:25:21 2009 +0000 +++ b/src/pan-view.c Sat Mar 14 20:07:23 2009 +0000 @@ -60,9 +60,9 @@ static void pan_layout_update_idle(PanWindow *pw); -static void pan_fullscreen_toggle(PanWindow *pw, gint force_off); - -static void pan_search_toggle_visible(PanWindow *pw, gint enable); +static void pan_fullscreen_toggle(PanWindow *pw, gboolean force_off); + +static void pan_search_toggle_visible(PanWindow *pw, gboolean enable); static void pan_search_activate(PanWindow *pw); static void pan_window_close(PanWindow *pw); @@ -78,7 +78,7 @@ *----------------------------------------------------------------------------- */ -static gint pan_queue_step(PanWindow *pw); +static gboolean pan_queue_step(PanWindow *pw); static void pan_queue_thumb_done_cb(ThumbLoader *tl, gpointer data) @@ -176,7 +176,7 @@ } #endif -static gint pan_queue_step(PanWindow *pw) +static gboolean pan_queue_step(PanWindow *pw) { PanItem *pi; @@ -269,8 +269,8 @@ *----------------------------------------------------------------------------- */ -static gint pan_window_request_tile_cb(PixbufRenderer *pr, gint x, gint y, - gint width, gint height, GdkPixbuf *pixbuf, gpointer data) +static gboolean pan_window_request_tile_cb(PixbufRenderer *pr, gint x, gint y, + gint width, gint height, GdkPixbuf *pixbuf, gpointer data) { PanWindow *pw = data; GList *list; @@ -313,7 +313,7 @@ while (work) { PanItem *pi; - gint queue = FALSE; + gboolean queue = FALSE; pi = work->data; work = work->next; @@ -531,7 +531,7 @@ PanCacheData *pcb = b; return filelist_sort_compare_filedata(pca->fd, pcb->fd); } -GList *pan_cache_sort(GList *list, SortType method, gint ascend) +GList *pan_cache_sort(GList *list, SortType method, gboolean ascend) { return filelist_sort_full(list, method, ascend, (GCompareFunc) pan_cache_sort_file_cb); } @@ -602,7 +602,7 @@ pan_layout_update_idle(pw); } -static gint pan_cache_step(PanWindow *pw) +static gboolean pan_cache_step(PanWindow *pw) { FileData *fd; PanCacheData *pc; @@ -1197,12 +1197,12 @@ popup_menu_position_clamp(menu, x, y, 0); } -static gint pan_window_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) +static gboolean pan_window_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) { PanWindow *pw = data; PixbufRenderer *pr; FileData *fd; - gint stop_signal = FALSE; + gboolean stop_signal = FALSE; GtkWidget *menu; gint x = 0; gint y = 0; @@ -1658,7 +1658,7 @@ return TRUE; } -static gint pan_search_by_partial(PanWindow *pw, const gchar *text) +static gboolean pan_search_by_partial(PanWindow *pw, const gchar *text) { PanItem *pi; GList *list; @@ -1706,7 +1706,7 @@ return TRUE; } -static gint valid_date_separator(gchar c) +static gboolean valid_date_separator(gchar c) { return (c == '/' || c == '-' || c == ' ' || c == '.' || c == ','); } @@ -1748,7 +1748,7 @@ return g_list_reverse(list); } -static gint pan_search_by_date(PanWindow *pw, const gchar *text) +static gboolean pan_search_by_date(PanWindow *pw, const gchar *text) { PanItem *pi = NULL; GList *list = NULL; @@ -1961,7 +1961,7 @@ static void pan_search_toggle_cb(GtkWidget *button, gpointer data) { PanWindow *pw = data; - gint visible; + gboolean visible; visible = GTK_WIDGET_VISIBLE(pw->search_box); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)) == visible) return; @@ -1979,7 +1979,7 @@ } } -static void pan_search_toggle_visible(PanWindow *pw, gint enable) +static void pan_search_toggle_visible(PanWindow *pw, gboolean enable) { if (pw->fs) return; @@ -2131,7 +2131,7 @@ pw->imd = pw->imd_normal; } -static void pan_fullscreen_toggle(PanWindow *pw, gint force_off) +static void pan_fullscreen_toggle(PanWindow *pw, gboolean force_off) { if (force_off && !pw->fs) return; @@ -2317,7 +2317,7 @@ g_free(pw); } -static gint pan_window_delete_cb(GtkWidget *w, GdkEventAny *event, gpointer data) +static gboolean pan_window_delete_cb(GtkWidget *w, GdkEventAny *event, gpointer data) { PanWindow *pw = data; @@ -2553,20 +2553,20 @@ static void pan_warning_hide_cb(GtkWidget *button, gpointer data) { - gint hide_dlg; + gboolean hide_dlg; hide_dlg = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)); pref_list_int_set(PAN_PREF_GROUP, PAN_PREF_HIDE_WARNING, hide_dlg); } -static gint pan_warning(FileData *dir_fd) +static gboolean pan_warning(FileData *dir_fd) { GenericDialog *gd; GtkWidget *box; GtkWidget *group; GtkWidget *button; GtkWidget *ct_button; - gint hide_dlg; + gboolean hide_dlg; if (dir_fd && strcmp(dir_fd->path, G_DIR_SEPARATOR_S) == 0) { @@ -2796,7 +2796,7 @@ GtkWidget *menu; GtkWidget *submenu; GtkWidget *item; - gint active; + gboolean active; active = (pw->click_pi != NULL); @@ -2932,7 +2932,7 @@ { gchar *text = NULL; gint len; - gint plain_text; + gboolean plain_text; GList *list; switch (info) @@ -2982,9 +2982,4 @@ G_CALLBACK(pan_window_get_dnd_data), pw); } -/* - *----------------------------------------------------------------------------- - * maintenance (for rename, move, remove) - *----------------------------------------------------------------------------- - */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */