diff options
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/menus/gal-view-collection.c | 25 | ||||
-rw-r--r-- | widgets/menus/gal-view-collection.h | 56 |
2 files changed, 40 insertions, 41 deletions
diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c index 03882ed484..db314f4d5f 100644 --- a/widgets/menus/gal-view-collection.c +++ b/widgets/menus/gal-view-collection.c @@ -19,17 +19,6 @@ #define PARENT_TYPE gtk_object_get_type () -struct _GalViewCollectionItem { - GalView *view; - char *id; - gboolean changed; - gboolean ever_changed; - gboolean built_in; - char *filename; - char *title; - char *type; -}; - static GtkObjectClass *gal_view_collection_parent_class; enum { @@ -226,13 +215,8 @@ load_single_file (GalViewCollection *collection, item->type = e_xml_get_string_prop_by_name(node, "type"); if (item->filename) { GalViewFactory *factory; - char *temp; GList *factories; - temp = g_concat_dir_and_file(dir, item->filename); - g_free(item->filename); - item->filename = temp; - factory = NULL; for (factories = collection->factory_list; factories; factories = factories->next) { if (!strcmp(gal_view_factory_get_type_code(factories->data), item->type)) { @@ -241,12 +225,17 @@ load_single_file (GalViewCollection *collection, } } if (factory) { - item->view = gal_view_factory_new_view (factory, item->filename); - gal_view_load(item->view, item->filename); + char *filename; + + filename = g_concat_dir_and_file(dir, item->filename); + item->view = gal_view_factory_new_view (factory, item->title); + gal_view_load(item->view, filename); gal_view_set_title (item->view, item->title); gtk_signal_connect(GTK_OBJECT(item->view), "changed", GTK_SIGNAL_FUNC(view_changed), item); + g_free(filename); } + } return item; } diff --git a/widgets/menus/gal-view-collection.h b/widgets/menus/gal-view-collection.h index d93c9a12a5..bfe47781a7 100644 --- a/widgets/menus/gal-view-collection.h +++ b/widgets/menus/gal-view-collection.h @@ -11,7 +11,16 @@ #define GAL_IS_VIEW_COLLECTION(o) (GTK_CHECK_TYPE ((o), GAL_VIEW_COLLECTION_TYPE)) #define GAL_IS_VIEW_COLLECTION_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), GAL_VIEW_COLLECTION_TYPE)) -typedef struct _GalViewCollectionItem GalViewCollectionItem; +typedef struct { + GalView *view; + char *id; + gboolean changed; + gboolean ever_changed; + gboolean built_in; + char *filename; + char *title; + char *type; +} GalViewCollectionItem; typedef struct { GtkObject base; @@ -38,34 +47,35 @@ typedef struct { } GalViewCollectionClass; /* Standard functions */ -GtkType gal_view_collection_get_type (void); -GalViewCollection *gal_view_collection_new (void); +GtkType gal_view_collection_get_type (void); +GalViewCollection *gal_view_collection_new (void); /* Set up the view collection */ -void gal_view_collection_set_storage_directories (GalViewCollection *collection, - const char *system_dir, - const char *local_dir); -void gal_view_collection_add_factory (GalViewCollection *collection, - GalViewFactory *factory); +void gal_view_collection_set_storage_directories (GalViewCollection *collection, + const char *system_dir, + const char *local_dir); +void gal_view_collection_add_factory (GalViewCollection *collection, + GalViewFactory *factory); /* Send the display view signal. */ -void gal_view_collection_display_view (GalViewCollection *collection, - GalView *view); - -gint gal_view_collection_get_count (GalViewCollection *collection); -GalView *gal_view_collection_get_view (GalViewCollection *collection, - int n); - -void gal_view_collection_append (GalViewCollection *collection, - GalView *view); -void gal_view_collection_delete_view (GalViewCollection *collection, - int i); -void gal_view_collection_copy_view (GalViewCollection *collection, - int i); +void gal_view_collection_display_view (GalViewCollection *collection, + GalView *view); +gint gal_view_collection_get_count (GalViewCollection *collection); +GalView *gal_view_collection_get_view (GalViewCollection *collection, + int n); +GalViewCollectionItem *gal_view_collection_get_view_item (GalViewCollection *collection, + int n); + +void gal_view_collection_append (GalViewCollection *collection, + GalView *view); +void gal_view_collection_delete_view (GalViewCollection *collection, + int i); +void gal_view_collection_copy_view (GalViewCollection *collection, + int i); /* Call set_storage_directories and add factories for anything that * might be found there before doing either of these. */ -void gal_view_collection_load (GalViewCollection *collection); -void gal_view_collection_save (GalViewCollection *collection); +void gal_view_collection_load (GalViewCollection *collection); +void gal_view_collection_save (GalViewCollection *collection); #endif /* _GAL_VIEW_COLLECTION_H_ */ |