From 55ffe5b0442e58a42a5812c749359a3f22a489d1 Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Mon, 3 Sep 2012 17:01:13 +0300 Subject: ephy-file-helpers: add ephy_dot_dir_is_default() This method will let us know when the current dot directory is the default one and not a user-specified one nor a web application one. https://bugzilla.gnome.org/show_bug.cgi?id=681679 --- lib/ephy-file-helpers.c | 16 ++++++++++++++++ lib/ephy-file-helpers.h | 1 + 2 files changed, 17 insertions(+) (limited to 'lib') diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c index 4bbe0c974..628d3b156 100644 --- a/lib/ephy-file-helpers.c +++ b/lib/ephy-file-helpers.c @@ -62,6 +62,7 @@ static gboolean keep_directory = FALSE; static char *dot_dir = NULL; static char *tmp_dir = NULL; static GList *del_on_exit = NULL; +static gboolean is_default_dot_dir = FALSE; GQuark ephy_file_helpers_error_quark; @@ -275,6 +276,20 @@ ephy_dot_dir (void) return dot_dir; } +/** + * ephy_dot_dir_is_default: + * + * Returns whether the dot directory in use is the default one, found in + * ~/.config + * + * Returns: %TRUE if it is the default dot dir, %FALSE for others + **/ +gboolean +ephy_dot_dir_is_default (void) +{ + return is_default_dot_dir; +} + /** * ephy_file_helpers_init: * @profile_dir: directory to use as Epiphany's profile @@ -340,6 +355,7 @@ ephy_file_helpers_init (const char *profile_dir, dot_dir = g_build_filename (g_get_user_config_dir (), "epiphany", NULL); + is_default_dot_dir = TRUE; } if (flags & EPHY_FILE_HELPERS_ENSURE_EXISTS) diff --git a/lib/ephy-file-helpers.h b/lib/ephy-file-helpers.h index bf52f75b6..f7564b55b 100644 --- a/lib/ephy-file-helpers.h +++ b/lib/ephy-file-helpers.h @@ -57,6 +57,7 @@ gboolean ephy_file_helpers_init (const char *profile_dir, GError **error); const char * ephy_file (const char *filename); const char * ephy_dot_dir (void); +gboolean ephy_dot_dir_is_default (void); void ephy_file_helpers_shutdown (void); char * ephy_file_get_downloads_dir (void); char * ephy_file_desktop_dir (void); -- cgit v1.2.3