Skip to content

Commit

Permalink
More gboolean.
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurent Monin committed Mar 14, 2009
1 parent ccbfd10 commit 3707f26
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 64 deletions.
6 changes: 3 additions & 3 deletions src/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ gchar *sort_type_get_text(SortType method)

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;

Expand All @@ -175,8 +175,8 @@ static GtkWidget *submenu_add_sort_item(GtkWidget *menu, GtkWidget *parent,
}

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;
Expand Down
4 changes: 2 additions & 2 deletions src/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ GtkWidget *submenu_add_edit(GtkWidget *menu, GtkWidget **menu_item, GCallback fu

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);
Expand Down
17 changes: 9 additions & 8 deletions src/metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typedef enum {
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);


Expand Down Expand Up @@ -238,7 +238,7 @@ gboolean metadata_write_string(FileData *fd, const gchar *key, const char *value
*-------------------------------------------------------------------
*/

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);
Expand Down Expand Up @@ -268,12 +268,12 @@ static gint metadata_file_write(gchar *path, GHashTable *modified_xmp)
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);

Expand All @@ -286,7 +286,7 @@ static gint metadata_legacy_write(FileData *fd)
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];
Expand Down Expand Up @@ -404,11 +404,12 @@ static void metadata_legacy_delete(FileData *fd, const gchar *except)
}
}

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);
Expand Down
2 changes: 1 addition & 1 deletion src/pan-folder.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static void pan_flower_move(FlowerGroup *group, gint x, gint y)
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)
Expand Down
8 changes: 4 additions & 4 deletions src/pan-item.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ PanItem *pan_item_find_by_key(PanWindow *pw, PanItemType type, const gchar *key)
/* 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;

Expand All @@ -734,7 +734,7 @@ static GList *pan_item_find_by_path_l(GList *list, GList *search_list,
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)
{
Expand Down Expand Up @@ -777,7 +777,7 @@ static GList *pan_item_find_by_path_l(GList *list, GList *search_list,

/* 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;

Expand All @@ -791,7 +791,7 @@ GList *pan_item_find_by_path(PanWindow *pw, PanItemType type, const gchar *path,
}

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);
Expand Down
24 changes: 12 additions & 12 deletions src/pan-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ struct _PanItem {

gpointer data;

gint queued;
gboolean queued;
};

typedef struct _PanWindow PanWindow;
Expand Down Expand Up @@ -200,12 +200,12 @@ struct _PanWindow
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;
Expand Down Expand Up @@ -255,7 +255,7 @@ void pan_layout_resize(PanWindow *pw);

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);
Expand All @@ -270,9 +270,9 @@ void pan_item_size_coordinates(PanItem *pi, gint border, gint *w, gint *h);

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);

Expand Down Expand Up @@ -338,15 +338,15 @@ typedef enum {
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 */
Expand Down
12 changes: 6 additions & 6 deletions src/pan-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -134,11 +134,11 @@ time_t pan_date_to_time(gint year, gint month, gint day)
*-----------------------------------------------------------------------------
*/

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);

Expand Down Expand Up @@ -185,7 +185,7 @@ gint pan_is_link_loop(const gchar *s)
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;
Expand All @@ -208,8 +208,8 @@ gint pan_is_ignored(const gchar *s, gint ignore_symlinks)
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;
Expand Down
Loading

0 comments on commit 3707f26

Please sign in to comment.