app: change Gimp->default_folder from being a path to a GFile

Also fix GimpFileDialog to actually start with that folder, and not in
its parent folder.
This commit is contained in:
Michael Natterer
2014-07-09 20:12:05 +02:00
parent ef53921133
commit 39f7401703
5 changed files with 57 additions and 39 deletions

View File

@ -162,14 +162,14 @@ app_run (const gchar *full_prog_name,
Gimp *gimp;
GMainLoop *loop;
GMainLoop *run_loop;
gchar *default_folder = NULL;
GFile *default_folder = NULL;
if (filenames && filenames[0] && ! filenames[1] &&
g_file_test (filenames[0], G_FILE_TEST_IS_DIR))
{
if (g_path_is_absolute (filenames[0]))
{
default_folder = g_filename_to_uri (filenames[0], NULL, NULL);
default_folder = g_file_new_for_path (filenames[0]);
}
else
{
@ -177,7 +177,7 @@ app_run (const gchar *full_prog_name,
g_get_current_dir (),
filenames[0],
NULL);
default_folder = g_filename_to_uri (absolute, NULL, NULL);
default_folder = g_file_new_for_path (absolute);
g_free (absolute);
}
@ -200,6 +200,9 @@ app_run (const gchar *full_prog_name,
stack_trace_mode,
pdb_compat_mode);
if (default_folder)
g_object_unref (default_folder);
gimp_cpu_accel_set_use (use_cpu_accel);
errors_init (gimp, full_prog_name, use_debug_handler, stack_trace_mode);