diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2009-02-06 15:25:37 +0000 |
---|---|---|
committer | Jonny Lamb <jonnylamb@gnome.org> | 2009-11-29 15:48:14 +0000 |
commit | 2d609621f80f7b94fe8de604db23966bba67b31d (patch) | |
tree | 2052fae4f735afe79827083c52b11fa843d0cbd5 | |
parent | 724ab8d06d4c528ff804e74e210c86347d4ae1c6 (diff) |
Renamed functions from log_source to log_store.
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r-- | libempathy/empathy-log-manager.c | 2 | ||||
-rw-r--r-- | libempathy/empathy-log-store-pidgin.c | 106 | ||||
-rw-r--r-- | libempathy/empathy-log-store-pidgin.h | 46 |
3 files changed, 77 insertions, 77 deletions
diff --git a/libempathy/empathy-log-manager.c b/libempathy/empathy-log-manager.c index 11e00555b..1669bbbf5 100644 --- a/libempathy/empathy-log-manager.c +++ b/libempathy/empathy-log-manager.c @@ -89,7 +89,7 @@ log_manager_constructor (GType type, g_object_new (EMPATHY_TYPE_LOG_STORE_EMPATHY, NULL)); priv->stores = g_list_append (priv->stores, - g_object_new (EMPATHY_TYPE_LOG_SOURCE_PIDGIN, NULL)); + g_object_new (EMPATHY_TYPE_LOG_STORE_PIDGIN, NULL)); } return retval; diff --git a/libempathy/empathy-log-store-pidgin.c b/libempathy/empathy-log-store-pidgin.c index d0f53632c..1800fe401 100644 --- a/libempathy/empathy-log-store-pidgin.c +++ b/libempathy/empathy-log-store-pidgin.c @@ -40,41 +40,41 @@ #define TXT_LOG_FILENAME_SUFFIX ".txt" -#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyLogSourcePidgin) +#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyLogStorePidgin) typedef struct { gchar *basedir; -} EmpathyLogSourcePidginPriv; +} EmpathyLogStorePidginPriv; -static void log_source_iface_init (gpointer g_iface,gpointer iface_data); +static void log_store_iface_init (gpointer g_iface,gpointer iface_data); -G_DEFINE_TYPE_WITH_CODE (EmpathyLogSourcePidgin, empathy_log_source_pidgin, - G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (EMPATHY_TYPE_LOG_SOURCE, - log_source_iface_init)); +G_DEFINE_TYPE_WITH_CODE (EmpathyLogStorePidgin, empathy_log_store_pidgin, + G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (EMPATHY_TYPE_LOG_STORE, + log_store_iface_init)); static void -log_source_pidgin_finalize (GObject *object) +log_store_pidgin_finalize (GObject *object) { - EmpathyLogSourcePidginPriv *priv = GET_PRIV (object); + EmpathyLogStorePidginPriv *priv = GET_PRIV (object); g_free (priv->basedir); } static void -empathy_log_source_pidgin_class_init (EmpathyLogSourcePidginClass *klass) +empathy_log_store_pidgin_class_init (EmpathyLogStorePidginClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->finalize = log_source_pidgin_finalize; + object_class->finalize = log_store_pidgin_finalize; - g_type_class_add_private (object_class, sizeof (EmpathyLogSourcePidginPriv)); + g_type_class_add_private (object_class, sizeof (EmpathyLogStorePidginPriv)); } static void -empathy_log_source_pidgin_init (EmpathyLogSourcePidgin *self) +empathy_log_store_pidgin_init (EmpathyLogStorePidgin *self) { - EmpathyLogSourcePidginPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (self, - EMPATHY_TYPE_LOG_SOURCE_PIDGIN, EmpathyLogSourcePidginPriv); + EmpathyLogStorePidginPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (self, + EMPATHY_TYPE_LOG_STORE_PIDGIN, EmpathyLogStorePidginPriv); self->priv = priv; @@ -83,7 +83,7 @@ empathy_log_source_pidgin_init (EmpathyLogSourcePidgin *self) } static gchar * -log_source_pidgin_get_dir (EmpathyLogSource *self, +log_store_pidgin_get_dir (EmpathyLogStore *self, McAccount *account, const gchar *chat_id, gboolean chatroom) @@ -91,7 +91,7 @@ log_source_pidgin_get_dir (EmpathyLogSource *self, const gchar *protocol; gchar *basedir; McProfile *profile; - EmpathyLogSourcePidginPriv *priv; + EmpathyLogStorePidginPriv *priv; gchar *username; gchar *id; @@ -127,7 +127,7 @@ log_source_pidgin_get_dir (EmpathyLogSource *self, } static gboolean -log_source_pidgin_exists (EmpathyLogSource *self, +log_store_pidgin_exists (EmpathyLogStore *self, McAccount *account, const gchar *chat_id, gboolean chatroom) @@ -135,7 +135,7 @@ log_source_pidgin_exists (EmpathyLogSource *self, gchar *dir; gboolean exists; - dir = log_source_pidgin_get_dir (self, account, chat_id, chatroom); + dir = log_store_pidgin_get_dir (self, account, chat_id, chatroom); if (dir) exists = g_file_test (dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR); @@ -148,7 +148,7 @@ log_source_pidgin_exists (EmpathyLogSource *self, } static gchar * -log_source_pidgin_get_time (const gchar *filename) +log_store_pidgin_get_time (const gchar *filename) { gchar *date; const gchar *p; @@ -183,7 +183,7 @@ log_source_pidgin_get_time (const gchar *filename) } static GList * -log_source_pidgin_get_dates (EmpathyLogSource *self, +log_store_pidgin_get_dates (EmpathyLogStore *self, McAccount *account, const gchar *chat_id, gboolean chatroom) @@ -194,11 +194,11 @@ log_source_pidgin_get_dates (EmpathyLogSource *self, GDir *dir; const gchar *filename; - g_return_val_if_fail (EMPATHY_IS_LOG_SOURCE (self), NULL); + g_return_val_if_fail (EMPATHY_IS_LOG_STORE (self), NULL); g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL); g_return_val_if_fail (chat_id != NULL, NULL); - directory = log_source_pidgin_get_dir (self, account, chat_id, chatroom); + directory = log_store_pidgin_get_dir (self, account, chat_id, chatroom); if (!directory) { @@ -221,7 +221,7 @@ log_source_pidgin_get_dates (EmpathyLogSource *self, if (!g_str_has_suffix (filename, TXT_LOG_FILENAME_SUFFIX)) continue; - date = log_source_pidgin_get_time (filename); + date = log_store_pidgin_get_time (filename); dates = g_list_insert_sorted (dates, date, (GCompareFunc) strcmp); } @@ -234,7 +234,7 @@ log_source_pidgin_get_dates (EmpathyLogSource *self, } static gchar * -log_source_pidgin_get_filename_for_date (EmpathyLogSource *self, +log_store_pidgin_get_filename_for_date (EmpathyLogStore *self, McAccount *account, const gchar *chat_id, gboolean chatroom, @@ -248,7 +248,7 @@ log_source_pidgin_get_filename_for_date (EmpathyLogSource *self, const gchar *dirfile; gboolean found = FALSE; - basedir = log_source_pidgin_get_dir (self, account, chat_id, chatroom); + basedir = log_store_pidgin_get_dir (self, account, chat_id, chatroom); if (!basedir) return NULL; @@ -290,7 +290,7 @@ log_source_pidgin_get_filename_for_date (EmpathyLogSource *self, } static EmpathyLogSearchHit * -log_source_pidgin_search_hit_new (EmpathyLogSource *self, +log_store_pidgin_search_hit_new (EmpathyLogStore *self, const gchar *filename) { EmpathyLogSearchHit *hit; @@ -308,7 +308,7 @@ log_source_pidgin_search_hit_new (EmpathyLogSource *self, len = g_strv_length (strv); hit = g_slice_new0 (EmpathyLogSearchHit); - hit->date = log_source_pidgin_get_time (strv[len-1]); + hit->date = log_store_pidgin_get_time (strv[len-1]); hit->chat_id = g_strdup (strv[len-2]); hit->is_chatroom = FALSE; /* TODO: fix this */ hit->filename = g_strdup (filename); @@ -360,7 +360,7 @@ log_source_pidgin_search_hit_new (EmpathyLogSource *self, } static GList * -log_source_pidgin_get_messages_for_file (EmpathyLogSource *self, +log_store_pidgin_get_messages_for_file (EmpathyLogStore *self, const gchar *filename) { GList *messages = NULL; @@ -383,7 +383,7 @@ log_source_pidgin_get_messages_for_file (EmpathyLogSource *self, gchar *own_user = NULL; gchar *protocol = NULL; - g_return_val_if_fail (EMPATHY_IS_LOG_SOURCE (self), NULL); + g_return_val_if_fail (EMPATHY_IS_LOG_STORE (self), NULL); g_return_val_if_fail (filename != NULL, NULL); DEBUG ("Attempting to parse filename:'%s'...", filename); @@ -394,7 +394,7 @@ log_source_pidgin_get_messages_for_file (EmpathyLogSource *self, return NULL; } - hit = log_source_pidgin_search_hit_new (self, filename); + hit = log_store_pidgin_search_hit_new (self, filename); account = g_object_ref (hit->account); empathy_log_manager_search_hit_free (hit); @@ -510,14 +510,14 @@ log_source_pidgin_get_messages_for_file (EmpathyLogSource *self, } static GList * -log_source_pidgin_get_all_files (EmpathyLogSource *self, +log_store_pidgin_get_all_files (EmpathyLogStore *self, const gchar *dir) { GDir *gdir; GList *files = NULL; const gchar *name; const gchar *basedir; - EmpathyLogSourcePidginPriv *priv; + EmpathyLogStorePidginPriv *priv; priv = GET_PRIV (self); @@ -541,7 +541,7 @@ log_source_pidgin_get_all_files (EmpathyLogSource *self, if (g_file_test (filename, G_FILE_TEST_IS_DIR)) { files = g_list_concat (files, - log_source_pidgin_get_all_files (self, filename)); + log_store_pidgin_get_all_files (self, filename)); } g_free (filename); @@ -553,19 +553,19 @@ log_source_pidgin_get_all_files (EmpathyLogSource *self, } static GList * -log_source_pidgin_search_new (EmpathyLogSource *self, +log_store_pidgin_search_new (EmpathyLogStore *self, const gchar *text) { GList *files, *l; GList *hits = NULL; gchar *text_casefold; - g_return_val_if_fail (EMPATHY_IS_LOG_SOURCE (self), NULL); + g_return_val_if_fail (EMPATHY_IS_LOG_STORE (self), NULL); g_return_val_if_fail (!G_STR_EMPTY (text), NULL); text_casefold = g_utf8_casefold (text, -1); - files = log_source_pidgin_get_all_files (self, NULL); + files = log_store_pidgin_get_all_files (self, NULL); DEBUG ("Found %d log files in total", g_list_length (files)); for (l = files; l; l = l->next) @@ -592,7 +592,7 @@ log_source_pidgin_search_new (EmpathyLogSource *self, { EmpathyLogSearchHit *hit; - hit = log_source_pidgin_search_hit_new (self, filename); + hit = log_store_pidgin_search_hit_new (self, filename); if (hit) { @@ -613,7 +613,7 @@ log_source_pidgin_search_new (EmpathyLogSource *self, } static GList * -log_source_pidgin_get_chats_for_dir (EmpathyLogSource *self, +log_store_pidgin_get_chats_for_dir (EmpathyLogStore *self, const gchar *dir, gboolean is_chatroom) { @@ -642,7 +642,7 @@ log_source_pidgin_get_chats_for_dir (EmpathyLogSource *self, } static GList * -log_source_pidgin_get_messages_for_date (EmpathyLogSource *self, +log_store_pidgin_get_messages_for_date (EmpathyLogStore *self, McAccount *account, const gchar *chat_id, gboolean chatroom, @@ -651,36 +651,36 @@ log_source_pidgin_get_messages_for_date (EmpathyLogSource *self, gchar *filename; GList *messages; - g_return_val_if_fail (EMPATHY_IS_LOG_SOURCE (self), NULL); + g_return_val_if_fail (EMPATHY_IS_LOG_STORE (self), NULL); g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL); g_return_val_if_fail (chat_id != NULL, NULL); - filename = log_source_pidgin_get_filename_for_date (self, account, + filename = log_store_pidgin_get_filename_for_date (self, account, chat_id, chatroom, date); if (!filename) return NULL; - messages = log_source_pidgin_get_messages_for_file (self, filename); + messages = log_store_pidgin_get_messages_for_file (self, filename); g_free (filename); return messages; } static GList * -log_source_pidgin_get_chats (EmpathyLogSource *self, +log_store_pidgin_get_chats (EmpathyLogStore *self, McAccount *account) { gchar *dir; GList *hits; - EmpathyLogSourcePidginPriv *priv; + EmpathyLogStorePidginPriv *priv; priv = GET_PRIV (self); - dir = log_source_pidgin_get_dir (self, account, NULL, FALSE); + dir = log_store_pidgin_get_dir (self, account, NULL, FALSE); if (dir) - hits = log_source_pidgin_get_chats_for_dir (self, dir, FALSE); + hits = log_store_pidgin_get_chats_for_dir (self, dir, FALSE); else hits = NULL; @@ -690,16 +690,16 @@ log_source_pidgin_get_chats (EmpathyLogSource *self, } static void -log_source_iface_init (gpointer g_iface, +log_store_iface_init (gpointer g_iface, gpointer iface_data) { - EmpathyLogSourceInterface *iface = (EmpathyLogSourceInterface *) g_iface; + EmpathyLogStoreInterface *iface = (EmpathyLogStoreInterface *) g_iface; - iface->exists = log_source_pidgin_exists; + iface->exists = log_store_pidgin_exists; iface->add_message = NULL; - iface->get_dates = log_source_pidgin_get_dates; - iface->get_messages_for_date = log_source_pidgin_get_messages_for_date; - iface->get_chats = log_source_pidgin_get_chats; - iface->search_new = log_source_pidgin_search_new; + iface->get_dates = log_store_pidgin_get_dates; + iface->get_messages_for_date = log_store_pidgin_get_messages_for_date; + iface->get_chats = log_store_pidgin_get_chats; + iface->search_new = log_store_pidgin_search_new; iface->ack_message = NULL; } diff --git a/libempathy/empathy-log-store-pidgin.h b/libempathy/empathy-log-store-pidgin.h index 490035deb..b947a0487 100644 --- a/libempathy/empathy-log-store-pidgin.h +++ b/libempathy/empathy-log-store-pidgin.h @@ -20,45 +20,45 @@ * Authors: Jonny Lamb <jonny.lamb@collabora.co.uk> */ -#ifndef __EMPATHY_LOG_SOURCE_PIDGIN_H__ -#define __EMPATHY_LOG_SOURCE_PIDGIN_H__ +#ifndef __EMPATHY_LOG_STORE_PIDGIN_H__ +#define __EMPATHY_LOG_STORE_PIDGIN_H__ #include <glib.h> G_BEGIN_DECLS -#define EMPATHY_TYPE_LOG_SOURCE_PIDGIN \ - (empathy_log_source_pidgin_get_type ()) -#define EMPATHY_LOG_SOURCE_PIDGIN(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMPATHY_TYPE_LOG_SOURCE_PIDGIN, \ - EmpathyLogSourcePidgin)) -#define EMPATHY_LOG_SOURCE_PIDGIN_CLASS(vtable) \ - (G_TYPE_CHECK_CLASS_CAST ((vtable), EMPATHY_TYPE_LOG_SOURCE_PIDGIN, \ - EmpathyLogSourcePidginClass)) -#define EMPATHY_IS_LOG_SOURCE_PIDGIN(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMPATHY_TYPE_LOG_SOURCE_PIDGIN)) -#define EMPATHY_IS_LOG_SOURCE_PIDGIN_CLASS(vtable) \ - (G_TYPE_CHECK_CLASS_TYPE ((vtable), EMPATHY_TYPE_LOG_SOURCE_PIDGIN)) -#define EMPATHY_LOG_SOURCE_PIDGIN_GET_CLASS(inst) \ - (G_TYPE_INSTANCE_GET_CLASS ((inst), EMPATHY_TYPE_LOG_SOURCE_PIDGIN, \ - EmpathyLogSourcePidginClass)) +#define EMPATHY_TYPE_LOG_STORE_PIDGIN \ + (empathy_log_store_pidgin_get_type ()) +#define EMPATHY_LOG_STORE_PIDGIN(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMPATHY_TYPE_LOG_STORE_PIDGIN, \ + EmpathyLogStorePidgin)) +#define EMPATHY_LOG_STORE_PIDGIN_CLASS(vtable) \ + (G_TYPE_CHECK_CLASS_CAST ((vtable), EMPATHY_TYPE_LOG_STORE_PIDGIN, \ + EmpathyLogStorePidginClass)) +#define EMPATHY_IS_LOG_STORE_PIDGIN(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMPATHY_TYPE_LOG_STORE_PIDGIN)) +#define EMPATHY_IS_LOG_STORE_PIDGIN_CLASS(vtable) \ + (G_TYPE_CHECK_CLASS_TYPE ((vtable), EMPATHY_TYPE_LOG_STORE_PIDGIN)) +#define EMPATHY_LOG_STORE_PIDGIN_GET_CLASS(inst) \ + (G_TYPE_INSTANCE_GET_CLASS ((inst), EMPATHY_TYPE_LOG_STORE_PIDGIN, \ + EmpathyLogStorePidginClass)) -typedef struct _EmpathyLogSourcePidgin EmpathyLogSourcePidgin; -typedef struct _EmpathyLogSourcePidginClass EmpathyLogSourcePidginClass; +typedef struct _EmpathyLogStorePidgin EmpathyLogStorePidgin; +typedef struct _EmpathyLogStorePidginClass EmpathyLogStorePidginClass; -struct _EmpathyLogSourcePidgin +struct _EmpathyLogStorePidgin { GObject parent; gpointer priv; }; -struct _EmpathyLogSourcePidginClass +struct _EmpathyLogStorePidginClass { GObjectClass parent; }; -GType empathy_log_source_pidgin_get_type (void); +GType empathy_log_store_pidgin_get_type (void); G_END_DECLS -#endif /* __EMPATHY_LOG_SOURCE_PIDGIN_H__ */ +#endif /* __EMPATHY_LOG_STORE_PIDGIN_H__ */ |