Documentation: Use G_SOURCE_CONTINUE and G_SOURCE_REMOVE
[geeqie.git] / src / view-file / view-file-list.cc
index e4f2c0a..73ceb5a 100644 (file)
@@ -167,7 +167,7 @@ static void vflist_store_clear(ViewFile *vf, gboolean unlock_files)
                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
@@ -287,12 +287,12 @@ static void vflist_drag_data_received(GtkWidget *UNUSED(entry_widget), GdkDragCo
 
 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);
@@ -740,7 +740,7 @@ static gboolean vflist_select_idle_cb(gpointer data)
        if (!vf->layout)
                {
                VFLIST(vf)->select_idle_id = 0;
-               return FALSE;
+               return G_SOURCE_REMOVE;
                }
 
        vf_send_update(vf);
@@ -752,7 +752,7 @@ static gboolean vflist_select_idle_cb(gpointer data)
                }
 
        VFLIST(vf)->select_idle_id = 0;
-       return FALSE;
+       return G_SOURCE_REMOVE;
 }
 
 static void vflist_select_idle_cancel(ViewFile *vf)
@@ -877,7 +877,7 @@ static void vflist_setup_iter(ViewFile *vf, GtkTreeStore *store, GtkTreeIter *it
        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;
@@ -1066,7 +1066,7 @@ static void vflist_setup_iter_recursive(ViewFile *vf, GtkTreeStore *store, GtkTr
                {
                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++)
                        {
@@ -1107,7 +1107,7 @@ void vflist_sort_set(ViewFile *vf, SortType type, gboolean ascend)
 
        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;
@@ -1226,7 +1226,7 @@ FileData *vflist_thumb_next_fd(ViewFile *vf)
 
                                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;
                                        }
@@ -1377,7 +1377,7 @@ gint vflist_index_by_fd(ViewFile *vf, FileData *fd)
                           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;
                        }
@@ -1498,7 +1498,7 @@ GList *vflist_selection_get_list(ViewFile *vf)
                        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;
                                }
@@ -1657,7 +1657,7 @@ void vflist_select_list(ViewFile *vf, GList *list)
                {
                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))
@@ -1682,7 +1682,7 @@ static void vflist_select_closest(ViewFile *vf, FileData *sel_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);
@@ -1814,7 +1814,7 @@ static void vflist_listview_set_columns(GtkWidget *listview, gboolean thumb, gbo
 
        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);
@@ -1888,7 +1888,7 @@ static void vflist_populate_view(ViewFile *vf, gboolean force)
        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);