Mercurial > geeqie
comparison src/view_file_list.c @ 1453:bc3f5c0432f6
gint -> gboolean where applicable. The end (ouf!).
author | zas_ |
---|---|
date | Mon, 16 Mar 2009 20:39:09 +0000 |
parents | a3d3208b0c50 |
children | 331e2d60d447 |
comparison
equal
deleted
inserted
replaced
1452:67b40740122e | 1453:bc3f5c0432f6 |
---|---|
60 FILE_VIEW_COLUMN_COUNT | 60 FILE_VIEW_COLUMN_COUNT |
61 }; | 61 }; |
62 | 62 |
63 | 63 |
64 | 64 |
65 static gint vflist_row_is_selected(ViewFile *vf, FileData *fd); | 65 static gboolean vflist_row_is_selected(ViewFile *vf, FileData *fd); |
66 static gint vflist_row_rename_cb(TreeEditData *td, const gchar *old, const gchar *new, gpointer data); | 66 static gboolean vflist_row_rename_cb(TreeEditData *td, const gchar *old, const gchar *new, gpointer data); |
67 static void vflist_populate_view(ViewFile *vf); | 67 static void vflist_populate_view(ViewFile *vf); |
68 | 68 |
69 | 69 |
70 /* | 70 /* |
71 *----------------------------------------------------------------------------- | 71 *----------------------------------------------------------------------------- |
73 *----------------------------------------------------------------------------- | 73 *----------------------------------------------------------------------------- |
74 */ | 74 */ |
75 typedef struct { | 75 typedef struct { |
76 FileData *fd; | 76 FileData *fd; |
77 GtkTreeIter *iter; | 77 GtkTreeIter *iter; |
78 gint found; | 78 gboolean found; |
79 gint row; | 79 gint row; |
80 } ViewFileFindRowData; | 80 } ViewFileFindRowData; |
81 | 81 |
82 static gboolean vflist_find_row_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) | 82 static gboolean vflist_find_row_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) |
83 { | 83 { |
85 FileData *fd; | 85 FileData *fd; |
86 gtk_tree_model_get(model, iter, FILE_COLUMN_POINTER, &fd, -1); | 86 gtk_tree_model_get(model, iter, FILE_COLUMN_POINTER, &fd, -1); |
87 if (fd == find->fd) | 87 if (fd == find->fd) |
88 { | 88 { |
89 *find->iter = *iter; | 89 *find->iter = *iter; |
90 find->found = 1; | 90 find->found = TRUE; |
91 return TRUE; | 91 return TRUE; |
92 } | 92 } |
93 find->row++; | 93 find->row++; |
94 return FALSE; | 94 return FALSE; |
95 } | 95 } |
96 | 96 |
97 static gint vflist_find_row(ViewFile *vf, FileData *fd, GtkTreeIter *iter) | 97 static gint vflist_find_row(ViewFile *vf, FileData *fd, GtkTreeIter *iter) |
98 { | 98 { |
99 GtkTreeModel *store; | 99 GtkTreeModel *store; |
100 ViewFileFindRowData data = {fd, iter, 0, 0}; | 100 ViewFileFindRowData data = {fd, iter, FALSE, 0}; |
101 | 101 |
102 store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview)); | 102 store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview)); |
103 gtk_tree_model_foreach(store, vflist_find_row_cb, &data); | 103 gtk_tree_model_foreach(store, vflist_find_row_cb, &data); |
104 | 104 |
105 if (data.found) | 105 if (data.found) |
192 store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview)); | 192 store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview)); |
193 gtk_tree_model_foreach(store, vflist_store_clear_cb, NULL); | 193 gtk_tree_model_foreach(store, vflist_store_clear_cb, NULL); |
194 gtk_tree_store_clear(GTK_TREE_STORE(store)); | 194 gtk_tree_store_clear(GTK_TREE_STORE(store)); |
195 } | 195 } |
196 | 196 |
197 void vflist_color_set(ViewFile *vf, FileData *fd, gint color_set) | 197 void vflist_color_set(ViewFile *vf, FileData *fd, gboolean color_set) |
198 { | 198 { |
199 GtkTreeModel *store; | 199 GtkTreeModel *store; |
200 GtkTreeIter iter; | 200 GtkTreeIter iter; |
201 | 201 |
202 if (vflist_find_row(vf, fd, &iter) < 0) return; | 202 if (vflist_find_row(vf, fd, &iter) < 0) return; |
457 *----------------------------------------------------------------------------- | 457 *----------------------------------------------------------------------------- |
458 * callbacks | 458 * callbacks |
459 *----------------------------------------------------------------------------- | 459 *----------------------------------------------------------------------------- |
460 */ | 460 */ |
461 | 461 |
462 static gint vflist_row_rename_cb(TreeEditData *td, const gchar *old, const gchar *new, gpointer data) | 462 static gboolean vflist_row_rename_cb(TreeEditData *td, const gchar *old, const gchar *new, gpointer data) |
463 { | 463 { |
464 ViewFile *vf = data; | 464 ViewFile *vf = data; |
465 gchar *old_path; | |
466 gchar *new_path; | 465 gchar *new_path; |
467 | 466 |
468 if (strlen(new) == 0) return FALSE; | 467 if (!new || !new[0]) return FALSE; |
469 | 468 |
470 old_path = g_build_filename(vf->dir_fd->path, old, NULL); | |
471 new_path = g_build_filename(vf->dir_fd->path, new, NULL); | 469 new_path = g_build_filename(vf->dir_fd->path, new, NULL); |
472 | 470 |
473 if (strchr(new, G_DIR_SEPARATOR) != NULL) | 471 if (strchr(new, G_DIR_SEPARATOR) != NULL) |
474 { | 472 { |
475 gchar *text = g_strdup_printf(_("Invalid file name:\n%s"), new); | 473 gchar *text = g_strdup_printf(_("Invalid file name:\n%s"), new); |
476 file_util_warning_dialog(_("Error renaming file"), text, GTK_STOCK_DIALOG_ERROR, vf->listview); | 474 file_util_warning_dialog(_("Error renaming file"), text, GTK_STOCK_DIALOG_ERROR, vf->listview); |
477 g_free(text); | 475 g_free(text); |
478 } | 476 } |
479 else | 477 else |
480 { | 478 { |
479 gchar *old_path = g_build_filename(vf->dir_fd->path, old, NULL); | |
481 FileData *fd = file_data_new_simple(old_path); /* get the fd from cache */ | 480 FileData *fd = file_data_new_simple(old_path); /* get the fd from cache */ |
482 file_util_rename_simple(fd, new_path, vf->listview); | 481 file_util_rename_simple(fd, new_path, vf->listview); |
483 file_data_unref(fd); | 482 file_data_unref(fd); |
484 } | 483 g_free(old_path); |
485 g_free(old_path); | 484 } |
485 | |
486 g_free(new_path); | 486 g_free(new_path); |
487 | 487 |
488 return FALSE; | 488 return FALSE; |
489 } | 489 } |
490 | 490 |
503 gtk_tree_path_free(tpath); | 503 gtk_tree_path_free(tpath); |
504 *y += ch; | 504 *y += ch; |
505 popup_menu_position_clamp(menu, x, y, 0); | 505 popup_menu_position_clamp(menu, x, y, 0); |
506 } | 506 } |
507 | 507 |
508 gint vflist_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) | 508 gboolean vflist_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) |
509 { | 509 { |
510 ViewFile *vf = data; | 510 ViewFile *vf = data; |
511 GtkTreePath *tpath; | 511 GtkTreePath *tpath; |
512 | 512 |
513 if (event->keyval != GDK_Menu) return FALSE; | 513 if (event->keyval != GDK_Menu) return FALSE; |
532 gtk_menu_popup(GTK_MENU(vf->popup), NULL, NULL, vflist_menu_position_cb, vf, 0, GDK_CURRENT_TIME); | 532 gtk_menu_popup(GTK_MENU(vf->popup), NULL, NULL, vflist_menu_position_cb, vf, 0, GDK_CURRENT_TIME); |
533 | 533 |
534 return TRUE; | 534 return TRUE; |
535 } | 535 } |
536 | 536 |
537 gint vflist_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) | 537 gboolean vflist_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
538 { | 538 { |
539 ViewFile *vf = data; | 539 ViewFile *vf = data; |
540 GtkTreePath *tpath; | 540 GtkTreePath *tpath; |
541 GtkTreeIter iter; | 541 GtkTreeIter iter; |
542 FileData *fd = NULL; | 542 FileData *fd = NULL; |
615 #endif | 615 #endif |
616 | 616 |
617 return FALSE; | 617 return FALSE; |
618 } | 618 } |
619 | 619 |
620 gint vflist_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) | 620 gboolean vflist_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
621 { | 621 { |
622 ViewFile *vf = data; | 622 ViewFile *vf = data; |
623 GtkTreePath *tpath; | 623 GtkTreePath *tpath; |
624 GtkTreeIter iter; | 624 GtkTreeIter iter; |
625 FileData *fd = NULL; | 625 FileData *fd = NULL; |
685 static void vflist_select_image(ViewFile *vf, FileData *sel_fd) | 685 static void vflist_select_image(ViewFile *vf, FileData *sel_fd) |
686 { | 686 { |
687 FileData *read_ahead_fd = NULL; | 687 FileData *read_ahead_fd = NULL; |
688 gint row; | 688 gint row; |
689 FileData *cur_fd; | 689 FileData *cur_fd; |
690 | |
690 if (!sel_fd) return; | 691 if (!sel_fd) return; |
691 | 692 |
692 cur_fd = layout_image_get_fd(vf->layout); | 693 cur_fd = layout_image_get_fd(vf->layout); |
693 if (sel_fd == cur_fd) return; /* no change */ | 694 if (sel_fd == cur_fd) return; /* no change */ |
694 | 695 |
709 } | 710 } |
710 | 711 |
711 layout_image_set_with_ahead(vf->layout, sel_fd, read_ahead_fd); | 712 layout_image_set_with_ahead(vf->layout, sel_fd, read_ahead_fd); |
712 } | 713 } |
713 | 714 |
714 static gint vflist_select_idle_cb(gpointer data) | 715 static gboolean vflist_select_idle_cb(gpointer data) |
715 { | 716 { |
716 ViewFile *vf = data; | 717 ViewFile *vf = data; |
717 | 718 |
718 if (!vf->layout) | 719 if (!vf->layout) |
719 { | 720 { |
838 | 839 |
839 static void vflist_setup_iter_recursive(ViewFile *vf, GtkTreeStore *store, GtkTreeIter *parent_iter, GList *list, GList *selected) | 840 static void vflist_setup_iter_recursive(ViewFile *vf, GtkTreeStore *store, GtkTreeIter *parent_iter, GList *list, GList *selected) |
840 { | 841 { |
841 GList *work; | 842 GList *work; |
842 GtkTreeIter iter; | 843 GtkTreeIter iter; |
843 gint valid; | 844 gboolean valid; |
844 gint num_ordered = 0; | 845 gint num_ordered = 0; |
845 gint num_prepended = 0; | 846 gint num_prepended = 0; |
846 | 847 |
847 valid = gtk_tree_model_iter_children(GTK_TREE_MODEL(store), &iter, parent_iter); | 848 valid = gtk_tree_model_iter_children(GTK_TREE_MODEL(store), &iter, parent_iter); |
848 | 849 |
965 | 966 |
966 g_free(new_order); | 967 g_free(new_order); |
967 } | 968 } |
968 } | 969 } |
969 | 970 |
970 void vflist_sort_set(ViewFile *vf, SortType type, gint ascend) | 971 void vflist_sort_set(ViewFile *vf, SortType type, gboolean ascend) |
971 { | 972 { |
972 gint i; | 973 gint i; |
973 GHashTable *fd_idx_hash = g_hash_table_new(NULL, NULL); | 974 GHashTable *fd_idx_hash = g_hash_table_new(NULL, NULL); |
974 gint *new_order; | 975 gint *new_order; |
975 GtkTreeStore *store; | 976 GtkTreeStore *store; |
1016 *----------------------------------------------------------------------------- | 1017 *----------------------------------------------------------------------------- |
1017 * thumb updates | 1018 * thumb updates |
1018 *----------------------------------------------------------------------------- | 1019 *----------------------------------------------------------------------------- |
1019 */ | 1020 */ |
1020 | 1021 |
1021 static gint vflist_thumb_next(ViewFile *vf); | 1022 static gboolean vflist_thumb_next(ViewFile *vf); |
1022 | 1023 |
1023 static void vflist_thumb_progress_count(GList *list, gint *count, gint *done) | 1024 static void vflist_thumb_progress_count(GList *list, gint *count, gint *done) |
1024 { | 1025 { |
1025 GList *work = list; | 1026 GList *work = list; |
1026 while (work) | 1027 while (work) |
1110 } | 1111 } |
1111 | 1112 |
1112 while (vflist_thumb_next(vf)); | 1113 while (vflist_thumb_next(vf)); |
1113 } | 1114 } |
1114 | 1115 |
1115 static gint vflist_thumb_next(ViewFile *vf) | 1116 static gboolean vflist_thumb_next(ViewFile *vf) |
1116 { | 1117 { |
1117 GtkTreePath *tpath; | 1118 GtkTreePath *tpath; |
1118 FileData *fd = NULL; | 1119 FileData *fd = NULL; |
1119 | 1120 |
1120 /* first check the visible files */ | 1121 /* first check the visible files */ |
1278 *----------------------------------------------------------------------------- | 1279 *----------------------------------------------------------------------------- |
1279 * selections | 1280 * selections |
1280 *----------------------------------------------------------------------------- | 1281 *----------------------------------------------------------------------------- |
1281 */ | 1282 */ |
1282 | 1283 |
1283 static gint vflist_row_is_selected(ViewFile *vf, FileData *fd) | 1284 static gboolean vflist_row_is_selected(ViewFile *vf, FileData *fd) |
1284 { | 1285 { |
1285 GtkTreeModel *store; | 1286 GtkTreeModel *store; |
1286 GtkTreeSelection *selection; | 1287 GtkTreeSelection *selection; |
1287 GList *slist; | 1288 GList *slist; |
1288 GList *work; | 1289 GList *work; |
1306 g_list_free(slist); | 1307 g_list_free(slist); |
1307 | 1308 |
1308 return found; | 1309 return found; |
1309 } | 1310 } |
1310 | 1311 |
1311 gint vflist_index_is_selected(ViewFile *vf, gint row) | 1312 gboolean vflist_index_is_selected(ViewFile *vf, gint row) |
1312 { | 1313 { |
1313 FileData *fd; | 1314 FileData *fd; |
1314 | 1315 |
1315 fd = vf_index_get_data(vf, row); | 1316 fd = vf_index_get_data(vf, row); |
1316 return vflist_row_is_selected(vf, fd); | 1317 return vflist_row_is_selected(vf, fd); |
1480 * it scrolls to the first selected row instead. */ | 1481 * it scrolls to the first selected row instead. */ |
1481 valid = tree_model_get_iter_last(store, &iter); | 1482 valid = tree_model_get_iter_last(store, &iter); |
1482 | 1483 |
1483 while (valid) | 1484 while (valid) |
1484 { | 1485 { |
1485 gint selected = gtk_tree_selection_iter_is_selected(selection, &iter); | 1486 gboolean selected = gtk_tree_selection_iter_is_selected(selection, &iter); |
1486 | 1487 |
1487 if (selected) | 1488 if (selected) |
1488 gtk_tree_selection_unselect_iter(selection, &iter); | 1489 gtk_tree_selection_unselect_iter(selection, &iter); |
1489 else | 1490 else |
1490 gtk_tree_selection_select_iter(selection, &iter); | 1491 gtk_tree_selection_select_iter(selection, &iter); |
1545 void vflist_mark_to_selection(ViewFile *vf, gint mark, MarkToSelectionMode mode) | 1546 void vflist_mark_to_selection(ViewFile *vf, gint mark, MarkToSelectionMode mode) |
1546 { | 1547 { |
1547 GtkTreeModel *store; | 1548 GtkTreeModel *store; |
1548 GtkTreeIter iter; | 1549 GtkTreeIter iter; |
1549 GtkTreeSelection *selection; | 1550 GtkTreeSelection *selection; |
1550 gint valid; | 1551 gboolean valid; |
1551 gint n = mark - 1; | 1552 gint n = mark - 1; |
1552 | 1553 |
1553 g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE); | 1554 g_assert(mark >= 1 && mark <= FILEDATA_MARKS_SIZE); |
1554 | 1555 |
1555 store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview)); | 1556 store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview)); |
1640 *----------------------------------------------------------------------------- | 1641 *----------------------------------------------------------------------------- |
1641 * core (population) | 1642 * core (population) |
1642 *----------------------------------------------------------------------------- | 1643 *----------------------------------------------------------------------------- |
1643 */ | 1644 */ |
1644 | 1645 |
1645 static void vflist_listview_set_columns(GtkWidget *listview, gint thumb) | 1646 static void vflist_listview_set_columns(GtkWidget *listview, gboolean thumb) |
1646 { | 1647 { |
1647 GtkTreeViewColumn *column; | 1648 GtkTreeViewColumn *column; |
1648 GtkCellRenderer *cell; | 1649 GtkCellRenderer *cell; |
1649 GList *list; | 1650 GList *list; |
1650 gboolean multiline; | 1651 gboolean multiline; |
1686 } | 1687 } |
1687 | 1688 |
1688 static void vflist_populate_view(ViewFile *vf) | 1689 static void vflist_populate_view(ViewFile *vf) |
1689 { | 1690 { |
1690 GtkTreeStore *store; | 1691 GtkTreeStore *store; |
1691 gint thumbs; | 1692 gboolean thumbs_enabled; |
1692 GList *selected; | 1693 GList *selected; |
1693 | 1694 |
1694 store = GTK_TREE_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview))); | 1695 store = GTK_TREE_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview))); |
1695 thumbs = VFLIST(vf)->thumbs_enabled; | 1696 thumbs_enabled = VFLIST(vf)->thumbs_enabled; |
1696 | 1697 |
1697 vflist_thumb_stop(vf); | 1698 vflist_thumb_stop(vf); |
1698 | 1699 |
1699 if (!vf->list) | 1700 if (!vf->list) |
1700 { | 1701 { |
1701 vflist_store_clear(vf); | 1702 vflist_store_clear(vf); |
1702 vf_send_update(vf); | 1703 vf_send_update(vf); |
1703 return; | 1704 return; |
1704 } | 1705 } |
1705 | 1706 |
1706 vflist_listview_set_columns(vf->listview, thumbs); | 1707 vflist_listview_set_columns(vf->listview, thumbs_enabled); |
1707 | 1708 |
1708 selected = vflist_selection_get_list(vf); | 1709 selected = vflist_selection_get_list(vf); |
1709 | 1710 |
1710 vflist_setup_iter_recursive(vf, store, NULL, vf->list, selected); | 1711 vflist_setup_iter_recursive(vf, store, NULL, vf->list, selected); |
1711 | 1712 |
1719 | 1720 |
1720 vf_send_update(vf); | 1721 vf_send_update(vf); |
1721 vflist_thumb_update(vf); | 1722 vflist_thumb_update(vf); |
1722 } | 1723 } |
1723 | 1724 |
1724 gint vflist_refresh(ViewFile *vf) | 1725 gboolean vflist_refresh(ViewFile *vf) |
1725 { | 1726 { |
1726 GList *old_list; | 1727 GList *old_list; |
1727 gboolean ret = TRUE; | 1728 gboolean ret = TRUE; |
1728 | 1729 |
1729 old_list = vf->list; | 1730 old_list = vf->list; |
1800 g_object_set(G_OBJECT(cell), | 1801 g_object_set(G_OBJECT(cell), |
1801 "cell-background-gdk", vflist_listview_color_shifted(vf->listview), | 1802 "cell-background-gdk", vflist_listview_color_shifted(vf->listview), |
1802 "cell-background-set", set, NULL); | 1803 "cell-background-set", set, NULL); |
1803 } | 1804 } |
1804 | 1805 |
1805 static void vflist_listview_add_column(ViewFile *vf, gint n, const gchar *title, gint image, gint right_justify, gint expand) | 1806 static void vflist_listview_add_column(ViewFile *vf, gint n, const gchar *title, gboolean image, gboolean right_justify, gboolean expand) |
1806 { | 1807 { |
1807 GtkTreeViewColumn *column; | 1808 GtkTreeViewColumn *column; |
1808 GtkCellRenderer *renderer; | 1809 GtkCellRenderer *renderer; |
1809 | 1810 |
1810 column = gtk_tree_view_column_new(); | 1811 column = gtk_tree_view_column_new(); |
1845 ViewFile *vf = data; | 1846 ViewFile *vf = data; |
1846 GtkTreeStore *store; | 1847 GtkTreeStore *store; |
1847 GtkTreePath *path = gtk_tree_path_new_from_string(path_str); | 1848 GtkTreePath *path = gtk_tree_path_new_from_string(path_str); |
1848 GtkTreeIter iter; | 1849 GtkTreeIter iter; |
1849 FileData *fd; | 1850 FileData *fd; |
1850 gboolean mark; | 1851 gboolean marked; |
1851 guint col_idx; | 1852 guint col_idx; |
1852 | 1853 |
1853 store = GTK_TREE_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview))); | 1854 store = GTK_TREE_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview))); |
1854 if (!path || !gtk_tree_model_get_iter(GTK_TREE_MODEL(store), &iter, path)) | 1855 if (!path || !gtk_tree_model_get_iter(GTK_TREE_MODEL(store), &iter, path)) |
1855 return; | 1856 return; |
1856 | 1857 |
1857 col_idx = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cell), "column_store_idx")); | 1858 col_idx = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cell), "column_store_idx")); |
1858 | 1859 |
1859 g_assert(col_idx >= FILE_COLUMN_MARKS && col_idx <= FILE_COLUMN_MARKS_LAST); | 1860 g_assert(col_idx >= FILE_COLUMN_MARKS && col_idx <= FILE_COLUMN_MARKS_LAST); |
1860 | 1861 |
1861 gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, FILE_COLUMN_POINTER, &fd, col_idx, &mark, -1); | 1862 gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, FILE_COLUMN_POINTER, &fd, col_idx, &marked, -1); |
1862 mark = !mark; | 1863 marked = !marked; |
1863 file_data_unregister_notify_func(vf_notify_cb, vf); /* we don't need the notification */ | 1864 file_data_unregister_notify_func(vf_notify_cb, vf); /* we don't need the notification */ |
1864 file_data_set_mark(fd, col_idx - FILE_COLUMN_MARKS, mark); | 1865 file_data_set_mark(fd, col_idx - FILE_COLUMN_MARKS, marked); |
1865 if (!file_data_filter_marks(fd, vf_marks_get_filter(vf))) /* file no longer matches the filter -> remove it */ | 1866 if (!file_data_filter_marks(fd, vf_marks_get_filter(vf))) /* file no longer matches the filter -> remove it */ |
1866 { | 1867 { |
1867 vf_refresh_idle(vf); | 1868 vf_refresh_idle(vf); |
1868 } | 1869 } |
1869 file_data_register_notify_func(vf_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM); | 1870 file_data_register_notify_func(vf_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM); |
1870 | 1871 |
1871 gtk_tree_store_set(store, &iter, col_idx, mark, -1); | 1872 gtk_tree_store_set(store, &iter, col_idx, marked, -1); |
1872 gtk_tree_path_free(path); | 1873 gtk_tree_path_free(path); |
1873 } | 1874 } |
1874 | 1875 |
1875 static void vflist_listview_add_column_toggle(ViewFile *vf, gint n, const gchar *title) | 1876 static void vflist_listview_add_column_toggle(ViewFile *vf, gint n, const gchar *title) |
1876 { | 1877 { |
1900 *----------------------------------------------------------------------------- | 1901 *----------------------------------------------------------------------------- |
1901 * base | 1902 * base |
1902 *----------------------------------------------------------------------------- | 1903 *----------------------------------------------------------------------------- |
1903 */ | 1904 */ |
1904 | 1905 |
1905 gint vflist_set_fd(ViewFile *vf, FileData *dir_fd) | 1906 gboolean vflist_set_fd(ViewFile *vf, FileData *dir_fd) |
1906 { | 1907 { |
1907 if (!dir_fd) return FALSE; | 1908 if (!dir_fd) return FALSE; |
1908 if (vf->dir_fd == dir_fd) return TRUE; | 1909 if (vf->dir_fd == dir_fd) return TRUE; |
1909 | 1910 |
1910 file_data_unref(vf->dir_fd); | 1911 file_data_unref(vf->dir_fd); |
1998 | 1999 |
1999 file_data_register_notify_func(vf_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM); | 2000 file_data_register_notify_func(vf_notify_cb, vf, NOTIFY_PRIORITY_MEDIUM); |
2000 return vf; | 2001 return vf; |
2001 } | 2002 } |
2002 | 2003 |
2003 void vflist_thumb_set(ViewFile *vf, gint enable) | 2004 void vflist_thumb_set(ViewFile *vf, gboolean enable) |
2004 { | 2005 { |
2005 if (VFLIST(vf)->thumbs_enabled == enable) return; | 2006 if (VFLIST(vf)->thumbs_enabled == enable) return; |
2006 | 2007 |
2007 VFLIST(vf)->thumbs_enabled = enable; | 2008 VFLIST(vf)->thumbs_enabled = enable; |
2008 if (vf->layout) vf_refresh(vf); | 2009 if (vf->layout) vf_refresh(vf); |
2009 } | 2010 } |
2010 | 2011 |
2011 void vflist_marks_set(ViewFile *vf, gint enable) | 2012 void vflist_marks_set(ViewFile *vf, gboolean enable) |
2012 { | 2013 { |
2013 GList *columns, *work; | 2014 GList *columns, *work; |
2014 | 2015 |
2015 columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(vf->listview)); | 2016 columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(vf->listview)); |
2016 | 2017 |