| 4990 | } |
| 4991 | |
| 4992 | void |
| 4993 | ghb_file_open_containing_folder (GFile *file) |
| 4994 | { |
| 4995 | if (!file) return; |
| 4996 | |
| 4997 | GtkApplication *app = GTK_APPLICATION(g_application_get_default()); |
| 4998 | GtkWindow *parent = gtk_application_get_active_window(app); |
| 4999 | if (g_file_test(g_file_peek_path(file), G_FILE_TEST_EXISTS)) |
| 5000 | { |
| 5001 | GtkFileLauncher *launcher = gtk_file_launcher_new(file); |
| 5002 | gtk_file_launcher_open_containing_folder(launcher, parent, NULL, |
| 5003 | (GAsyncReadyCallback) file_open_containing_folder_finish, NULL); |
| 5004 | } |
| 5005 | else |
| 5006 | { |
| 5007 | g_autoptr(GFile) dir = g_file_get_parent(file); |
| 5008 | GtkFileLauncher *launcher = gtk_file_launcher_new(dir); |
| 5009 | gtk_file_launcher_launch(launcher, parent, NULL, |
| 5010 | (GAsyncReadyCallback) file_open_finish, NULL); |
| 5011 | } |
| 5012 | } |
| 5013 | |
| 5014 | G_GNUC_END_IGNORE_DEPRECATIONS |
| 5015 | #else |
no test coverage detected