[gthumb] vfs tree: show an error if the location could not be loaded



commit 4ba75c910169ef4c288d11a1c774a9a33b28cc07
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Dec 7 20:00:11 2019 +0100

    vfs tree: show an error if the location could not be loaded

 gthumb/gth-vfs-tree.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
---
diff --git a/gthumb/gth-vfs-tree.c b/gthumb/gth-vfs-tree.c
index 58ef8d73..4a17734f 100644
--- a/gthumb/gth-vfs-tree.c
+++ b/gthumb/gth-vfs-tree.c
@@ -374,6 +374,25 @@ mount_volume_ready_cb (GObject      *source_object,
        GError   *error = NULL;
 
        if (! g_file_mount_enclosing_volume_finish (G_FILE (source_object), result, &error)) {
+               GthVfsTree *self = load_data->vfs_tree;
+
+               if (! g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+                       char *title;
+
+                       title = _g_format_str_for_file (_("Could not load the position ā€œ%sā€"),
+                                                       load_data->requested_folder->file);
+                       _gtk_error_dialog_from_gerror_show (_gtk_widget_get_toplevel_if_window (GTK_WIDGET 
(self)),
+                                                           title,
+                                                           error);
+
+                       g_free (title);
+               }
+
+               if ((load_data->action == LOAD_ACTION_LOAD) && (self->priv->folder == NULL)) {
+                       GFile *root = gth_folder_tree_get_root (GTH_FOLDER_TREE (self));
+                       _gth_vfs_tree_load_folder (self, LOAD_ACTION_LIST_CHILDREN, root);
+               }
+
                load_data_free (load_data);
                return;
        }


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