[network-manager-applet] editor: fix assertions in filtering types of connection-helpers



commit 30b99bb85b85f461acb9da21e9bdac28f99cbda4
Author: Jiří Klimeš <jklimes redhat com>
Date:   Tue Mar 10 16:52:15 2015 +0100

    editor: fix assertions in filtering types of connection-helpers
    
    Filter functions doesn't like invalid GType:
    libnm-CRITICAL **: _get_setting_type_priority: assertion 'g_type_is_a (type, NM_TYPE_SETTING)' failed
    libnm-CRITICAL **: nm_utils_check_virtual_device_compatibility: assertion '_nm_setting_type_is_base_type 
(other_type)' failed
    
    Fixes commit 3d6810a611f5ddd97a89046c6e68718ab1473922.

 src/connection-editor/connection-helpers.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/connection-editor/connection-helpers.c b/src/connection-editor/connection-helpers.c
index b4df108..c8ad16e 100644
--- a/src/connection-editor/connection-helpers.c
+++ b/src/connection-editor/connection-helpers.c
@@ -240,9 +240,12 @@ set_up_connection_type_combo (GtkComboBox *combo,
 
        for (i = 0; list[i].name; i++) {
                if (type_filter_func) {
-                       if (   !type_filter_func (list[i].setting_types[0], user_data)
-                           && !type_filter_func (list[i].setting_types[1], user_data)
-                           && !type_filter_func (list[i].setting_types[2], user_data))
+                       if (   (   list[i].setting_types[0] == G_TYPE_INVALID
+                               || !type_filter_func (list[i].setting_types[0], user_data))
+                           && (   list[i].setting_types[1] == G_TYPE_INVALID
+                               || !type_filter_func (list[i].setting_types[1], user_data))
+                           && (   list[i].setting_types[2] == G_TYPE_INVALID
+                               || !type_filter_func (list[i].setting_types[2], user_data)))
                                continue;
                }
 


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