aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2009-03-06 19:51:55 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-03-06 19:51:55 +0800
commitd53b22689f12218cfa3b5f72fb936dd01dd08885 (patch)
tree80ab4bdc4ea0d4485ca639180e1c6fdec9f472da /libempathy
parent3e93782be91d774297b571ebcde221bf96f47cf5 (diff)
downloadgsoc2013-empathy-d53b22689f12218cfa3b5f72fb936dd01dd08885.tar
gsoc2013-empathy-d53b22689f12218cfa3b5f72fb936dd01dd08885.tar.gz
gsoc2013-empathy-d53b22689f12218cfa3b5f72fb936dd01dd08885.tar.bz2
gsoc2013-empathy-d53b22689f12218cfa3b5f72fb936dd01dd08885.tar.lz
gsoc2013-empathy-d53b22689f12218cfa3b5f72fb936dd01dd08885.tar.xz
gsoc2013-empathy-d53b22689f12218cfa3b5f72fb936dd01dd08885.tar.zst
gsoc2013-empathy-d53b22689f12218cfa3b5f72fb936dd01dd08885.zip
Added get_name function to EmpathyLogSource.
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk> svn path=/trunk/; revision=2589
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-log-source-empathy.c13
-rw-r--r--libempathy/empathy-log-source.c9
-rw-r--r--libempathy/empathy-log-source.h2
3 files changed, 24 insertions, 0 deletions
diff --git a/libempathy/empathy-log-source-empathy.c b/libempathy/empathy-log-source-empathy.c
index c48d730dc..fd744f94b 100644
--- a/libempathy/empathy-log-source-empathy.c
+++ b/libempathy/empathy-log-source-empathy.c
@@ -58,6 +58,7 @@
typedef struct
{
gchar *basedir;
+ gchar *name;
} EmpathyLogSourceEmpathyPriv;
static void log_source_iface_init (gpointer g_iface,gpointer iface_data);
@@ -73,6 +74,7 @@ log_source_empathy_finalize (GObject *object)
EmpathyLogSourceEmpathyPriv *priv = GET_PRIV (self);
g_free (priv->basedir);
+ g_free (priv->name);
}
static void
@@ -95,6 +97,8 @@ empathy_log_source_empathy_init (EmpathyLogSourceEmpathy *self)
priv->basedir = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir (),
".gnome2", PACKAGE_NAME, "logs", NULL);
+
+ priv->name = g_strdup ("Empathy");
}
static gchar *
@@ -682,12 +686,21 @@ log_source_empathy_get_chats (EmpathyLogSource *self,
return hits;
}
+static const gchar *
+log_source_empathy_get_name (EmpathyLogSource *self)
+{
+ EmpathyLogSourceEmpathyPriv *priv = GET_PRIV (self);
+
+ return priv->name;
+}
+
static void
log_source_iface_init (gpointer g_iface,
gpointer iface_data)
{
EmpathyLogSourceInterface *iface = (EmpathyLogSourceInterface *) g_iface;
+ iface->get_name = log_source_empathy_get_name;
iface->exists = log_source_empathy_exists;
iface->add_message = log_source_empathy_add_message;
iface->get_dates = log_source_empathy_get_dates;
diff --git a/libempathy/empathy-log-source.c b/libempathy/empathy-log-source.c
index 6a5e5b3b0..4080d5a6c 100644
--- a/libempathy/empathy-log-source.c
+++ b/libempathy/empathy-log-source.c
@@ -44,6 +44,15 @@ empathy_log_source_get_type (void)
return type;
}
+const gchar *
+empathy_log_source_get_name (EmpathyLogSource *self)
+{
+ if (!EMPATHY_LOG_SOURCE_GET_INTERFACE (self)->get_name)
+ return NULL;
+
+ return EMPATHY_LOG_SOURCE_GET_INTERFACE (self)->get_name (self);
+}
+
gboolean
empathy_log_source_exists (EmpathyLogSource *self,
McAccount *account,
diff --git a/libempathy/empathy-log-source.h b/libempathy/empathy-log-source.h
index c9425ef45..c00571813 100644
--- a/libempathy/empathy-log-source.h
+++ b/libempathy/empathy-log-source.h
@@ -48,6 +48,7 @@ struct _EmpathyLogSourceInterface
{
GTypeInterface parent;
+ const gchar * (*get_name) (EmpathyLogSource *self);
gboolean (*exists) (EmpathyLogSource *self, McAccount *account,
const gchar *chat_id, gboolean chatroom);
void (*add_message) (EmpathyLogSource *self, const gchar *chat_id,
@@ -68,6 +69,7 @@ struct _EmpathyLogSourceInterface
GType empathy_log_source_get_type (void) G_GNUC_CONST;
+const gchar *empathy_log_source_get_name (EmpathyLogSource *self);
gboolean empathy_log_source_exists (EmpathyLogSource *self,
McAccount *account, const gchar *chat_id, gboolean chatroom);
void empathy_log_source_add_message (EmpathyLogSource *self,