/pidgin/main: 17fed1e7d305: Finch: fix glib warnings
Tomasz Wasilczyk
twasilczyk at pidgin.im
Sat Apr 26 15:09:06 EDT 2014
Changeset: 17fed1e7d30544ad218a3b080c93a1fa217a50d2
Author: Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date: 2014-04-26 21:08 +0200
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/17fed1e7d305
Description:
Finch: fix glib warnings
diffstat:
finch/gntpounce.c | 8 ++++----
finch/libgnt/gntcolors.c | 17 +++++++++++++----
2 files changed, 17 insertions(+), 8 deletions(-)
diffs (55 lines):
diff --git a/finch/gntpounce.c b/finch/gntpounce.c
--- a/finch/gntpounce.c
+++ b/finch/gntpounce.c
@@ -977,11 +977,11 @@ finch_pounces_init(void)
PURPLE_CALLBACK(signed_on_off_cb), NULL);
}
-/* XXX: There's no such thing in pidgin. Perhaps there should be? */
+/* XXX: There's no such thing in pidgin. Perhaps there should be?
+ * For sure, we don't need purple_pounces_unregister_handler -
+ * it's wiped in purple_pounces_uninit.
+ */
void finch_pounces_uninit()
{
- purple_pounces_unregister_handler(FINCH_UI);
-
purple_signals_disconnect_by_handle(finch_pounces_get_handle());
}
-
diff --git a/finch/libgnt/gntcolors.c b/finch/libgnt/gntcolors.c
--- a/finch/libgnt/gntcolors.c
+++ b/finch/libgnt/gntcolors.c
@@ -177,10 +177,15 @@ void gnt_colors_parse(GKeyFile *kfile)
{
GError *error = NULL;
gsize nkeys;
- char **keys = g_key_file_get_keys(kfile, "colors", &nkeys, &error);
+ char **keys;
- if (error)
- {
+ if (!g_key_file_has_group(kfile, "colors")) {
+ gnt_color_pairs_parse(kfile);
+ return;
+ }
+
+ keys = g_key_file_get_keys(kfile, "colors", &nkeys, &error);
+ if (error) {
gnt_warning("%s", error->message);
g_error_free(error);
error = NULL;
@@ -223,8 +228,12 @@ void gnt_color_pairs_parse(GKeyFile *kfi
{
GError *error = NULL;
gsize nkeys;
- char **keys = g_key_file_get_keys(kfile, "colorpairs", &nkeys, &error);
+ char **keys;
+ if (!g_key_file_has_group(kfile, "colorpairs"))
+ return;
+
+ keys = g_key_file_get_keys(kfile, "colorpairs", &nkeys, &error);
if (error)
{
gnt_warning("%s", error->message);
More information about the Commits
mailing list