[seahorse] gkr: Create new keyring items in the right keyring.



commit 66885bc1176288edfd4ff7a93420fedddf846c37
Author: Stef Walter <stef memberwebs com>
Date:   Tue Jul 5 10:27:46 2011 +0200

    gkr: Create new keyring items in the right keyring.
    
     * Since upgrade to GTK+3 this behavior was broken.
    
    See: Debian bug #630470

 gkr/seahorse-gkr-add-item.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/gkr/seahorse-gkr-add-item.c b/gkr/seahorse-gkr-add-item.c
index 09d1928..ff7bd07 100644
--- a/gkr/seahorse-gkr-add-item.c
+++ b/gkr/seahorse-gkr-add-item.c
@@ -88,7 +88,8 @@ on_add_item_response (GtkDialog *dialog, int response, SeahorseWidget *swidget)
 	const gchar *label;
 	gpointer request;
 	GArray *attributes;
-	
+	GtkTreeIter iter;
+
 	if (response == GTK_RESPONSE_HELP) {
 		seahorse_widget_show_help (swidget);
 		
@@ -102,14 +103,15 @@ on_add_item_response (GtkDialog *dialog, int response, SeahorseWidget *swidget)
 		secret = gtk_entry_get_text (GTK_ENTRY (widget));
 		
 		widget = seahorse_widget_get_widget (swidget, "item-keyring");
-#if GTK_CHECK_VERSION (2,91,2)
-		keyring = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (widget));
-#else
-		keyring = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget));
-#endif
+		if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (widget), &iter)) {
+			gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (widget)),
+			                    &iter, 0, &keyring, -1);
+		} else {
+			keyring = NULL;
+		}
 
 		attributes = gnome_keyring_attribute_list_new ();
-	    
+
 		request = gnome_keyring_item_create (keyring, GNOME_KEYRING_ITEM_NOTE, label, 
 		                                     attributes, secret, FALSE, item_add_done, 
 		                                     g_object_ref (swidget), g_object_unref);



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