static void gqv_cell_renderer_icon_init_wrapper(void *, void *);
static void gqv_cell_renderer_icon_init(GQvCellRendererIcon *celltext);
static void gqv_cell_renderer_icon_class_init_wrapper(void *, void *);
-static void gqv_cell_renderer_icon_class_init(GQvCellRendererIconClass *class);
+static void gqv_cell_renderer_icon_class_init(GQvCellRendererIconClass *icon_class);
static void gqv_cell_renderer_icon_finalize(GObject *object);
static void gqv_cell_renderer_icon_get_size(GtkCellRenderer *cell,
GtkWidget *widget,
}
static void
-gqv_cell_renderer_icon_class_init(GQvCellRendererIconClass *class)
+gqv_cell_renderer_icon_class_init(GQvCellRendererIconClass *icon_class)
{
- GObjectClass *object_class = G_OBJECT_CLASS(class);
- GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS(class);
+ GObjectClass *object_class = G_OBJECT_CLASS(icon_class);
+ GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS(icon_class);
- parent_class = g_type_class_peek_parent(class);
+ parent_class = g_type_class_peek_parent(icon_class);
object_class->finalize = gqv_cell_renderer_icon_finalize;
}
}
-static void dupe_match_reparent(DupeWindow *dw, DupeItem *old, DupeItem *new)
+static void dupe_match_reparent(DupeWindow *dw, DupeItem *old_parent, DupeItem *new_parent)
{
GList *work;
- if (!old || !new || !dupe_match_link_exists(old, new)) return;
+ if (!old_parent || !new_parent || !dupe_match_link_exists(old_parent, new_parent)) return;
- dupe_match_link_clear(new, TRUE);
- work = old->group;
+ dupe_match_link_clear(new_parent, TRUE);
+ work = old_parent->group;
while (work)
{
DupeMatch *dm = work->data;
- dupe_match_unlink_child(old, dm->di);
- dupe_match_link_child(new, dm->di, dm->rank);
+ dupe_match_unlink_child(old_parent, dm->di);
+ dupe_match_link_child(new_parent, dm->di, dm->rank);
work = work->next;
}
- new->group = old->group;
- old->group = NULL;
+ new_parent->group = old_parent->group;
+ old_parent->group = NULL;
- work = g_list_find(dw->dupes, old);
- if (work) work->data = new;
+ work = g_list_find(dw->dupes, old_parent);
+ if (work) work->data = new_parent;
}
static void dupe_match_print_group(DupeItem *di)
static void image_loader_init(GTypeInstance *instance, gpointer g_class);
static void image_loader_class_init_wrapper(void *data, void *user_data);
-static void image_loader_class_init(ImageLoaderClass *class);
+static void image_loader_class_init(ImageLoaderClass *loader_class);
static void image_loader_finalize(GObject *object);
static void image_loader_stop(ImageLoader *il);
image_loader_class_init(data);
}
-static void image_loader_class_init(ImageLoaderClass *class)
+static void image_loader_class_init(ImageLoaderClass *loader_class)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (loader_class);
// gobject_class->set_property = image_loader_set_property;
// gobject_class->get_property = image_loader_get_property;
if (cd && info)
{
- CollectInfo *new;
- new = collection_get_first(cd);
- if (new != info) layout_image_set_collection_real(lw, cd, new, TRUE);
+ CollectInfo *first_collection;
+ first_collection = collection_get_first(cd);
+ if (first_collection != info)
+ {
+ layout_image_set_collection_real(lw, cd, first_collection, TRUE);
+ }
return;
}
if (cd && info)
{
- CollectInfo *new;
- new = collection_get_last(cd);
- if (new != info) layout_image_set_collection_real(lw, cd, new, FALSE);
+ CollectInfo *last_collection;
+ last_collection = collection_get_last(cd);
+ if (last_collection != info)
+ {
+ layout_image_set_collection_real(lw, cd, last_collection, FALSE);
+ }
return;
}
cd = image_get_collection(lw->image, &info);
if (cd && info)
{
- CollectInfo *new;
+ CollectInfo *next_collection;
- new = collection_next_by_info(cd, info);
- if (!new) new = collection_prev_by_info(cd, info);
+ next_collection = collection_next_by_info(cd, info);
+ if (!next_collection) next_collection = collection_prev_by_info(cd, info);
- if (new)
+ if (next_collection)
{
- layout_image_set_collection(lw, cd, new);
+ layout_image_set_collection(lw, cd, next_collection);
return;
}
layout_image_set_fd(lw, NULL);
guint pos, prev;
gboolean want_separator = FALSE;
gchar *name, *data;
- GString *new;
+ GString *osd_info;
gchar *ret;
if (!str || !*str) return g_strdup("");
- new = g_string_new(str);
+ osd_info = g_string_new(str);
prev = -1;
gchar *extrapos = NULL;
gchar *p;
- start = strchr(new->str + (prev + 1), delim);
+ start = strchr(osd_info->str + (prev + 1), delim);
if (!start)
break;
end = strchr(start+1, delim);
extra = g_strndup(extrapos, end - extrapos);
name = g_strndup(start+1, (trunc ? trunc : end)-start-1);
- pos = start - new->str;
+ pos = start - osd_info->str;
data = NULL;
if (strcmp(name, "keywords") == 0)
g_free(extra);
}
- g_string_erase(new, pos, end-start+1);
+ g_string_erase(osd_info, pos, end-start+1);
if (data && *data)
{
if (want_separator)
{
/* insert separator */
- g_string_insert(new, pos, sep);
+ g_string_insert(osd_info, pos, sep);
pos += strlen(sep);
want_separator = FALSE;
}
- g_string_insert(new, pos, data);
+ g_string_insert(osd_info, pos, data);
pos += strlen(data);
}
- if (pos-prev >= 1 && new->str[pos] == imp)
+ if (pos-prev >= 1 && osd_info->str[pos] == imp)
{
/* pipe character is replaced by a separator, delete it
* and raise a flag if needed */
- g_string_erase(new, pos--, 1);
+ g_string_erase(osd_info, pos--, 1);
want_separator |= (data && *data);
}
- if (new->str[pos] == '\n') want_separator = FALSE;
+ if (osd_info->str[pos] == '\n') want_separator = FALSE;
prev = pos - 1;
}
/* search and destroy empty lines */
- end = new->str;
+ end = osd_info->str;
while ((start = strchr(end, '\n')))
{
end = start;
while (*++(end) == '\n')
;
- g_string_erase(new, start-new->str, end-start-1);
+ g_string_erase(osd_info, start-osd_info->str, end-start-1);
}
- g_strchomp(new->str);
+ g_strchomp(osd_info->str);
- ret = new->str;
- g_string_free(new, FALSE);
+ ret = osd_info->str;
+ g_string_free(osd_info, FALSE);
return ret;
}
-static void pixbuf_renderer_class_init(PixbufRendererClass *class);
+static void pixbuf_renderer_class_init(PixbufRendererClass *renderer_class);
static void pixbuf_renderer_init(PixbufRenderer *pr);
static void pixbuf_renderer_finalize(GObject *object);
static void pixbuf_renderer_set_property(GObject *object, guint prop_id,
return pixbuf_renderer_type;
}
-static void pixbuf_renderer_class_init(PixbufRendererClass *class)
+static void pixbuf_renderer_class_init(PixbufRendererClass *renderer_class)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS(class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS(renderer_class);
- parent_class = g_type_class_peek_parent(class);
+ parent_class = g_type_class_peek_parent(renderer_class);
gobject_class->set_property = pixbuf_renderer_set_property;
gobject_class->get_property = pixbuf_renderer_get_property;
gint w, h;
gdouble scale;
gboolean force = !!(flags & PR_ZOOM_FORCE);
- gboolean new = !!(flags & PR_ZOOM_NEW);
+ gboolean new_z = !!(flags & PR_ZOOM_NEW);
zoom = CLAMP(zoom, pr->zoom_min, pr->zoom_max);
gint max_h;
gboolean sizeable;
- sizeable = (new && pr_parent_window_sizable(pr));
+ sizeable = (new_z && pr_parent_window_sizable(pr));
if (sizeable)
{
gint old_cx, old_cy;
gboolean center_point = !!(flags & PR_ZOOM_CENTER);
gboolean force = !!(flags & PR_ZOOM_FORCE);
- gboolean new = !!(flags & PR_ZOOM_NEW);
+ gboolean new_z = !!(flags & PR_ZOOM_NEW);
gboolean lazy = !!(flags & PR_ZOOM_LAZY);
PrZoomFlags clamp_flags = flags;
gdouble old_center_x = pr->norm_center_x;
(void) pr_size_clamp(pr);
(void) pr_parent_window_resize(pr, pr->width, pr->height);
- if (force && new)
+ if (force && new_z)
{
switch (pr->scroll_reset)
{
static void get_filelist(const gchar *text, GIOChannel *channel, gboolean recurse)
{
GList *list = NULL;
- FileFormatClass class;
+ FileFormatClass format_class;
FileData *dir_fd;
FileData *fd;
GString *out_string = g_string_new(NULL);
{
fd = work->data;
g_string_append_printf(out_string, "%s", fd->path);
- class = filter_file_get_class(fd->path);
+ format_class = filter_file_get_class(fd->path);
- switch (class)
+ switch (format_class)
{
case FORMAT_CLASS_IMAGE:
out_string = g_string_append(out_string, " Class: Image");
static void gr_list_add(const gchar *text, GIOChannel *UNUSED(channel), gpointer data)
{
RemoteData *remote_data = data;
- gboolean new = TRUE;
+ gboolean is_new = TRUE;
gchar *path = NULL;
FileData *fd;
FileData *first;
}
else if (!remote_data->single_dir)
{
- new = (!collection_get_first(remote_data->command_collection));
+ is_new = (!collection_get_first(remote_data->command_collection));
}
if (!remote_data->single_dir)
{
layout_image_set_collection(lw_id, remote_data->command_collection, collection_get_first(remote_data->command_collection));
- if (collection_add(remote_data->command_collection, file_data_new_group(text), FALSE) && new)
+ if (collection_add(remote_data->command_collection, file_data_new_group(text), FALSE) && is_new)
{
layout_image_set_collection(lw_id, remote_data->command_collection, collection_get_first(remote_data->command_collection));
}
{
tested = TRUE;
match = FALSE;
- FileFormatClass class;
+ FileFormatClass format_class;
FileFormatClass search_class;
if (g_strcmp0(gtk_combo_box_text_get_active_text(
if (search_class != FORMAT_CLASS_BROKEN)
{
- class = fd->format_class;
+ format_class = fd->format_class;
if (sd->match_class == SEARCH_MATCH_EQUAL)
{
- match = (class == search_class);
+ match = (format_class == search_class);
}
else if (sd->match_class == SEARCH_MATCH_NONE)
{
- match = (class != search_class);
+ match = (format_class != search_class);
}
}
else
const gchar *name;
gchar *path;
const gchar *icon;
- gchar *new;
+ gchar *new_string;
name = gtk_entry_get_text(GTK_ENTRY(p->name_entry));
path = remove_trailing_slash(gtk_entry_get_text(GTK_ENTRY(p->path_entry)));
icon = gtk_entry_get_text(GTK_ENTRY(p->icon_entry));
- new = bookmark_string(name, path, icon);
+ new_string = bookmark_string(name, path, icon);
if (p->bb->key)
{
- history_list_item_change(p->bb->parent, p->bb->key, new);
+ history_list_item_change(p->bb->parent, p->bb->key, new_string);
}
else
{
- history_list_add_to_key(p->bb->parent, new, 0);
+ history_list_add_to_key(p->bb->parent, new_string, 0);
}
if (path && strlen(path) > 0) tab_completion_append_to_history(p->path_entry, path);
if (icon && strlen(icon) > 0) tab_completion_append_to_history(p->icon_entry, icon);
g_free(path);
- g_free(new);
+ g_free(new_string);
bookmark_populate_all(p->bb->parent);
}
dd->right_click_path = gtk_tree_model_get_path(model, &iter);
}
-static gint dest_view_rename_cb(TreeEditData *ted, const gchar *old, const gchar *new, gpointer data)
+static gint dest_view_rename_cb(TreeEditData *ted, const gchar *old_name, const gchar *new_name, gpointer data)
{
Dest_Data *dd = data;
GtkTreeModel *model;
if (!old_path) return FALSE;
buf = remove_level_from_path(old_path);
- new_path = g_build_filename(buf, new, NULL);
+ new_path = g_build_filename(buf, new_name, NULL);
g_free(buf);
if (isname(new_path))
{
- buf = g_strdup_printf(_("A file with name %s already exists."), new);
+ buf = g_strdup_printf(_("A file with name %s already exists."), new_name);
warning_dialog(_("Rename failed"), buf, GTK_STOCK_DIALOG_INFO, dd->entry);
g_free(buf);
}
else if (!rename_file(old_path, new_path))
{
- buf = g_strdup_printf(_("Failed to rename %s to %s."), old, new);
+ buf = g_strdup_printf(_("Failed to rename %s to %s."), old_name, new_name);
warning_dialog(_("Rename failed"), buf, GTK_STOCK_DIALOG_ERROR, dd->entry);
g_free(buf);
}
{
const gchar *text;
- gtk_list_store_set(GTK_LIST_STORE(model), &iter, 0, new, 1, new_path, -1);
+ gtk_list_store_set(GTK_LIST_STORE(model), &iter, 0, new_name, 1, new_path, -1);
text = gtk_entry_get_text(GTK_ENTRY(dd->entry));
if (text && old_path && strcmp(text, old_path) == 0)
void file_util_copy_path_list_to_clipboard(GList *list, gboolean quoted)
{
GList *work;
- GString *new;
+ GString *path_list_str;
- new = g_string_new("");
+ path_list_str = g_string_new("");
work = list;
while (work) {
FileData *fd = work->data;
if (quoted)
{
- g_string_append(new, g_shell_quote(fd->path));
+ g_string_append(path_list_str, g_shell_quote(fd->path));
}
else
{
- g_string_append(new, fd->path);
+ g_string_append(path_list_str, fd->path);
}
- if (work) g_string_append_c(new, ' ');
+ if (work) g_string_append_c(path_list_str, ' ');
}
if (options->clipboard_selection == CLIPBOARD_PRIMARY)
{
- gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), new->str, new->len);
+ gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), path_list_str->str, path_list_str->len);
}
else if (options->clipboard_selection == CLIPBOARD_CLIPBOARD)
{
- gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), new->str, new->len);
+ gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), path_list_str->str, path_list_str->len);
}
else
{
- gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), new->str, new->len);
- gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), new->str, new->len);
+ gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), path_list_str->str, path_list_str->len);
+ gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), path_list_str->str, path_list_str->len);
}
- g_string_free(new, TRUE);
+ g_string_free(path_list_str, TRUE);
filelist_free(list);
}
}
}
-static gboolean vd_rename_cb(TreeEditData *td, const gchar *UNUSED(old), const gchar *new, gpointer data)
+static gboolean vd_rename_cb(TreeEditData *td, const gchar *UNUSED(old_name), const gchar *new_name, gpointer data)
{
ViewDir *vd = data;
FileData *fd;
if (!fd) return FALSE;
base = remove_level_from_path(fd->path);
- new_path = g_build_filename(base, new, NULL);
+ new_path = g_build_filename(base, new_name, NULL);
g_free(base);
file_util_rename_dir(fd, new_path, vd->view, vd_rename_finished_cb, vd);
if (match < 0)
{
- GtkTreeIter new;
+ GtkTreeIter new_iter;
if (valid)
{
- gtk_list_store_insert_before(store, &new, &iter);
+ gtk_list_store_insert_before(store, &new_iter, &iter);
}
else
{
- gtk_list_store_append(store, &new);
+ gtk_list_store_append(store, &new_iter);
}
- gtk_list_store_set(store, &new,
+ gtk_list_store_set(store, &new_iter,
DIR_COLUMN_POINTER, fd,
DIR_COLUMN_ICON, pixbuf,
DIR_COLUMN_NAME, fd->name,
static gboolean vflist_row_is_selected(ViewFile *vf, FileData *fd);
-static gboolean vflist_row_rename_cb(TreeEditData *td, const gchar *old, const gchar *new, gpointer data);
+static gboolean vflist_row_rename_cb(TreeEditData *td, const gchar *old_name, const gchar *new_name, gpointer data);
static void vflist_populate_view(ViewFile *vf, gboolean force);
static gboolean vflist_is_multiline(ViewFile *vf);
static void vflist_set_expanded(ViewFile *vf, GtkTreeIter *iter, gboolean expanded);
*-----------------------------------------------------------------------------
*/
-static gboolean vflist_row_rename_cb(TreeEditData *UNUSED(td), const gchar *old, const gchar *new, gpointer data)
+static gboolean vflist_row_rename_cb(TreeEditData *UNUSED(td), const gchar *old_name, const gchar *new_name, gpointer data)
{
ViewFile *vf = data;
gchar *new_path;
- if (!new || !new[0]) return FALSE;
+ if (!new_name || !new_name[0]) return FALSE;
- new_path = g_build_filename(vf->dir_fd->path, new, NULL);
+ new_path = g_build_filename(vf->dir_fd->path, new_name, NULL);
- if (strchr(new, G_DIR_SEPARATOR) != NULL)
+ if (strchr(new_name, G_DIR_SEPARATOR) != NULL)
{
- gchar *text = g_strdup_printf(_("Invalid file name:\n%s"), new);
+ gchar *text = g_strdup_printf(_("Invalid file name:\n%s"), new_name);
file_util_warning_dialog(_("Error renaming file"), text, GTK_STOCK_DIALOG_ERROR, vf->listview);
g_free(text);
}
else
{
- gchar *old_path = g_build_filename(vf->dir_fd->path, old, NULL);
+ gchar *old_path = g_build_filename(vf->dir_fd->path, old_name, NULL);
FileData *fd = file_data_new_group(old_path); /* get the fd from cache */
file_util_rename_simple(fd, new_path, vf->listview);
file_data_unref(fd);
if (match < 0)
{
- GtkTreeIter new;
+ GtkTreeIter new_iter;
if (valid)
{
num_ordered++;
- gtk_tree_store_insert_before(store, &new, parent_iter, &iter);
+ gtk_tree_store_insert_before(store, &new_iter, parent_iter, &iter);
}
else
{
and it seems to be much faster to add new entries to the beginning and reorder later
*/
num_prepended++;
- gtk_tree_store_prepend(store, &new, parent_iter);
+ gtk_tree_store_prepend(store, &new_iter, parent_iter);
}
- vflist_setup_iter(vf, store, &new, file_data_ref(fd));
- vflist_setup_iter_recursive(vf, store, &new, fd->sidecar_files, selected, force);
+ vflist_setup_iter(vf, store, &new_iter, file_data_ref(fd));
+ vflist_setup_iter_recursive(vf, store, &new_iter, fd->sidecar_files, selected, force);
if (g_list_find(selected, fd))
{
/* renamed files - the same fd appears at different position - select it again*/
GtkTreeSelection *selection;
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(vf->listview));
- gtk_tree_selection_select_iter(selection, &new);
+ gtk_tree_selection_select_iter(selection, &new_iter);
}
done = TRUE;