[gnome-control-center] network: Fix possible crash in connection editor



commit c57faf5da5222cef41ff0bc3480774b4bf18621a
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Mar 27 11:24:00 2013 +0100

    network: Fix possible crash in connection editor
    
    Disable the type-ahead search in the connection editor, the
    number of items, and their positional stability means that
    a search feature isn't warranted.
    
    As a precaution, also check the success of
    gtk_tree_selection_get_selected() to avoid crashes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693685

 .../network/connection-editor/connection-editor.ui |    2 +-
 .../connection-editor/net-connection-editor.c      |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/panels/network/connection-editor/connection-editor.ui 
b/panels/network/connection-editor/connection-editor.ui
index 78c4ba9..0d48cec 100644
--- a/panels/network/connection-editor/connection-editor.ui
+++ b/panels/network/connection-editor/connection-editor.ui
@@ -77,7 +77,7 @@
                         <property name="model">details_store</property>
                         <property name="headers_visible">False</property>
                         <property name="headers_clickable">False</property>
-                        <property name="search_column">0</property>
+                        <property name="enable-search">False</property>
                         <child internal-child="selection">
                           <object class="GtkTreeSelection" id="details_page_list_selection"/>
                         </child>
diff --git a/panels/network/connection-editor/net-connection-editor.c 
b/panels/network/connection-editor/net-connection-editor.c
index 07705c9..e145fe0 100644
--- a/panels/network/connection-editor/net-connection-editor.c
+++ b/panels/network/connection-editor/net-connection-editor.c
@@ -59,7 +59,8 @@ selection_changed (GtkTreeSelection *selection, NetConnectionEditor *editor)
         GtkTreeIter iter;
         gint page;
 
-        gtk_tree_selection_get_selected (selection, &model, &iter);
+        if (!gtk_tree_selection_get_selected (selection, &model, &iter))
+                return;
         gtk_tree_model_get (model, &iter, 1, &page, -1);
 
         widget = GTK_WIDGET (gtk_builder_get_object (editor->builder,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]