[empathy/mc5] Split out the account name to dirname translation



commit aa0487edef4dc671e99a9e4dc6a1895c0fdaca4a
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date:   Mon Aug 24 00:21:27 2009 +0100

    Split out the account name to dirname translation

 libempathy/empathy-log-store-empathy.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/libempathy/empathy-log-store-empathy.c b/libempathy/empathy-log-store-empathy.c
index fe1afd9..723ee64 100644
--- a/libempathy/empathy-log-store-empathy.c
+++ b/libempathy/empathy-log-store-empathy.c
@@ -116,6 +116,19 @@ empathy_log_store_empathy_init (EmpathyLogStoreEmpathy *self)
 }
 
 static gchar *
+log_store_account_to_dirname (EmpathyAccount *account)
+{
+  const gchar *name;
+
+  name = empathy_account_get_unique_name (account);
+  if (g_str_has_prefix (name, TP_ACCOUNT_OBJECT_PATH_BASE))
+    name += strlen (TP_ACCOUNT_OBJECT_PATH_BASE);
+
+  return g_strdelimit (g_strdup (name), "/", '_');
+}
+
+
+static gchar *
 log_store_empathy_get_dir (EmpathyLogStore *self,
                            EmpathyAccount *account,
                            const gchar *chat_id,
@@ -123,16 +136,11 @@ log_store_empathy_get_dir (EmpathyLogStore *self,
 {
   gchar *basedir;
   gchar *escaped;
-  const gchar *name;
   EmpathyLogStoreEmpathyPriv *priv;
 
   priv = GET_PRIV (self);
 
-  name = empathy_account_get_unique_name (account);
-  if (g_str_has_prefix (name, TP_ACCOUNT_OBJECT_PATH_BASE))
-    name += strlen (TP_ACCOUNT_OBJECT_PATH_BASE);
-
-  escaped = g_strdelimit (g_strdup (name), "/", '_');
+  escaped = log_store_account_to_dirname (account);
 
   if (chatroom)
     basedir = g_build_path (G_DIR_SEPARATOR_S, priv->basedir, escaped,



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