diff options
author | Matthias Clasen <mclasen@redhat.com> | 2023-05-17 10:15:26 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2023-05-17 10:15:26 +0000 |
commit | e79851502c27105ad8c6a205bb577e70ee6681a4 (patch) | |
tree | c21a8f581eafe971db61698b9448d11de7954137 | |
parent | 0132ab046bc0ffd8a96c975deb6556f13a488ff5 (diff) | |
parent | 22cd3ea2683f2fee9a7c2bb1ebc6be619153add2 (diff) | |
download | gtk+-e79851502c27105ad8c6a205bb577e70ee6681a4.tar.gz |
Merge branch 'pathbar-early-return-on-cancellation' into 'main'
pathbar: Fail setting the path on cancellation
Closes #5792
See merge request GNOME/gtk!5982
-rw-r--r-- | gtk/gtkpathbar.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index e8a3b2fc06..d712bec277 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -873,8 +873,18 @@ gtk_path_bar_get_mount_callback (GObject *source, { GFile *file = G_FILE (source); struct SetFileInfo *file_info = data; + GError *error = NULL; - file_info->mount = g_file_find_enclosing_mount_finish (file, result, NULL); + file_info->mount = g_file_find_enclosing_mount_finish (file, result, + &error); + + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + { + gtk_path_bar_set_file_finish (file_info, FALSE); + g_clear_error (&error); + return; + } + g_clear_error (&error); if (file_info->mount) file_info->root_file = g_mount_get_root (file_info->mount); |