From: Enrico Tröger Date: Thu, 28 May 2009 21:01:56 +0000 (+0200) Subject: Treat select-all specially with text views and tree views X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20a34d0ae708bc777e39bf396174d358c63a3742;p=midori Treat select-all specially with text views and tree views Unfortunately select-all signals within Gtk have different semantics against intuition, so we have to treat text views and tree views specially to avoid crashing. --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 109e8800..5cc4c829 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -2021,7 +2021,17 @@ _action_select_all_activate (GtkAction* action, if (GTK_IS_EDITABLE (widget)) gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1); else if (g_signal_lookup ("select-all", G_OBJECT_TYPE (widget))) - g_signal_emit_by_name (widget, "select-all", TRUE); + { + if (GTK_IS_TEXT_VIEW (widget)) + g_signal_emit_by_name (widget, "select-all", TRUE); + else if (GTK_IS_TREE_VIEW (widget)) + { + gboolean dummy; + g_signal_emit_by_name (widget, "select-all", &dummy); + } + else + g_signal_emit_by_name (widget, "select-all"); + } } }