[gthumb] always pass a GFile list to gth_monitor_folder_changed()
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] always pass a GFile list to gth_monitor_folder_changed()
- Date: Sat, 6 Mar 2010 16:09:22 +0000 (UTC)
commit 4758471b912a5487043f71181ef3cc80de3a15b1
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat Mar 6 15:57:48 2010 +0100
always pass a GFile list to gth_monitor_folder_changed()
extensions/catalogs/actions.c | 17 ++++++++++-------
extensions/catalogs/dlg-add-to-catalog.c | 6 ++----
extensions/catalogs/dlg-add-to-catalog.h | 4 ++--
gthumb/gth-file-source.c | 4 +++-
gthumb/gth-monitor.h | 2 +-
5 files changed, 18 insertions(+), 15 deletions(-)
---
diff --git a/extensions/catalogs/actions.c b/extensions/catalogs/actions.c
index 4adfb71..7df490f 100644
--- a/extensions/catalogs/actions.c
+++ b/extensions/catalogs/actions.c
@@ -34,12 +34,14 @@ gth_browser_activate_action_edit_add_to_catalog (GtkAction *action,
{
GList *items;
GList *file_list = NULL;
+ GList *files;
items = gth_file_selection_get_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
file_list = gth_file_list_get_files (GTH_FILE_LIST (gth_browser_get_file_list (browser)), items);
+ files = gth_file_data_list_to_file_list (file_list);
+ dlg_add_to_catalog (browser, files);
- dlg_add_to_catalog (browser, file_list);
-
+ _g_object_list_unref (files);
_g_object_list_unref (file_list);
_gtk_tree_path_list_free (items);
}
@@ -129,7 +131,6 @@ catalog_buffer_ready_cb (void **buffer,
for (scan = data->file_data_list; scan; scan = scan->next) {
GthFileData *file_data = scan->data;
-
gth_catalog_remove_file (data->catalog, file_data->file);
}
@@ -400,14 +401,16 @@ gth_browser_add_to_catalog (GthBrowser *browser,
GFile *catalog)
{
GList *items;
- GList *file_list = NULL;
+ GList *file_list;
+ GList *files;
items = gth_file_selection_get_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
file_list = gth_file_list_get_files (GTH_FILE_LIST (gth_browser_get_file_list (browser)), items);
+ files = gth_file_data_list_to_file_list (file_list);
+ if (files != NULL)
+ add_to_catalog (browser, catalog, files);
- if (file_list != NULL)
- add_to_catalog (browser, catalog, file_list);
-
+ _g_object_list_unref (files);
_g_object_list_unref (file_list);
_gtk_tree_path_list_free (items);
}
diff --git a/extensions/catalogs/dlg-add-to-catalog.c b/extensions/catalogs/dlg-add-to-catalog.c
index ef2b6b9..a2e2585 100644
--- a/extensions/catalogs/dlg-add-to-catalog.c
+++ b/extensions/catalogs/dlg-add-to-catalog.c
@@ -136,10 +136,8 @@ catalog_ready_cb (GObject *catalog,
add_data->catalog = (GthCatalog *) catalog;
- for (scan = add_data->files; scan; scan = scan->next) {
- GthFileData *file_to_add = scan->data;
- gth_catalog_insert_file (add_data->catalog, file_to_add->file, -1);
- }
+ for (scan = add_data->files; scan; scan = scan->next)
+ gth_catalog_insert_file (add_data->catalog, (GFile *) scan->data, -1);
buffer = gth_catalog_to_data (add_data->catalog, &length);
gio_file = gth_catalog_file_to_gio_file (add_data->catalog_file);
diff --git a/extensions/catalogs/dlg-add-to-catalog.h b/extensions/catalogs/dlg-add-to-catalog.h
index d9a4794..cab764c 100644
--- a/extensions/catalogs/dlg-add-to-catalog.h
+++ b/extensions/catalogs/dlg-add-to-catalog.h
@@ -27,10 +27,10 @@
#include <gthumb.h>
void dlg_add_to_catalog (GthBrowser *browser,
- GList *list);
+ GList *list /* GFile list */);
void add_to_catalog (GthBrowser *browser,
GFile *catalog,
- GList *list);
+ GList *list /* GFile list */);
void dlg_move_to_catalog_directory (GthBrowser *browser,
char *catalog_path);
diff --git a/gthumb/gth-file-source.c b/gthumb/gth-file-source.c
index 12f26e9..a602a47 100644
--- a/gthumb/gth-file-source.c
+++ b/gthumb/gth-file-source.c
@@ -828,8 +828,10 @@ gth_file_source_to_gio_file_list (GthFileSource *file_source,
GList *gio_files = NULL;
GList *scan;
- for (scan = files; scan; scan = scan->next)
+ for (scan = files; scan; scan = scan->next) {
+g_print ("%s ==> %s\n", g_file_get_uri ((GFile *) scan->data), g_file_get_uri (gth_file_source_to_gio_file (file_source, (GFile *) scan->data)));
gio_files = g_list_prepend (gio_files, gth_file_source_to_gio_file (file_source, (GFile *) scan->data));
+ }
return g_list_reverse (gio_files);
}
diff --git a/gthumb/gth-monitor.h b/gthumb/gth-monitor.h
index de5de93..1d80e4c 100644
--- a/gthumb/gth-monitor.h
+++ b/gthumb/gth-monitor.h
@@ -88,7 +88,7 @@ void gth_monitor_filters_changed (GthMonitor *monitor);
void gth_monitor_tags_changed (GthMonitor *monitor);
void gth_monitor_folder_changed (GthMonitor *monitor,
GFile *parent,
- GList *list,
+ GList *list, /* GFile list */
GthMonitorEvent event);
void gth_monitor_file_renamed (GthMonitor *monitor,
GFile *file,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]