aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandni Verma <chandniverma2112@gmail.com>2011-12-02 19:04:29 +0800
committerChandni Verma <chandniverma2112@gmail.com>2012-01-28 14:49:16 +0800
commitc45bf16335ebc05661f200024d3cc4f0ecb7003f (patch)
treecd3d7e2161937a9e623f265a8ce96ce348ff12e0
parent42ee3133a0cd8ba84dc31c3f97aa98d3c6503353 (diff)
downloadgsoc2013-empathy-c45bf16335ebc05661f200024d3cc4f0ecb7003f.tar
gsoc2013-empathy-c45bf16335ebc05661f200024d3cc4f0ecb7003f.tar.gz
gsoc2013-empathy-c45bf16335ebc05661f200024d3cc4f0ecb7003f.tar.bz2
gsoc2013-empathy-c45bf16335ebc05661f200024d3cc4f0ecb7003f.tar.lz
gsoc2013-empathy-c45bf16335ebc05661f200024d3cc4f0ecb7003f.tar.xz
gsoc2013-empathy-c45bf16335ebc05661f200024d3cc4f0ecb7003f.tar.zst
gsoc2013-empathy-c45bf16335ebc05661f200024d3cc4f0ecb7003f.zip
Add incoming messages to All's buffer
https://bugzilla.gnome.org/show_bug.cgi?id=592994
-rw-r--r--src/empathy-debug-window.c48
1 files changed, 37 insertions, 11 deletions
diff --git a/src/empathy-debug-window.c b/src/empathy-debug-window.c
index beab66160..9cb32a34b 100644
--- a/src/empathy-debug-window.c
+++ b/src/empathy-debug-window.c
@@ -208,6 +208,26 @@ copy_buffered_messages (GtkTreeModel *buffer,
}
static void
+insert_values_in_buffer (GtkListStore *store,
+ gdouble timestamp,
+ const gchar *domain,
+ const gchar *category,
+ guint level,
+ const gchar *string)
+{
+ GtkTreeIter iter;
+
+ gtk_list_store_insert_with_values (store, &iter, -1,
+ COL_DEBUG_TIMESTAMP, timestamp,
+ COL_DEBUG_DOMAIN, domain,
+ COL_DEBUG_CATEGORY, category,
+ COL_DEBUG_LEVEL_STRING, log_level_to_string (level),
+ COL_DEBUG_MESSAGE, string,
+ COL_DEBUG_LEVEL_VALUE, level,
+ -1);
+}
+
+static void
debug_window_add_message (EmpathyDebugWindow *debug_window,
TpProxy *proxy,
gdouble timestamp,
@@ -217,7 +237,6 @@ debug_window_add_message (EmpathyDebugWindow *debug_window,
{
EmpathyDebugWindowPriv *priv = GET_PRIV (debug_window);
gchar *domain, *category;
- GtkTreeIter iter;
gchar *string;
GtkListStore *active_buffer, *pause_buffer;
@@ -242,16 +261,23 @@ debug_window_add_message (EmpathyDebugWindow *debug_window,
pause_buffer = g_object_get_data (G_OBJECT (proxy), "pause-buffer");
active_buffer = g_object_get_data (G_OBJECT (proxy), "active-buffer");
- gtk_list_store_append (priv->paused ? pause_buffer : active_buffer,
- &iter);
- gtk_list_store_set (priv->paused ? pause_buffer : active_buffer, &iter,
- COL_DEBUG_TIMESTAMP, timestamp,
- COL_DEBUG_DOMAIN, domain,
- COL_DEBUG_CATEGORY, category,
- COL_DEBUG_LEVEL_STRING, log_level_to_string (level),
- COL_DEBUG_MESSAGE, string,
- COL_DEBUG_LEVEL_VALUE, level,
- -1);
+ if (priv->paused)
+ {
+ insert_values_in_buffer (pause_buffer, timestamp,
+ domain, category, level,
+ string);
+ }
+ else
+ {
+ /* Append 'this' message to this service's and All's active-buffers */
+ insert_values_in_buffer (active_buffer, timestamp,
+ domain, category, level,
+ string);
+
+ insert_values_in_buffer (priv->all_active_buffer, timestamp,
+ domain, category, level,
+ string);
+ }
g_free (string);
g_free (domain);