/soc/2013/ankitkv/gobjectification: a4d13be287e0: Merged default...

Ankit Vani a at nevitus.org
Sat Feb 1 20:00:37 EST 2014


Changeset: a4d13be287e01a3cc49f56a614a41d3e1ddccf57
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-02-02 06:30 +0530
Branch:	 gtkdoc-conversion
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/a4d13be287e0

Description:

Merged default branch

diffstat:

 libpurple/http.c      |   3 +-
 pidgin/gtksmiley.c    |  56 ++++++++++++++++++++++++++++++++------------------
 pidgin/gtksmiley.h    |  10 ++++----
 pidgin/smileyparser.c |   4 ++-
 4 files changed, 46 insertions(+), 27 deletions(-)

diffs (220 lines):

diff --git a/libpurple/http.c b/libpurple/http.c
--- a/libpurple/http.c
+++ b/libpurple/http.c
@@ -305,13 +305,14 @@ static time_t purple_http_rfc1123_to_tim
 		g_match_info_free(match_info);
 		return 0;
 	}
-	g_match_info_free(match_info);
 
 	d_date = g_match_info_fetch(match_info, 1);
 	d_month = g_match_info_fetch(match_info, 2);
 	d_year = g_match_info_fetch(match_info, 3);
 	d_time = g_match_info_fetch(match_info, 4);
 
+	g_match_info_free(match_info);
+
 	month = 0;
 	while (months[month] != NULL)
 	{
diff --git a/pidgin/gtksmiley.c b/pidgin/gtksmiley.c
--- a/pidgin/gtksmiley.c
+++ b/pidgin/gtksmiley.c
@@ -33,9 +33,9 @@
 #include "notify.h"
 #include "smiley.h"
 
-#include "gtkimhtml.h"
 #include "gtksmiley.h"
 #include "gtkutils.h"
+#include "gtkwebview.h"
 #include "pidginstock.h"
 
 #include "gtk3compat.h"
@@ -88,38 +88,49 @@ pidgin_smiley_destroy(PidginSmiley *smil
 }
 
 /******************************************************************************
- * GtkIMHtmlSmileys stuff
+ * GtkWebViewSmileys stuff
  *****************************************************************************/
 /* Perhaps these should be in gtkimhtml.c instead. -- sadrul */
-static void add_gtkimhtml_to_list(GtkIMHtmlSmiley *gtksmiley)
+static void add_gtkimhtml_to_list(GtkWebViewSmiley *gtksmiley)
 {
 	gtk_smileys = g_slist_prepend(gtk_smileys, gtksmiley);
 
-	purple_debug_info("gtksmiley", "adding %s to gtk_smileys\n", gtksmiley->smile);
+	purple_debug_info("gtksmiley", "adding %s to gtk_smileys",
+		gtk_webview_smiley_get_smile(gtksmiley));
 }
 
 static void
-shortcut_changed_cb(PurpleSmiley *smiley, gpointer dontcare, GtkIMHtmlSmiley *gtksmiley)
+shortcut_changed_cb(PurpleSmiley *smiley, gpointer dontcare,
+	GtkWebViewSmiley *gtksmiley)
 {
+#if 0
 	g_free(gtksmiley->smile);
 	gtksmiley->smile = g_strdup(purple_smiley_get_shortcut(smiley));
+#else
+	purple_debug_fatal("gtksmiley", "shortcut_changed_cb not implemented");
+#endif
 }
 
 static void
-image_changed_cb(PurpleSmiley *smiley, gpointer dontcare, GtkIMHtmlSmiley *gtksmiley)
+image_changed_cb(PurpleSmiley *smiley, gpointer dontcare,
+	GtkWebViewSmiley *gtksmiley)
 {
+#if 0
 	const char *file;
 
 	g_free(gtksmiley->file);
 
 	file = purple_imgstore_get_filename(purple_smiley_get_stored_image(smiley));
 	gtksmiley->file = g_build_filename(purple_smileys_get_storing_dir(), file, NULL);
-	gtk_imhtml_smiley_reload(gtksmiley);
+	gtk_webview_smiley_reload(gtksmiley);
+#else
+	purple_debug_fatal("gtksmiley", "image_changed_cb not implemented");
+#endif
 }
 
-static GtkIMHtmlSmiley *smiley_purple_to_gtkimhtml(PurpleSmiley *smiley)
+static GtkWebViewSmiley *smiley_purple_to_gtkimhtml(PurpleSmiley *smiley)
 {
-	GtkIMHtmlSmiley *gtksmiley;
+	GtkWebViewSmiley *gtksmiley;
 	gchar *filename;
 	const gchar *file;
 
@@ -127,11 +138,13 @@ static GtkIMHtmlSmiley *smiley_purple_to
 
 	filename = g_build_filename(purple_smileys_get_storing_dir(), file, NULL);
 
-	gtksmiley = gtk_imhtml_smiley_create(filename, purple_smiley_get_shortcut(smiley),
-			FALSE, GTK_IMHTML_SMILEY_CUSTOM);
+	gtksmiley = gtk_webview_smiley_create(filename,
+		purple_smiley_get_shortcut(smiley), FALSE,
+		GTK_WEBVIEW_SMILEY_CUSTOM);
 	g_free(filename);
 
-	/* Make sure the shortcut for the GtkIMHtmlSmiley is updated with the PurpleSmiley */
+	/* Make sure the shortcut for the GtkWebViewSmiley is updated with
+	 * the PurpleSmiley */
 	g_signal_connect(G_OBJECT(smiley), "notify::shortcut",
 			G_CALLBACK(shortcut_changed_cb), gtksmiley);
 
@@ -145,7 +158,7 @@ static GtkIMHtmlSmiley *smiley_purple_to
 void pidgin_smiley_del_from_list(PurpleSmiley *smiley)
 {
 	GSList *list = NULL;
-	GtkIMHtmlSmiley *gtksmiley;
+	GtkWebViewSmiley *gtksmiley;
 
 	if (gtk_smileys == NULL)
 		return;
@@ -153,12 +166,15 @@ void pidgin_smiley_del_from_list(PurpleS
 	list = gtk_smileys;
 
 	for (; list; list = list->next) {
-		gtksmiley = (GtkIMHtmlSmiley*)list->data;
+		gtksmiley = (GtkWebViewSmiley*)list->data;
 
-		if (strcmp(gtksmiley->smile, purple_smiley_get_shortcut(smiley)))
+		if (strcmp(gtk_webview_smiley_get_smile(gtksmiley),
+			purple_smiley_get_shortcut(smiley)))
+		{
 			continue;
+		}
 
-		gtk_imhtml_smiley_destroy(gtksmiley);
+		gtk_webview_smiley_destroy(gtksmiley);
 		g_signal_handlers_disconnect_matched(G_OBJECT(smiley), G_SIGNAL_MATCH_DATA,
 				0, 0, NULL, NULL, gtksmiley);
 		break;
@@ -170,7 +186,7 @@ void pidgin_smiley_del_from_list(PurpleS
 
 void pidgin_smiley_add_to_list(PurpleSmiley *smiley)
 {
-	GtkIMHtmlSmiley *gtksmiley;
+	GtkWebViewSmiley *gtksmiley;
 
 	gtksmiley = smiley_purple_to_gtkimhtml(smiley);
 	add_gtkimhtml_to_list(gtksmiley);
@@ -197,7 +213,7 @@ void pidgin_smileys_init(void)
 void pidgin_smileys_uninit(void)
 {
 	GSList *list;
-	GtkIMHtmlSmiley *gtksmiley;
+	GtkWebViewSmiley *gtksmiley;
 
 	list = gtk_smileys;
 
@@ -205,8 +221,8 @@ void pidgin_smileys_uninit(void)
 		return;
 
 	for (; list; list = g_slist_delete_link(list, list)) {
-		gtksmiley = (GtkIMHtmlSmiley*)list->data;
-		gtk_imhtml_smiley_destroy(gtksmiley);
+		gtksmiley = (GtkWebViewSmiley*)list->data;
+		gtk_webview_smiley_destroy(gtksmiley);
 	}
 
 	gtk_smileys = NULL;
diff --git a/pidgin/gtksmiley.h b/pidgin/gtksmiley.h
--- a/pidgin/gtksmiley.h
+++ b/pidgin/gtksmiley.h
@@ -34,7 +34,7 @@ typedef struct _PidginSmiley PidginSmile
 G_BEGIN_DECLS
 
 /**
- * Add a PurpleSmiley to the GtkIMHtmlSmiley's list to be able to use it
+ * Add a PurpleSmiley to the GtkWebViewSmiley's list to be able to use it
  * in pidgin
  *
  * @smiley:	The smiley to be added.
@@ -42,24 +42,24 @@ G_BEGIN_DECLS
 void pidgin_smiley_add_to_list(PurpleSmiley *smiley);
 
 /**
- * Delete a PurpleSmiley from the GtkIMHtmlSmiley's list
+ * Delete a PurpleSmiley from the GtkWebViewSmiley's list
  *
  * @smiley:	The smiley to be deleted.
  */
 void pidgin_smiley_del_from_list(PurpleSmiley *smiley);
 
 /**
- * Load the GtkIMHtml list
+ * Load the GtkWebViewSmiley list
  */
 void pidgin_smileys_init(void);
 
 /**
- * Uninit the GtkIMHtml list
+ * Uninit the GtkWebViewSmiley list
  */
 void pidgin_smileys_uninit(void);
 
 /**
- * Returns a GSList with the GtkIMHtmlSmiley of each custom smiley
+ * Returns a GSList with the GtkWebViewSmiley of each custom smiley
  *
  * Returns: (transfer none): A GtkIMHmlSmiley list
  */
diff --git a/pidgin/smileyparser.c b/pidgin/smileyparser.c
--- a/pidgin/smileyparser.c
+++ b/pidgin/smileyparser.c
@@ -157,7 +157,9 @@ smiley_parse_markup(const char *markup, 
 	}
 
 	for (list = current_smiley_theme->list; list; list = list->next) {
-		if (g_str_equal(list->sml, proto_name)) {
+		if (g_str_equal(list->sml, "default") ||
+			g_str_equal(list->sml, proto_name))
+		{
 			temp2 = parse_for_smiley_list(temp, list->files);
 			g_free(temp);
 			temp = temp2;



More information about the Commits mailing list