diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-05-26 15:29:12 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-05-26 15:37:34 +0200 |
commit | 26f25997a1ab3da22b3e8a4f3e2e80f8b474c340 (patch) | |
tree | 5e4419b6c2a8f3bfaf362bf792642fdc9f6ef4db | |
parent | f14ee8db79363559a333d4a9fc67ee3200d73f18 (diff) |
log-entry: move setter as internal API
-rw-r--r-- | telepathy-logger/Makefile.am | 1 | ||||
-rw-r--r-- | telepathy-logger/channel-text.c | 9 | ||||
-rw-r--r-- | telepathy-logger/log-entry-internal.h | 54 | ||||
-rw-r--r-- | telepathy-logger/log-entry.c | 51 | ||||
-rw-r--r-- | telepathy-logger/log-entry.h | 11 | ||||
-rw-r--r-- | telepathy-logger/log-store-xml.c | 7 |
6 files changed, 90 insertions, 43 deletions
diff --git a/telepathy-logger/Makefile.am b/telepathy-logger/Makefile.am index 6ee68bcdf..62057b721 100644 --- a/telepathy-logger/Makefile.am +++ b/telepathy-logger/Makefile.am @@ -50,6 +50,7 @@ libtelepathy_logger_la_SOURCES = \ debug-internal.h \ debug.c \ log-entry.c \ + log-entry-internal.h \ log-entry-text.c \ log-manager.c \ log-store.c \ diff --git a/telepathy-logger/channel-text.c b/telepathy-logger/channel-text.c index e30db1a38..32810a592 100644 --- a/telepathy-logger/channel-text.c +++ b/telepathy-logger/channel-text.c @@ -29,6 +29,7 @@ #include <telepathy-logger/channel.h> #include <telepathy-logger/observer.h> +#include <telepathy-logger/log-entry-internal.h> #include <telepathy-logger/log-entry-text.h> #include <telepathy-logger/log-manager-priv.h> #include <telepathy-logger/log-store-sqlite.h> @@ -1171,9 +1172,9 @@ on_sent_signal_cb (TpChannel *proxy, log = tpl_log_entry_text_new (log_id, account_path, TPL_LOG_ENTRY_DIRECTION_OUT); - tpl_log_entry_set_pending_msg_id (TPL_LOG_ENTRY (log), + _tpl_log_entry_set_pending_msg_id (TPL_LOG_ENTRY (log), TPL_LOG_ENTRY_MSG_ID_ACKNOWLEDGED); - tpl_log_entry_set_channel_path (TPL_LOG_ENTRY (log), channel_path); + _tpl_log_entry_set_channel_path (TPL_LOG_ENTRY (log), channel_path); tpl_log_entry_text_set_chat_id (log, chat_id); tpl_log_entry_text_set_timestamp (log, (time_t) arg_Timestamp); tpl_log_entry_text_set_signal_type (log, TPL_LOG_ENTRY_TEXT_SIGNAL_SENT); @@ -1369,8 +1370,8 @@ on_received_signal_cb (TpChannel *proxy, log = tpl_log_entry_text_new (log_id, account_path, TPL_LOG_ENTRY_DIRECTION_IN); - tpl_log_entry_set_channel_path (TPL_LOG_ENTRY (log), channel_path); - tpl_log_entry_set_pending_msg_id (TPL_LOG_ENTRY (log), arg_ID); + _tpl_log_entry_set_channel_path (TPL_LOG_ENTRY (log), channel_path); + _tpl_log_entry_set_pending_msg_id (TPL_LOG_ENTRY (log), arg_ID); tpl_log_entry_text_set_tpl_channel_text (log, tpl_text); tpl_log_entry_text_set_message (log, arg_Text); tpl_log_entry_text_set_message_type (log, arg_Type); diff --git a/telepathy-logger/log-entry-internal.h b/telepathy-logger/log-entry-internal.h new file mode 100644 index 000000000..352fdb44d --- /dev/null +++ b/telepathy-logger/log-entry-internal.h @@ -0,0 +1,54 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 2009 Collabora Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Authors: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> + */ + +#ifndef __TPL_LOG_ENTRY_INTERNAL_H__ +#define __TPL_LOG_ENTRY_INTERNAL_H__ + +#include <telepathy-logger/log-entry.h> + +G_BEGIN_DECLS + +void _tpl_log_entry_set_timestamp (TplLogEntry *self, + gint64 data); + +void _tpl_log_entry_set_pending_msg_id (TplLogEntry *self, + gint data); + +void _tpl_log_entry_set_signal_type (TplLogEntry *self, + TplLogEntrySignalType data); + +void _tpl_log_entry_set_direction (TplLogEntry *self, + TplLogEntryDirection data); + +void _tpl_log_entry_set_chat_id (TplLogEntry *self, + const gchar *data); + +void _tpl_log_entry_set_channel_path (TplLogEntry *self, + const gchar *data); + +void _tpl_log_entry_set_sender (TplLogEntry *self, + TplContact *data); + +void _tpl_log_entry_set_receiver (TplLogEntry *self, + TplContact *data); + +G_END_DECLS +#endif // __TPL_LOG_ENTRY_INTERNAL_H__ diff --git a/telepathy-logger/log-entry.c b/telepathy-logger/log-entry.c index 4c95e334a..f717287a7 100644 --- a/telepathy-logger/log-entry.c +++ b/telepathy-logger/log-entry.c @@ -20,6 +20,7 @@ #include "config.h" #include "log-entry.h" +#include "log-entry-internal.h" #include <glib.h> #include <telepathy-glib/util.h> @@ -57,7 +58,7 @@ * TPL_LOG_ENTRY_MSG_ID_UNKNOWN: * * Special value used instead of a message ID to indicate a message with an - * unknown status (before tpl_log_entry_set_pending_msg_id() was called, or + * unknown status (before _tpl_log_entry_set_pending_msg_id() was called, or * when it wasn't possible to obtain the message ID). */ @@ -203,34 +204,34 @@ tpl_log_entry_set_property (GObject *object, switch (param_id) { case PROP_TIMESTAMP: - tpl_log_entry_set_timestamp (self, g_value_get_uint (value)); + _tpl_log_entry_set_timestamp (self, g_value_get_uint (value)); break; case PROP_SIGNAL_TYPE: - tpl_log_entry_set_signal_type (self, g_value_get_uint (value)); + _tpl_log_entry_set_signal_type (self, g_value_get_uint (value)); break; case PROP_PENDING_MSG_ID: - tpl_log_entry_set_pending_msg_id (self, g_value_get_int (value)); + _tpl_log_entry_set_pending_msg_id (self, g_value_get_int (value)); break; case PROP_LOG_ID: tpl_log_entry_set_log_id (self, g_value_get_string (value)); break; case PROP_DIRECTION: - tpl_log_entry_set_direction (self, g_value_get_uint (value)); + _tpl_log_entry_set_direction (self, g_value_get_uint (value)); break; case PROP_CHAT_ID: - tpl_log_entry_set_chat_id (self, g_value_get_string (value)); + _tpl_log_entry_set_chat_id (self, g_value_get_string (value)); break; case PROP_ACCOUNT_PATH: tpl_log_entry_set_account_path (self, g_value_get_string (value)); break; case PROP_CHANNEL_PATH: - tpl_log_entry_set_channel_path (self, g_value_get_string (value)); + _tpl_log_entry_set_channel_path (self, g_value_get_string (value)); break; case PROP_SENDER: - tpl_log_entry_set_sender (self, g_value_get_object (value)); + _tpl_log_entry_set_sender (self, g_value_get_object (value)); break; case PROP_RECEIVER: - tpl_log_entry_set_receiver (self, g_value_get_object (value)); + _tpl_log_entry_set_receiver (self, g_value_get_object (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); @@ -262,13 +263,13 @@ tpl_log_entry_class_init (TplLogEntryClass *klass) klass->is_pending = tpl_log_entry_is_pending; klass->equal = NULL; - klass->set_timestamp = tpl_log_entry_set_timestamp; - klass->set_signal_type = tpl_log_entry_set_signal_type; - klass->set_direction = tpl_log_entry_set_direction; - klass->set_sender = tpl_log_entry_set_sender; - klass->set_receiver = tpl_log_entry_set_receiver; - klass->set_chat_id = tpl_log_entry_set_chat_id; - klass->set_pending_msg_id = tpl_log_entry_set_pending_msg_id; + klass->set_timestamp = _tpl_log_entry_set_timestamp; + klass->set_signal_type = _tpl_log_entry_set_signal_type; + klass->set_direction = _tpl_log_entry_set_direction; + klass->set_sender = _tpl_log_entry_set_sender; + klass->set_receiver = _tpl_log_entry_set_receiver; + klass->set_chat_id = _tpl_log_entry_set_chat_id; + klass->set_pending_msg_id = _tpl_log_entry_set_pending_msg_id; param_spec = g_param_spec_uint ("timestamp", "Timestamp", @@ -488,7 +489,7 @@ tpl_log_entry_get_channel_path (TplLogEntry *self) void -tpl_log_entry_set_timestamp (TplLogEntry *self, +_tpl_log_entry_set_timestamp (TplLogEntry *self, gint64 data) { g_return_if_fail (TPL_IS_LOG_ENTRY (self)); @@ -499,7 +500,7 @@ tpl_log_entry_set_timestamp (TplLogEntry *self, void -tpl_log_entry_set_signal_type (TplLogEntry *self, +_tpl_log_entry_set_signal_type (TplLogEntry *self, TplLogEntrySignalType data) { g_return_if_fail (TPL_IS_LOG_ENTRY (self)); @@ -509,7 +510,7 @@ tpl_log_entry_set_signal_type (TplLogEntry *self, } /** - * tpl_log_entry_set_pending_msg_id: + * _tpl_log_entry_set_pending_msg_id: * @self: TplLogentry instance * @data: the pending message ID * @@ -518,7 +519,7 @@ tpl_log_entry_set_signal_type (TplLogEntry *self, * @see_also: #TplLogEntry::pending-msg-id for special values. */ void -tpl_log_entry_set_pending_msg_id (TplLogEntry *self, +_tpl_log_entry_set_pending_msg_id (TplLogEntry *self, gint data) { g_return_if_fail (TPL_IS_LOG_ENTRY (self)); @@ -543,7 +544,7 @@ tpl_log_entry_set_log_id (TplLogEntry *self, void -tpl_log_entry_set_direction (TplLogEntry *self, +_tpl_log_entry_set_direction (TplLogEntry *self, TplLogEntryDirection data) { g_return_if_fail (TPL_IS_LOG_ENTRY (self)); @@ -554,7 +555,7 @@ tpl_log_entry_set_direction (TplLogEntry *self, void -tpl_log_entry_set_sender (TplLogEntry *self, +_tpl_log_entry_set_sender (TplLogEntry *self, TplContact *data) { TplLogEntryPriv *priv; @@ -572,7 +573,7 @@ tpl_log_entry_set_sender (TplLogEntry *self, void -tpl_log_entry_set_receiver (TplLogEntry *self, +_tpl_log_entry_set_receiver (TplLogEntry *self, TplContact *data) { TplLogEntryPriv *priv; @@ -592,7 +593,7 @@ tpl_log_entry_set_receiver (TplLogEntry *self, void -tpl_log_entry_set_chat_id (TplLogEntry *self, +_tpl_log_entry_set_chat_id (TplLogEntry *self, const gchar *data) { g_return_if_fail (TPL_IS_LOG_ENTRY (self)); @@ -618,7 +619,7 @@ tpl_log_entry_set_account_path (TplLogEntry *self, void -tpl_log_entry_set_channel_path (TplLogEntry *self, +_tpl_log_entry_set_channel_path (TplLogEntry *self, const gchar *data) { g_return_if_fail (TPL_IS_LOG_ENTRY (self)); diff --git a/telepathy-logger/log-entry.h b/telepathy-logger/log-entry.h index 6d62d7581..ab58dea46 100644 --- a/telepathy-logger/log-entry.h +++ b/telepathy-logger/log-entry.h @@ -126,17 +126,6 @@ TplLogEntryDirection tpl_log_entry_get_direction (TplLogEntry *self); TplContact *tpl_log_entry_get_sender (TplLogEntry *self); TplContact *tpl_log_entry_get_receiver (TplLogEntry *self); -void tpl_log_entry_set_timestamp (TplLogEntry *self, gint64 data); -void tpl_log_entry_set_pending_msg_id (TplLogEntry *self, gint data); -void tpl_log_entry_set_signal_type (TplLogEntry *self, - TplLogEntrySignalType data); -void tpl_log_entry_set_direction (TplLogEntry *self, - TplLogEntryDirection data); -void tpl_log_entry_set_chat_id (TplLogEntry *self, const gchar *data); -void tpl_log_entry_set_channel_path (TplLogEntry *self, const gchar *data); -void tpl_log_entry_set_sender (TplLogEntry *self, TplContact *data); -void tpl_log_entry_set_receiver (TplLogEntry *self, TplContact *data); - gboolean tpl_log_entry_equal (TplLogEntry *self, TplLogEntry *data); diff --git a/telepathy-logger/log-store-xml.c b/telepathy-logger/log-store-xml.c index 88c79a59a..9824ef31a 100644 --- a/telepathy-logger/log-store-xml.c +++ b/telepathy-logger/log-store-xml.c @@ -40,6 +40,7 @@ #include <telepathy-glib/defs.h> #include <telepathy-glib/util.h> +#include <telepathy-logger/log-entry-internal.h> #include <telepathy-logger/log-entry-text.h> #include <telepathy-logger/log-manager.h> #include <telepathy-logger/log-store.h> @@ -850,9 +851,9 @@ log_store_xml_get_messages_for_file (TplLogStoreXml *self, message = tpl_log_entry_text_new (log_id, tp_proxy_get_object_path (account), TPL_LOG_ENTRY_DIRECTION_NONE); - tpl_log_entry_set_pending_msg_id (TPL_LOG_ENTRY (message), pending_id); - tpl_log_entry_set_sender (TPL_LOG_ENTRY (message), sender); - tpl_log_entry_set_timestamp (TPL_LOG_ENTRY (message), t); + _tpl_log_entry_set_pending_msg_id (TPL_LOG_ENTRY (message), pending_id); + _tpl_log_entry_set_sender (TPL_LOG_ENTRY (message), sender); + _tpl_log_entry_set_timestamp (TPL_LOG_ENTRY (message), t); tpl_log_entry_text_set_message (message, body); tpl_log_entry_text_set_message_type (message, msg_type); |