[gthumb] exporters: fixed run-time warnings when no file is selected



commit 08ede9589ca0c7198a2be6982b14a30bce3be257
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Oct 26 18:41:51 2017 +0200

    exporters: fixed run-time warnings when no file is selected

 extensions/photobucket/dlg-export-to-photobucket.c |    3 ++-
 extensions/picasaweb/dlg-export-to-picasaweb.c     |    8 ++++----
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/extensions/photobucket/dlg-export-to-photobucket.c 
b/extensions/photobucket/dlg-export-to-photobucket.c
index 1750afc..b83529e 100644
--- a/extensions/photobucket/dlg-export-to-photobucket.c
+++ b/extensions/photobucket/dlg-export-to-photobucket.c
@@ -80,7 +80,8 @@ destroy_dialog (DialogData *data)
        _g_object_unref (data->album);
        _g_object_list_unref (data->albums);
        _g_object_unref (data->builder);
-       gtk_widget_destroy (data->progress_dialog);
+       if (data->progress_dialog != NULL)
+               gtk_widget_destroy (data->progress_dialog);
        _g_object_list_unref (data->file_list);
        _g_object_unref (data->location);
        g_free (data);
diff --git a/extensions/picasaweb/dlg-export-to-picasaweb.c b/extensions/picasaweb/dlg-export-to-picasaweb.c
index 24f454e..2b5665c 100644
--- a/extensions/picasaweb/dlg-export-to-picasaweb.c
+++ b/extensions/picasaweb/dlg-export-to-picasaweb.c
@@ -71,12 +71,14 @@ destroy_dialog (DialogData *data)
 {
        if (data->dialog != NULL)
                gtk_widget_destroy (data->dialog);
-       gth_task_completed (GTH_TASK (data->service), NULL);
+       if (data->service != NULL)
+               gth_task_completed (GTH_TASK (data->service), NULL);
        _g_object_unref (data->cancellable);
        _g_object_unref (data->album);
        _g_object_unref (data->service);
        _g_object_list_unref (data->albums);
-       gtk_widget_destroy (data->progress_dialog);
+       if (data->progress_dialog != NULL)
+               gtk_widget_destroy (data->progress_dialog);
        _g_object_unref (data->builder);
        _g_object_list_unref (data->file_list);
        _g_object_unref (data->location);
@@ -489,8 +491,6 @@ dlg_export_to_picasaweb (GthBrowser *browser,
        if (data->file_list == NULL) {
                GError *error;
 
-               gth_task_dialog (GTH_TASK (data->service), TRUE, NULL);
-
                error = g_error_new_literal (GTH_ERROR, GTH_ERROR_GENERIC, _("No valid file selected."));
                _gtk_error_dialog_from_gerror_show (GTK_WINDOW (browser), _("Could not export the files"), 
error);
                g_clear_error (&error);


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