[xchat-gnome] Bug 600627 - Fix for SexyURLLabel replacement code for GTK+ >= 2.17.1
- From: Ritesh Khadgaray <rkhadgaray src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [xchat-gnome] Bug 600627 - Fix for SexyURLLabel replacement code for GTK+ >= 2.17.1
- Date: Thu, 16 Sep 2010 06:45:34 +0000 (UTC)
commit 40c5bf988586b24a25efbfc2224504791650bee3
Author: Ritesh Khadgaray <khadgaray gmail com>
Date: Thu Sep 16 12:14:35 2010 +0530
Bug 600627 - Fix for SexyURLLabel replacement code for GTK+ >= 2.17.1
more fixes. This should prevent xg from crashing when a user clicks on a link in topic,
and sets up the signal for gtk < 2.17.1 correctly
src/fe-gnome/preferences-page-spellcheck.c | 7 ++++++-
src/fe-gnome/text-entry.h | 4 ++++
src/fe-gnome/topic-label.c | 14 ++------------
3 files changed, 12 insertions(+), 13 deletions(-)
---
diff --git a/src/fe-gnome/preferences-page-spellcheck.c b/src/fe-gnome/preferences-page-spellcheck.c
index 3dccc28..53ca3d5 100644
--- a/src/fe-gnome/preferences-page-spellcheck.c
+++ b/src/fe-gnome/preferences-page-spellcheck.c
@@ -23,12 +23,17 @@
#include <glib/gi18n.h>
#include <string.h>
#include <gconf/gconf-client.h>
-#include <libsexy/sexy-spell-entry.h>
#include "preferences-page-spellcheck.h"
#include "preferences-dialog.h"
#include "util.h"
#include "gui.h"
+#warning "temporary hack until sexy-spell-entry is removed"
+#undef GTK_DISABLE_SINGLE_INCLUDES
+#include <libsexy/sexy-spell-entry.h>
+#define GTK_DISABLE_SINGLE_INCLUDES
+
+
G_DEFINE_TYPE(PreferencesPageSpellcheck, preferences_page_spellcheck, PREFERENCES_PAGE_TYPE)
enum
diff --git a/src/fe-gnome/text-entry.h b/src/fe-gnome/text-entry.h
index 3a5d1b1..4477fb1 100644
--- a/src/fe-gnome/text-entry.h
+++ b/src/fe-gnome/text-entry.h
@@ -21,7 +21,11 @@
#ifndef XCHAT_GNOME_TEXTENTRY_H
#define XCHAT_GNOME_TEXTENTRY_H
+#warning "temporary hack until sexy-spell-entry is removed"
+#undef GTK_DISABLE_SINGLE_INCLUDES
#include <libsexy/sexy-spell-entry.h>
+#define GTK_DISABLE_SINGLE_INCLUDES
+
#include "../common/xchat.h"
G_BEGIN_DECLS
diff --git a/src/fe-gnome/topic-label.c b/src/fe-gnome/topic-label.c
index 4cbdda9..03b811c 100644
--- a/src/fe-gnome/topic-label.c
+++ b/src/fe-gnome/topic-label.c
@@ -42,9 +42,7 @@ static char *topic_label_get_topic_string (const char *topic);
static void topic_label_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void topic_label_url_activated (GtkWidget *url_label,
-#if !GTK_CHECK_VERSION(2,17,1)
const char *url,
-#endif
TopicLabel *label);
static void topic_entry_activate (GtkTextBuffer *textbuffer,
GtkTextIter *arg1,
@@ -112,7 +110,7 @@ topic_label_init (TopicLabel *label)
#if GTK_CHECK_VERSION(2,17,1)
g_signal_connect (G_OBJECT (priv->label), "activate-link", G_CALLBACK (topic_label_url_activated), (gpointer) label);
#else
- g_signal_connect (G_OBJECT (priv->label), "url_activated", G_CALLBACK (topic_label_url_activated), (gpointer) label);
+ g_signal_connect (G_OBJECT (priv->label), "url-activated", G_CALLBACK (topic_label_url_activated), (gpointer) label);
#endif
priv->topics = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
}
@@ -143,21 +141,13 @@ topic_label_expand_activate (GtkExpander *expander, TopicLabel *label)
}
static void
-#if GTK_CHECK_VERSION(2,17,1)
-topic_label_url_activated (GtkWidget *url_label, TopicLabel *label)
-#else
topic_label_url_activated (GtkWidget *url_label, const char *url, TopicLabel *label)
-#endif
{
TopicLabelPriv *priv = label->priv;
char *command;
-#if GTK_CHECK_VERSION(2,17,1)
- command = g_strdup_printf ("URL %s",
- gtk_label_get_current_uri (GTK_LABEL (url_label)));
-#else
command = g_strdup_printf ("URL %s", url);
-#endif
+
handle_command (priv->current, command, 1);
g_free (command);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]