aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-theme-adium.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-03-24 22:00:37 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-03-28 14:34:42 +0800
commit36f079ca48db4727b237ea471f13f7593c8e1b71 (patch)
tree027dc04e964652c4ef2a91a161808df3c8ed006c /libempathy-gtk/empathy-theme-adium.c
parent3935bc1bc5c5da553f74eb2db75d0a7f1444bc6d (diff)
downloadgsoc2013-empathy-36f079ca48db4727b237ea471f13f7593c8e1b71.tar
gsoc2013-empathy-36f079ca48db4727b237ea471f13f7593c8e1b71.tar.gz
gsoc2013-empathy-36f079ca48db4727b237ea471f13f7593c8e1b71.tar.bz2
gsoc2013-empathy-36f079ca48db4727b237ea471f13f7593c8e1b71.tar.lz
gsoc2013-empathy-36f079ca48db4727b237ea471f13f7593c8e1b71.tar.xz
gsoc2013-empathy-36f079ca48db4727b237ea471f13f7593c8e1b71.tar.zst
gsoc2013-empathy-36f079ca48db4727b237ea471f13f7593c8e1b71.zip
theme-adium: keep count of the pages loading instead of using a boolean
Each time theme_adium_clear() is called, WebKit has to reload the page. If we do multi calls to clear() in a short interval, we used to think the page was loaded while it was the *old* one which was actually loaded. (#645670)
Diffstat (limited to 'libempathy-gtk/empathy-theme-adium.c')
-rw-r--r--libempathy-gtk/empathy-theme-adium.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index 6844f9ac2..e7e4cbd37 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -58,7 +58,7 @@ typedef struct {
EmpathyContact *last_contact;
time_t last_timestamp;
gboolean last_is_backlog;
- gboolean page_loaded;
+ guint pages_loading;
GList *message_queue;
GtkWidget *inspector_window;
GSettings *gsettings_chat;
@@ -454,7 +454,7 @@ theme_adium_append_message (EmpathyChatView *view,
gboolean is_backlog;
gboolean consecutive;
- if (!priv->page_loaded) {
+ if (priv->pages_loading != 0) {
priv->message_queue = g_list_prepend (priv->message_queue,
g_object_ref (msg));
return;
@@ -659,7 +659,7 @@ theme_adium_clear (EmpathyChatView *view)
EmpathyThemeAdiumPriv *priv = GET_PRIV (view);
gchar *basedir_uri;
- priv->page_loaded = FALSE;
+ priv->pages_loading++;
basedir_uri = g_strconcat ("file://", priv->data->basedir, NULL);
webkit_web_view_load_html_string (WEBKIT_WEB_VIEW (view),
priv->data->template_html,
@@ -861,7 +861,10 @@ theme_adium_load_finished_cb (WebKitWebView *view,
EmpathyChatView *chat_view = EMPATHY_CHAT_VIEW (view);
DEBUG ("Page loaded");
- priv->page_loaded = TRUE;
+ priv->pages_loading--;
+
+ if (priv->pages_loading != 0)
+ return;
/* Display queued messages */
priv->message_queue = g_list_reverse (priv->message_queue);
@@ -1066,6 +1069,8 @@ theme_adium_constructed (GObject *object)
object);
/* Load template */
+ priv->pages_loading = 1;
+
basedir_uri = g_strconcat ("file://", priv->data->basedir, NULL);
webkit_web_view_load_html_string (WEBKIT_WEB_VIEW (object),
priv->data->template_html,