#include "main.h"
#include "view-file-list.h"
-#include "bar.h"
-#include "cache-maint.h"
#include "collect.h"
#include "dnd.h"
-#include "editors.h"
#include "img-view.h"
#include "layout.h"
#include "layout-image.h"
-#include "menu.h"
#include "metadata.h"
#include "misc.h"
-#include "thumb.h"
#include "utilops.h"
#include "ui-fileops.h"
-#include "ui-menu.h"
#include "ui-misc.h"
#include "ui-tree-edit.h"
#include "uri-utils.h"
#include "view-file.h"
-
-#include <gdk/gdkkeysyms.h> /* for keyboard values */
-
/* Index to tree store */
enum {
FILE_COLUMN_POINTER = 0,
static gboolean vflist_find_row_cb(GtkTreeModel *model, GtkTreePath *UNUSED(path), GtkTreeIter *iter, gpointer data)
{
- ViewFileFindRowData *find = data;
+ ViewFileFindRowData *find = (ViewFileFindRowData *)data;
FileData *fd;
gtk_tree_model_get(model, iter, FILE_COLUMN_POINTER, &fd, -1);
if (fd == find->fd)
filelist_read(vf->dir_fd, &files, NULL);
while (files)
{
- FileData *fd = files->data;
+ FileData *fd = static_cast<FileData *>(files->data);
files = files->next;
file_data_unlock(fd);
file_data_unref(fd); // undo the ref that got added in filelist_read
GtkSelectionData *selection_data, guint UNUSED(info),
guint UNUSED(time), gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
GList *list = NULL;
if (!VFLIST(vf)->click_fd) return;
static void vflist_dnd_begin(GtkWidget *widget, GdkDragContext *context, gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
vflist_color_set(vf, VFLIST(vf)->click_fd, TRUE);
static void vflist_dnd_end(GtkWidget *UNUSED(widget), GdkDragContext *context, gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
int x, int y, GtkSelectionData *selection,
guint info, guint UNUSED(time), gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
if (info == TARGET_TEXT_PLAIN) {
FileData *fd = vflist_find_data_by_coord(vf, x, y, NULL);
void vflist_dnd_init(ViewFile *vf)
{
- gtk_drag_source_set(vf->listview, GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
+ gtk_drag_source_set(vf->listview, static_cast<GdkModifierType>(GDK_BUTTON1_MASK | GDK_BUTTON2_MASK),
dnd_file_drag_types, dnd_file_drag_types_count,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
gtk_drag_dest_set(vf->listview, GTK_DEST_DEFAULT_ALL,
dnd_file_drag_types, dnd_file_drag_types_count,
- GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+ static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK));
g_signal_connect(G_OBJECT(vf->listview), "drag_data_get",
G_CALLBACK(vflist_dnd_get), vf);
GList *work = fd->sidecar_files;
while (work)
{
- FileData *sfd = work->data;
+ FileData *sfd = (FileData *)work->data;
list = g_list_prepend(list, file_data_ref(sfd));
work = work->next;
}
void vflist_pop_menu_view_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
if (vflist_row_is_selected(vf, VFLIST(vf)->click_fd))
{
void vflist_pop_menu_rename_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
GList *list;
list = vf_pop_menu_file_list(vf);
void vflist_pop_menu_thumbs_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
if (vf->layout)
work = columns;
while (work)
{
- GtkTreeViewColumn *column = work->data;
+ GtkTreeViewColumn *column = (GtkTreeViewColumn *)work->data;
gint col_idx = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(column), "column_store_idx"));
work = work->next;
void vflist_pop_menu_show_star_rating_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
options->show_star_rating = !options->show_star_rating;
void vflist_pop_menu_refresh_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
vf_refresh(vf);
void vflist_popup_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
VFLIST(vf)->click_fd = NULL;
vf->popup = NULL;
static gboolean vflist_row_rename_cb(TreeEditData *UNUSED(td), const gchar *old_name, const gchar *new_name, gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
gchar *new_path;
if (!new_name || !new_name[0]) return FALSE;
gboolean vflist_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
GtkTreePath *tpath;
if (event->keyval != GDK_KEY_Menu) return FALSE;
gboolean vflist_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
GtkTreePath *tpath;
GtkTreeIter iter;
FileData *fd = NULL;
gboolean vflist_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
GtkTreePath *tpath;
GtkTreeIter iter;
FileData *fd = NULL;
static gboolean vflist_select_idle_cb(gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
if (!vf->layout)
{
VFLIST(vf)->select_idle_id = 0;
- return FALSE;
+ return G_SOURCE_REMOVE;
}
vf_send_update(vf);
}
VFLIST(vf)->select_idle_id = 0;
- return FALSE;
+ return G_SOURCE_REMOVE;
}
static void vflist_select_idle_cancel(ViewFile *vf)
static gboolean vflist_select_cb(GtkTreeSelection *UNUSED(selection), GtkTreeModel *store, GtkTreePath *tpath, gboolean path_currently_selected, gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
GtkTreeIter iter;
GtkTreePath *cursor_path;
static void vflist_expand_cb(GtkTreeView *UNUSED(tree_view), GtkTreeIter *iter, GtkTreePath *UNUSED(path), gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
vflist_set_expanded(vf, iter, TRUE);
}
static void vflist_collapse_cb(GtkTreeView *UNUSED(tree_view), GtkTreeIter *iter, GtkTreePath *UNUSED(path), gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
vflist_set_expanded(vf, iter, FALSE);
}
gchar *sidecars = NULL;
gchar *name;
const gchar *time = text_from_time(fd->date);
- gchar *link = islink(fd->path) ? GQ_LINK_STR : "";
+ const gchar *link = islink(fd->path) ? GQ_LINK_STR : "";
const gchar *disabled_grouping;
gchar *formatted;
gchar *formatted_with_stars;
while (work)
{
gint match;
- FileData *fd = work->data;
+ FileData *fd = (FileData *)work->data;
gboolean done = FALSE;
while (!done)
{
gint i;
gint num_total = num_prepended + num_ordered;
- gint *new_order = g_malloc(num_total * sizeof(gint));
+ gint *new_order = static_cast<gint *>(g_malloc(num_total * sizeof(gint)));
for (i = 0; i < num_total; i++)
{
i = 0;
while (work)
{
- FileData *fd = work->data;
+ FileData *fd = (FileData *)work->data;
g_hash_table_insert(fd_idx_hash, fd, GINT_TO_POINTER(i));
i++;
work = work->next;
vf->list = filelist_sort(vf->list, vf->sort_method, vf->sort_ascend);
- new_order = g_malloc(i * sizeof(gint));
+ new_order = static_cast<gint *>(g_malloc(i * sizeof(gint)));
work = vf->list;
i = 0;
while (work)
{
- FileData *fd = work->data;
+ FileData *fd = (FileData *)work->data;
new_order[i] = GPOINTER_TO_INT(g_hash_table_lookup(fd_idx_hash, fd));
i++;
work = work->next;
GList *work = list;
while (work)
{
- FileData *fd = work->data;
+ FileData *fd = (FileData *)work->data;
work = work->next;
if (fd->thumb_pixbuf) (*done)++;
GList *work = list;
while (work)
{
- FileData *fd = work->data;
+ FileData *fd = (FileData *)work->data;
work = work->next;
if (fd->metadata_in_idle_loaded) (*done)++;
GList *work = vf->list;
while (work && !fd)
{
- FileData *fd_p = work->data;
+ FileData *fd_p = (FileData *)work->data;
if (!fd_p->thumb_pixbuf)
fd = fd_p;
else
while (work2 && !fd)
{
- fd_p = work2->data;
+ fd_p = static_cast<FileData *>(work2->data);
if (!fd_p->thumb_pixbuf) fd = fd_p;
work2 = work2->next;
}
while (work && !fd)
{
- FileData *fd_p = work->data;
+ FileData *fd_p = (FileData *)work->data;
if (fd_p && fd_p->rating == STAR_RATING_NOT_READ)
{
work = vf->list;
while (work)
{
- FileData *list_fd = work->data;
+ FileData *list_fd = (FileData *)work->data;
if (list_fd == fd) return p;
work2 = list_fd->sidecar_files;
it is sufficient for next/prev navigation but it should be rewritten
without using indexes at all
*/
- FileData *sidecar_fd = work2->data;
+ FileData *sidecar_fd = static_cast<FileData *>(work2->data);
if (sidecar_fd == fd) return p;
work2 = work2->next;
}
work = slist;
while (!found && work)
{
- GtkTreePath *tpath = work->data;
+ GtkTreePath *tpath = (GtkTreePath *)work->data;
FileData *fd_n;
GtkTreeIter iter;
return found;
}
-gboolean vflist_index_is_selected(ViewFile *vf, gint row)
-{
- FileData *fd;
+//gboolean vflist_index_is_selected(ViewFile *vf, gint row)
+//{
+ //FileData *fd;
- fd = vf_index_get_data(vf, row);
- return vflist_row_is_selected(vf, fd);
-}
+ //fd = vf_index_get_data(vf, row);
+ //return vflist_row_is_selected(vf, fd);
+//}
guint vflist_selection_count(ViewFile *vf, gint64 *bytes)
{
work = slist;
while (work)
{
- GtkTreePath *tpath = work->data;
+ GtkTreePath *tpath = (GtkTreePath *)work->data;
GtkTreeIter iter;
FileData *fd;
work = slist;
while (work)
{
- GtkTreePath *tpath = work->data;
+ GtkTreePath *tpath = (GtkTreePath *)work->data;
FileData *fd;
GtkTreeIter iter;
GList *work2 = fd->sidecar_files;
while (work2)
{
- FileData *sfd = work2->data;
+ FileData *sfd = static_cast<FileData *>(work2->data);
list = g_list_prepend(list, file_data_ref(sfd));
work2 = work2->next;
}
work = slist;
while (work)
{
- GtkTreePath *tpath = work->data;
+ GtkTreePath *tpath = (GtkTreePath *)work->data;
FileData *fd;
GtkTreeIter iter;
{
FileData *fd;
- fd = work->data;
+ fd = static_cast<FileData *>(work->data);
if (vflist_find_row(vf, fd, &iter) < 0) return;
if (!vflist_row_is_selected(vf, fd))
while (work)
{
gint match;
- fd = work->data;
+ fd = static_cast<FileData *>(work->data);
work = work->next;
match = filelist_sort_compare_filedata_full(fd, sel_fd, vf->sort_method, vf->sort_ascend);
work = slist;
while (work)
{
- GtkTreePath *tpath = work->data;
+ GtkTreePath *tpath = (GtkTreePath *)work->data;
FileData *fd;
GtkTreeIter iter;
list = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(column));
if (!list) return;
- cell = list->data;
+ cell = static_cast<GtkCellRenderer *>(list->data);
g_list_free(list);
g_object_set(G_OBJECT(cell), "height", options->thumbnails.max_height, NULL);
if (selected && vflist_selection_count(vf, NULL) == 0)
{
/* all selected files disappeared */
- vflist_select_closest(vf, selected->data);
+ vflist_select_closest(vf, static_cast<FileData *>(selected->data));
}
filelist_free(selected);
static void vflist_listview_color_cb(GtkTreeViewColumn *UNUSED(tree_column), GtkCellRenderer *cell,
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
gboolean set;
gtk_tree_model_get(tree_model, iter, FILE_COLUMN_COLOR, &set, -1);
static void vflist_listview_mark_toggled_cb(GtkCellRendererToggle *cell, gchar *path_str, gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
GtkTreeStore *store;
GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
GtkTreeIter iter;
void vflist_destroy_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- ViewFile *vf = data;
+ ViewFile *vf = (ViewFile *)data;
file_data_unregister_notify_func(vf_notify_cb, vf);
work = columns;
while (work)
{
- GtkTreeViewColumn *column = work->data;
+ GtkTreeViewColumn *column = (GtkTreeViewColumn *)work->data;
gint col_idx = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(column), "column_store_idx"));
work = work->next;