aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2012-09-03 22:01:13 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2012-09-04 02:37:15 +0800
commit55ffe5b0442e58a42a5812c749359a3f22a489d1 (patch)
tree39079539c134b84ab765836ffc562ff3aa4f9f5b /lib
parentdbac4d6d897d15769ec6101b7ff7aed30272b3e9 (diff)
downloadgsoc2013-epiphany-55ffe5b0442e58a42a5812c749359a3f22a489d1.tar
gsoc2013-epiphany-55ffe5b0442e58a42a5812c749359a3f22a489d1.tar.gz
gsoc2013-epiphany-55ffe5b0442e58a42a5812c749359a3f22a489d1.tar.bz2
gsoc2013-epiphany-55ffe5b0442e58a42a5812c749359a3f22a489d1.tar.lz
gsoc2013-epiphany-55ffe5b0442e58a42a5812c749359a3f22a489d1.tar.xz
gsoc2013-epiphany-55ffe5b0442e58a42a5812c749359a3f22a489d1.tar.zst
gsoc2013-epiphany-55ffe5b0442e58a42a5812c749359a3f22a489d1.zip
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
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-file-helpers.c16
-rw-r--r--lib/ephy-file-helpers.h1
2 files changed, 17 insertions, 0 deletions
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;
@@ -276,6 +277,20 @@ ephy_dot_dir (void)
}
/**
+ * 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
* @flags: the %EphyFileHelpersFlags for this session
@@ -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);