[seahorse] ui: fix pgp/ssh key export



commit b8efbb1b8f253d39449184e42904c97372c11066
Author: Sebastian Keller <sebastian-keller gmx de>
Date:   Thu Nov 7 03:05:32 2013 +0100

    ui: fix pgp/ssh key export
    
    The vala code is expecting the directory parameter to be a reference
    so when checking "directory != null" it dereferences directory first.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707014

 pgp/seahorse-pgp-key-properties.c |    4 +++-
 ssh/seahorse-ssh-key-properties.c |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/pgp/seahorse-pgp-key-properties.c b/pgp/seahorse-pgp-key-properties.c
index f8764f7..323bda5 100644
--- a/pgp/seahorse-pgp-key-properties.c
+++ b/pgp/seahorse-pgp-key-properties.c
@@ -1162,6 +1162,7 @@ on_pgp_details_export_button (GtkWidget *widget,
        GList *exporters = NULL;
        GtkWindow *window;
        GObject *object;
+       gchar *directory = NULL;
        GFile *file;
 
        object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
@@ -1169,9 +1170,10 @@ on_pgp_details_export_button (GtkWidget *widget,
        exporters = g_list_append (exporters, seahorse_gpgme_exporter_new (object, TRUE, TRUE));
 
        window = GTK_WINDOW (seahorse_widget_get_toplevel (swidget));
-       if (seahorse_exportable_prompt (exporters, window, NULL, &file, &exporter)) {
+       if (seahorse_exportable_prompt (exporters, window, &directory, &file, &exporter)) {
                seahorse_exporter_export_to_file (exporter, file, TRUE, NULL,
                                                  on_export_complete, g_object_ref (window));
+               g_free (directory);
                g_object_unref (file);
                g_object_unref (exporter);
        }
diff --git a/ssh/seahorse-ssh-key-properties.c b/ssh/seahorse-ssh-key-properties.c
index fade71e..d599357 100644
--- a/ssh/seahorse-ssh-key-properties.c
+++ b/ssh/seahorse-ssh-key-properties.c
@@ -215,6 +215,7 @@ on_ssh_export_button_clicked (GtkWidget *widget, SeahorseWidget *swidget)
        GList *exporters = NULL;
        GObject *object;
        GtkWindow *window;
+       gchar *directory = NULL;
        GFile *file;
 
        object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
@@ -222,9 +223,10 @@ on_ssh_export_button_clicked (GtkWidget *widget, SeahorseWidget *swidget)
        exporters = g_list_append (exporters, seahorse_ssh_exporter_new (object, TRUE));
 
        window = GTK_WINDOW (seahorse_widget_get_toplevel (swidget));
-       if (seahorse_exportable_prompt (exporters, window, NULL, &file, &exporter)) {
+       if (seahorse_exportable_prompt (exporters, window, &directory, &file, &exporter)) {
                seahorse_exporter_export_to_file (exporter, file, TRUE, NULL,
                                                  on_export_complete, g_object_ref (window));
+               g_free (directory);
                g_object_unref (file);
                g_object_unref (exporter);
        }


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