changeset 32735:01741f87cc1e

Automatically load the Default conversation theme and use it if a theme can't be found.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 04 Mar 2012 02:16:12 +0000
parents dfcad7368179
children cc361e897c41
files pidgin/gtkconv.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Sun Mar 04 01:34:03 2012 +0000
+++ b/pidgin/gtkconv.c	Sun Mar 04 02:16:12 2012 +0000
@@ -192,6 +192,8 @@
 static GList *offline_list = NULL;
 static GHashTable *prpl_lists = NULL;
 
+static PurpleTheme *default_conv_theme = NULL;
+
 static gboolean update_send_to_selection(PidginWindow *win);
 static void generate_send_to_items(PidginWindow *win);
 
@@ -5740,7 +5742,7 @@
 	gtkconv->unseen_count = 0;
 	theme = purple_theme_manager_find_theme(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/theme"), "conversation");
 	if (!theme)
-		theme = purple_theme_manager_find_theme("Default", "conversation");
+		theme = default_conv_theme;
 	gtkconv->theme = PIDGIN_CONV_THEME(g_object_ref(theme));
 	gtkconv->last_flags = 0;
 
@@ -8434,6 +8436,7 @@
 {
 	void *handle = pidgin_conversations_get_handle();
 	void *blist_handle = purple_blist_get_handle();
+	char *theme_dir;
 
 	/* Conversations */
 	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations");
@@ -8723,6 +8726,9 @@
 			PURPLE_CALLBACK(wrote_msg_update_unseen_cb), NULL);
 
 	purple_theme_manager_register_type(g_object_new(PIDGIN_TYPE_CONV_THEME_LOADER, "type", "conversation", NULL));
+	theme_dir = g_build_filename(DATADIR, "pidgin", "theme", NULL);
+	default_conv_theme = purple_theme_manager_load_theme(theme_dir, "conversation");
+	g_free(theme_dir);
 
 	{
 		/* Set default tab colors */