[epiphany] ephy-file-helpers: add ephy_dot_dir_is_default()



commit 55ffe5b0442e58a42a5812c749359a3f22a489d1
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Mon Sep 3 17:01:13 2012 +0300

    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(+), 0 deletions(-)
---
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 4bbe0c9..628d3b1 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 bf52f75..f7564b5 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);



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