[epiphany] file-helpers: Add ephy_default_dot_dir()



commit 5e97c0881eda6f6a95ae1be4e86606f97575c196
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Tue Nov 10 08:40:06 2015 +0100

    file-helpers: Add ephy_default_dot_dir()
    
    It always returns the main default dot dir, no matter what the current
    profile is. This is needed because some private profiles could need to
    use the default dot dir, for example, web applications.

 lib/ephy-file-helpers.c |   17 ++++++++++++++---
 lib/ephy-file-helpers.h |    1 +
 2 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 027efd1..1ef4118 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -287,6 +287,19 @@ ephy_dot_dir_is_default (void)
 }
 
 /**
+ * ephy_default_dot_dir:
+ *
+ * Get the path to the default dot directory found in ~/.config
+ *
+ * Returns: a new allocated string, free with g_free() when done.
+ */
+char *
+ephy_default_dot_dir (void)
+{
+       return g_build_filename (g_get_user_config_dir (), "epiphany", NULL);
+}
+
+/**
  * ephy_file_helpers_init:
  * @profile_dir: directory to use as Epiphany's profile
  * @flags: the %EphyFileHelpersFlags for this session
@@ -339,9 +352,7 @@ ephy_file_helpers_init (const char *profile_dir,
        }
        else
        {
-               dot_dir = g_build_filename (g_get_user_config_dir (),
-                                           "epiphany",
-                                           NULL);
+               dot_dir = ephy_default_dot_dir ();
                is_default_dot_dir = TRUE;
        }
 
diff --git a/lib/ephy-file-helpers.h b/lib/ephy-file-helpers.h
index a4987c7..f7c49e5 100644
--- a/lib/ephy-file-helpers.h
+++ b/lib/ephy-file-helpers.h
@@ -57,6 +57,7 @@ gboolean           ephy_file_helpers_init                   (const char
 const char *       ephy_file                                (const char            *filename);
 const char *       ephy_dot_dir                             (void);
 gboolean           ephy_dot_dir_is_default                  (void);
+char       *       ephy_default_dot_dir                     (void);
 void               ephy_file_helpers_shutdown               (void);
 char      *          ephy_file_get_downloads_dir              (void);
 char       *       ephy_file_desktop_dir                    (void);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]