[epiphany/gnome-3-18] file-helpers: Add ephy_default_dot_dir()



commit b0e4bdf3dbf145d21bb5a2e4c8f27acdb0bf2b36
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 3c28062..fcd35af 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -291,6 +291,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
@@ -343,9 +356,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]