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




commit 9ec0c2add04960811ce622c1d6fc255bc9158ae7
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.
    This way makes the function return if the first item of the array is
    selecting, not treating this case.

 src/nma-cert-chooser-button.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/nma-cert-chooser-button.c b/src/nma-cert-chooser-button.c
index 4b14587c..6544e067 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");


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