* while closing file releases file descriptor we need to call fsync(). */
#if defined(HAVE_FFLUSH) || defined(HAVE_FSYNC)
if (ssi->secure_save) {
- gint fail = 0;
+ gboolean fail = FALSE;
#ifdef HAVE_FFLUSH
fail = (fflush(ssi->fp) == EOF);
gint w, h;
gint rs;
guchar *pix;
- gint has_alpha;
+ gboolean has_alpha;
gint p_step;
guchar *p;
}
}
-gint slideshow_should_continue(SlideShowData *ss)
+gboolean slideshow_should_continue(SlideShowData *ss)
{
FileData *imd_fd;
FileData *dir_fd;
return FALSE;
}
-static gint slideshow_step(SlideShowData *ss, gboolean forward)
+static gboolean slideshow_step(SlideShowData *ss, gboolean forward)
{
gint row;
return TRUE;
}
-static gint slideshow_loop_cb(gpointer data)
+static gboolean slideshow_loop_cb(gpointer data)
{
SlideShowData *ss = data;
void slideshow_free(SlideShowData *ss);
-gint slideshow_should_continue(SlideShowData *ss);
+gboolean slideshow_should_continue(SlideShowData *ss);
void slideshow_next(SlideShowData *ss);
void slideshow_prev(SlideShowData *ss);
if (tl->func_error) tl->func_error(tl, tl->data);
}
-static gint thumb_loader_done_delay_cb(gpointer data)
+static gboolean thumb_loader_done_delay_cb(gpointer data)
{
ThumbLoader *tl = data;
tl->data = data;
}
-void thumb_loader_set_cache(ThumbLoader *tl, gint enable_cache, gint local, gint retry_failed)
+void thumb_loader_set_cache(ThumbLoader *tl, gboolean enable_cache, gboolean local, gboolean retry_failed)
{
if (!tl) return;
}
-gint thumb_loader_start(ThumbLoader *tl, FileData *fd)
+gboolean thumb_loader_start(ThumbLoader *tl, FileData *fd)
{
gchar *cache_path = NULL;
ThumbLoaderFunc func_error,
ThumbLoaderFunc func_progress,
gpointer data);
-void thumb_loader_set_cache(ThumbLoader *tl, gint enable_cache, gint local, gint retry_failed);
+void thumb_loader_set_cache(ThumbLoader *tl, gboolean enable_cache, gboolean local, gboolean retry_failed);
-gint thumb_loader_start(ThumbLoader *tl, FileData *fd);
+gboolean thumb_loader_start(ThumbLoader *tl, FileData *fd);
void thumb_loader_free(ThumbLoader *tl);
GdkPixbuf *thumb_loader_get_pixbuf(ThumbLoader *tl);
tl->progress = 0.0;
}
-static gchar *thumb_std_cache_path(const gchar *path, const gchar *uri, gint local,
+static gchar *thumb_std_cache_path(const gchar *path, const gchar *uri, gboolean local,
const gchar *cache_subfolder)
{
gchar *result = NULL;
return result;
}
-static gchar *thumb_loader_std_cache_path(ThumbLoaderStd *tl, gint local, GdkPixbuf *pixbuf, gint fail)
+static gchar *thumb_loader_std_cache_path(ThumbLoaderStd *tl, gboolean local, GdkPixbuf *pixbuf, gboolean fail)
{
const gchar *folder;
gint w, h;
local, folder);
}
-static gint thumb_loader_std_fail_check(ThumbLoaderStd *tl)
+static gboolean thumb_loader_std_fail_check(ThumbLoaderStd *tl)
{
gchar *fail_path;
gboolean result = FALSE;
return result;
}
-static gint thumb_loader_std_validate(ThumbLoaderStd *tl, GdkPixbuf *pixbuf)
+static gboolean thumb_loader_std_validate(ThumbLoaderStd *tl, GdkPixbuf *pixbuf)
{
const gchar *valid_uri;
const gchar *uri;
{
gchar *base_path;
gchar *tmp_path;
- gint fail;
+ gboolean fail;
if (!tl->cache_enable || tl->cache_hit) return;
if (tl->thumb_path) return;
gchar *mark_app;
gchar *mark_mtime;
gchar *pathl;
- gint success;
+ gboolean success;
mark_uri = (tl->cache_local) ? tl->local_uri :tl->thumb_uri;
tl->fd->thumb_pixbuf = pixbuf_fallback(tl->fd, tl->requested_width, tl->requested_height);
}
-static GdkPixbuf *thumb_loader_std_finish(ThumbLoaderStd *tl, GdkPixbuf *pixbuf, gint shrunk)
+static GdkPixbuf *thumb_loader_std_finish(ThumbLoaderStd *tl, GdkPixbuf *pixbuf, gboolean shrunk)
{
GdkPixbuf *pixbuf_thumb = NULL;
GdkPixbuf *result;
return result;
}
-static gint thumb_loader_std_next_source(ThumbLoaderStd *tl, gint remove_broken)
+static gboolean thumb_loader_std_next_source(ThumbLoaderStd *tl, gboolean remove_broken)
{
image_loader_free(tl->il);
tl->il = NULL;
if (tl->func_progress) tl->func_progress(tl, tl->data);
}
-static gint thumb_loader_std_setup(ThumbLoaderStd *tl, FileData *fd)
+static gboolean thumb_loader_std_setup(ThumbLoaderStd *tl, FileData *fd)
{
tl->il = image_loader_new(fd);
image_loader_set_priority(tl->il, G_PRIORITY_LOW);
return FALSE;
}
-static gint thumb_loader_std_setup_path(ThumbLoaderStd *tl, const gchar *path)
+static gboolean thumb_loader_std_setup_path(ThumbLoaderStd *tl, const gchar *path)
{
FileData *fd = file_data_new_simple(path);
- gint ret = thumb_loader_std_setup(tl, fd);
+ gboolean ret = thumb_loader_std_setup(tl, fd);
file_data_unref(fd);
return ret;
}
* Note: Currently local_cache only specifies where to save a _new_ thumb, if
* a valid existing thumb is found anywhere the local thumb will not be created.
*/
-void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gint enable_cache, gint local, gint retry_failed)
+void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gboolean enable_cache, gboolean local, gboolean retry_failed)
{
if (!tl) return;
tl->cache_retry = retry_failed;
}
-gint thumb_loader_std_start(ThumbLoaderStd *tl, FileData *fd)
+gboolean thumb_loader_std_start(ThumbLoaderStd *tl, FileData *fd)
{
static gchar *thumb_cache = NULL;
struct stat st;
gchar *path;
gint days;
- void (*func_valid)(const gchar *path, gint valid, gpointer data);
+ void (*func_valid)(const gchar *path, gboolean valid, gpointer data);
gpointer data;
gint idle_id;
thumb_loader_std_thumb_file_validate_free(tv);
}
-static void thumb_loader_std_thumb_file_validate_finish(ThumbValidate *tv, gint valid)
+static void thumb_loader_std_thumb_file_validate_finish(ThumbValidate *tv, gboolean valid)
{
if (tv->func_valid) tv->func_valid(tv->path, valid, tv->data);
thumb_loader_std_thumb_file_validate_finish(tv, FALSE);
}
-static gint thumb_loader_std_thumb_file_validate_idle_cb(gpointer data)
+static gboolean thumb_loader_std_thumb_file_validate_idle_cb(gpointer data)
{
ThumbValidate *tv = data;
}
ThumbLoaderStd *thumb_loader_std_thumb_file_validate(const gchar *thumb_path, gint allowed_days,
- void (*func_valid)(const gchar *path, gint valid, gpointer data),
+ void (*func_valid)(const gchar *path, gboolean valid, gpointer data),
gpointer data)
{
ThumbValidate *tv;
return tv->tl;
}
-static void thumb_std_maint_remove_one(const gchar *source, const gchar *uri, gint local,
+static void thumb_std_maint_remove_one(const gchar *source, const gchar *uri, gboolean local,
const gchar *subfolder)
{
gchar *thumb_path;
static void thumb_std_maint_move_step(TMaintMove *tm);
-static gint thumb_std_maint_move_idle(gpointer data);
+static gboolean thumb_std_maint_move_idle(gpointer data);
-static void thumb_std_maint_move_validate_cb(const gchar *path, gint valid, gpointer data)
+static void thumb_std_maint_move_validate_cb(const gchar *path, gboolean valid, gpointer data)
{
TMaintMove *tm = data;
GdkPixbuf *pixbuf;
thumb_std_maint_move_validate_cb, tm);
}
-static gint thumb_std_maint_move_idle(gpointer data)
+static gboolean thumb_std_maint_move_idle(gpointer data)
{
TMaintMove *tm;
gchar *pathl;
struct _ThumbLoaderStd
{
- gint standard_loader;
+ gboolean standard_loader;
ImageLoader *il;
FileData *fd;
gchar *thumb_uri;
const gchar *local_uri;
- gint thumb_path_local;
+ gboolean thumb_path_local;
gint requested_width;
gint requested_height;
- gint cache_enable;
- gint cache_local;
- gint cache_hit;
- gint cache_retry;
+ gboolean cache_enable;
+ gboolean cache_local;
+ gboolean cache_hit;
+ gboolean cache_retry;
gdouble progress;
ThumbLoaderStdFunc func_error,
ThumbLoaderStdFunc func_progress,
gpointer data);
-void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gint enable_cache, gint local, gint retry_failed);
-gint thumb_loader_std_start(ThumbLoaderStd *tl, FileData *fd);
+void thumb_loader_std_set_cache(ThumbLoaderStd *tl, gboolean enable_cache, gboolean local, gboolean retry_failed);
+gboolean thumb_loader_std_start(ThumbLoaderStd *tl, FileData *fd);
void thumb_loader_std_free(ThumbLoaderStd *tl);
GdkPixbuf *thumb_loader_std_get_pixbuf(ThumbLoaderStd *tl);
* for thumbnail's without a file: uri, validates against allowed_age in days
*/
ThumbLoaderStd *thumb_loader_std_thumb_file_validate(const gchar *thumb_path, gint allowed_age,
- void (*func_valid)(const gchar *path, gint valid, gpointer data),
+ void (*func_valid)(const gchar *path, gboolean valid, gpointer data),
gpointer data);
void thumb_loader_std_thumb_file_validate_cancel(ThumbLoaderStd *tl);
*gd = NULL;
}
-gint file_util_safe_unlink(const gchar *path)
+gboolean file_util_safe_unlink(const gchar *path)
{
static GenericDialog *gd = NULL;
gchar *result = NULL;
#include "ui_utildlg.h"
void file_util_trash_clear(void);
-gint file_util_safe_unlink(const gchar *path);
+gboolean file_util_safe_unlink(const gchar *path);
gchar *file_util_safe_delete_status(void);
#endif /* TRASH_H */
struct _ThumbLoader
{
- gint standard_loader;
+ gboolean standard_loader;
ImageLoader *il;
FileData *fd; /* fd->pixbuf contains final (scaled) image when done */
- gint cache_enable;
- gint cache_hit;
+ gboolean cache_enable;
+ gboolean cache_hit;
gdouble percent_done;
gint max_w;
gint window_h;
/* contents changed since save flag */
- gint changed;
+ gboolean changed;
GHashTable *existence;
};
gint sync_idle_id;
gint drop_idle_id;
- gint show_text;
+ gboolean show_text;
/* file list for edit menu */
GList *editmenu_fd_list;
gchar *file_name; /**< final file name */
gchar *tmp_file_name; /**< temporary file name */
gint err; /**< set to non-zero value in case of error */
- gint secure_save; /**< use secure save for this file, internal use only */
- gint preserve_perms; /**< whether to preserve perms, TRUE by default */
- gint preserve_mtime; /**< whether to preserve mtime, FALSE by default */
- gint unlink_on_error; /**< whether to remove temporary file on save failure, TRUE by default */
+ gboolean secure_save; /**< use secure save for this file, internal use only */
+ gboolean preserve_perms; /**< whether to preserve perms, TRUE by default */
+ gboolean preserve_mtime; /**< whether to preserve mtime, FALSE by default */
+ gboolean unlink_on_error; /**< whether to remove temporary file on save failure, TRUE by default */
};
struct _CommandLine
void (*select_func)(const gchar *path, gpointer data);
gpointer select_data;
- gint no_defaults;
- gint editable;
- gint only_directories;
+ gboolean no_defaults;
+ gboolean editable;
+ gboolean only_directories;
BookButtonData *active_button;
};
}
static void bookmark_menu_popup(BookMarkData *bm, GtkWidget *button,
- gint button_n, guint32 time, gint local)
+ gint button_n, guint32 time, gboolean local)
{
GtkWidget *menu;
BookButtonData *b;
}
}
-static gint bookmark_press_cb(GtkWidget *button, GdkEventButton *event, gpointer data)
+static gboolean bookmark_press_cb(GtkWidget *button, GdkEventButton *event, gpointer data)
{
BookMarkData *bm = data;
return TRUE;
}
-static gint bookmark_keypress_cb(GtkWidget *button, GdkEventKey *event, gpointer data)
+static gboolean bookmark_keypress_cb(GtkWidget *button, GdkEventKey *event, gpointer data)
{
BookMarkData *bm = data;
bookmark_populate(bm);
}
-void bookmark_list_set_no_defaults(GtkWidget *list, gint no_defaults)
+void bookmark_list_set_no_defaults(GtkWidget *list, gboolean no_defaults)
{
BookMarkData *bm;
bm->no_defaults = no_defaults;
}
-void bookmark_list_set_editable(GtkWidget *list, gint editable)
+void bookmark_list_set_editable(GtkWidget *list, gboolean editable)
{
BookMarkData *bm;
bm->editable = editable;
}
-void bookmark_list_set_only_directories(GtkWidget *list, gint only_directories)
+void bookmark_list_set_only_directories(GtkWidget *list, gboolean only_directories)
{
BookMarkData *bm;