[gthumb] Fixed location loading after mounting volume
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] Fixed location loading after mounting volume
- Date: Tue, 11 Jan 2022 12:40:06 +0000 (UTC)
commit eb831a3c378a3cec98c70e0e74f61acf21139fb2
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue Jan 11 13:36:38 2022 +0100
Fixed location loading after mounting volume
Load the mounted volume root instead of the
original requested location.
gthumb/gth-browser.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index 9a14997a..006ad96f 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -1785,10 +1785,24 @@ volume_mount_ready_cb (GObject *source_object,
return;
}
+ GMount *mount = g_volume_get_mount (G_VOLUME (source_object));
+ if (mount == NULL) {
+ load_data_done (load_data, g_error_new_literal (G_IO_ERROR, G_IO_ERROR_NOT_MOUNTED, ""));
+ load_data_free (load_data);
+ return;
+ }
+
+ GFile *root = g_mount_get_root (mount);
+ if (root == NULL) {
+ load_data_done (load_data, g_error_new_literal (G_IO_ERROR, G_IO_ERROR_NOT_MOUNTED, ""));
+ load_data_free (load_data);
+ return;
+ }
+
_gth_browser_remove_activity (load_data->browser);
_gth_browser_load (load_data->browser,
- load_data->requested_folder->file,
+ root,
load_data->file_to_select,
NULL,
0,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]