aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-07-06 02:33:32 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-06 04:40:50 +0800
commit844510797455940352cf08bc7ca1388a594a00af (patch)
tree775ca5f2f33c3729b5ab5834706c90a261b1a21f
parent695e0dba7040a9693d4f08b404753ae910d9182b (diff)
downloadgsoc2013-evolution-844510797455940352cf08bc7ca1388a594a00af.tar
gsoc2013-evolution-844510797455940352cf08bc7ca1388a594a00af.tar.gz
gsoc2013-evolution-844510797455940352cf08bc7ca1388a594a00af.tar.bz2
gsoc2013-evolution-844510797455940352cf08bc7ca1388a594a00af.tar.lz
gsoc2013-evolution-844510797455940352cf08bc7ca1388a594a00af.tar.xz
gsoc2013-evolution-844510797455940352cf08bc7ca1388a594a00af.tar.zst
gsoc2013-evolution-844510797455940352cf08bc7ca1388a594a00af.zip
GalViewCollection: Add a "user-directory" property.
Just readable for now, but I plan to make it also construct-only. (Despite the precendence, I prefer "user" over "local" for the name.) New functions: gal_view_collection_get_user_directory()
-rw-r--r--doc/reference/evolution-util/evolution-util-sections.txt1
-rw-r--r--e-util/gal-view-collection.c38
-rw-r--r--e-util/gal-view-collection.h2
3 files changed, 40 insertions, 1 deletions
diff --git a/doc/reference/evolution-util/evolution-util-sections.txt b/doc/reference/evolution-util/evolution-util-sections.txt
index 1e789f1a14..45721611fb 100644
--- a/doc/reference/evolution-util/evolution-util-sections.txt
+++ b/doc/reference/evolution-util/evolution-util-sections.txt
@@ -4591,6 +4591,7 @@ GalViewCollectionItem
GalViewCollection
gal_view_collection_new
gal_view_collection_get_system_directory
+gal_view_collection_get_user_directory
gal_view_collection_set_storage_directories
gal_view_collection_add_factory
gal_view_collection_get_count
diff --git a/e-util/gal-view-collection.c b/e-util/gal-view-collection.c
index bc98c4fa95..19d15462b0 100644
--- a/e-util/gal-view-collection.c
+++ b/e-util/gal-view-collection.c
@@ -30,7 +30,8 @@
enum {
PROP_0,
- PROP_SYSTEM_DIRECTORY
+ PROP_SYSTEM_DIRECTORY,
+ PROP_USER_DIRECTORY
};
enum {
@@ -134,6 +135,13 @@ gal_view_collection_get_property (GObject *object,
gal_view_collection_get_system_directory (
GAL_VIEW_COLLECTION (object)));
return;
+
+ case PROP_USER_DIRECTORY:
+ g_value_set_string (
+ value,
+ gal_view_collection_get_user_directory (
+ GAL_VIEW_COLLECTION (object)));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -205,6 +213,17 @@ gal_view_collection_class_init (GalViewCollectionClass *class)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (
+ object_class,
+ PROP_USER_DIRECTORY,
+ g_param_spec_string (
+ "user-directory",
+ "User Directory",
+ "Directory from which to load user-created views",
+ NULL,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
signals[CHANGED] = g_signal_new (
"changed",
G_OBJECT_CLASS_TYPE (object_class),
@@ -249,6 +268,22 @@ gal_view_collection_get_system_directory (GalViewCollection *collection)
}
/**
+ * gal_view_collection_get_user_directory:
+ * @collection: a #GalViewCollection
+ *
+ * Returns the directory from which user-created views were loaded.
+ *
+ * Returns: the user directory for @collection
+ **/
+const gchar *
+gal_view_collection_get_user_directory (GalViewCollection *collection)
+{
+ g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL);
+
+ return collection->local_dir;
+}
+
+/**
* gal_view_collection_set_storage_directories
* @collection: The view collection to initialize
* @system_dir: The location of the system built in views
@@ -272,6 +307,7 @@ gal_view_collection_set_storage_directories (GalViewCollection *collection,
collection->local_dir = g_strdup (local_dir);
g_object_notify (G_OBJECT (collection), "system-directory");
+ g_object_notify (G_OBJECT (collection), "user-directory");
}
/**
diff --git a/e-util/gal-view-collection.h b/e-util/gal-view-collection.h
index 83678b02d7..ab5c54c62a 100644
--- a/e-util/gal-view-collection.h
+++ b/e-util/gal-view-collection.h
@@ -96,6 +96,8 @@ GalViewCollection *
gal_view_collection_new (void);
const gchar * gal_view_collection_get_system_directory
(GalViewCollection *collection);
+const gchar * gal_view_collection_get_user_directory
+ (GalViewCollection *collection);
/* Set up the view collection. Call these two functions
* before ever doing load or save and never call them again. */