[libnma/ac/fix-none-selected] Fix detection of selected item




commit c0b869b3443492015f96867c02ef47534db89b92
Author: Ana Cabral <acabral redhat com>
Date:   Tue Sep 6 09:48:32 2022 +0200

    Fix detection of selected item
    
    If there is no item selected, it should return -1, and not zero.

 src/nma-cert-chooser-button.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/nma-cert-chooser-button.c b/src/nma-cert-chooser-button.c
index 4b14587c..9c80c321 100644
--- a/src/nma-cert-chooser-button.c
+++ b/src/nma-cert-chooser-button.c
@@ -362,7 +362,7 @@ changed (GtkComboBox *combo_box, gpointer user_data)
        gchar *label;
        GckSlot *slot;
 
-       if (gtk_combo_box_get_active (combo_box) == 0)
+       if (gtk_combo_box_get_active (combo_box) == -1)
                return;
 
        g_signal_stop_emission_by_name (combo_box, "changed");
@@ -379,7 +379,7 @@ changed (GtkComboBox *combo_box, gpointer user_data)
 
        g_free (label);
        g_clear_object (&slot);
-       gtk_combo_box_set_active (combo_box, 0);
+       gtk_combo_box_set_active (combo_box, -1);
 }
 
 static gboolean


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