GNOME Bugzilla – Bug 764701
projects-directory: save absolute path
Last modified: 2016-04-18 03:31:16 UTC
Created attachment 325509 [details] [review] using absolute path saving relative path with respective to home directory using g_file_get_relative_path() causes critical warnings when choosing directories outside home directory.
Review of attachment 325509 [details] [review]: Couple quick style changes ::: libide/preferences/ide-preferences-file-chooser-button.c @@ -82,2 +77,2 @@ { - path = g_build_filename (g_get_home_dir (), folder, NULL); + if (file [0] != '/') Use !g_path_is_absolute (file) @@ -83,2 +78,4 @@ - path = g_build_filename (g_get_home_dir (), folder, NULL); - gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (self->widget), path); + if (file [0] != '/') + path = g_build_filename (g_get_home_dir (), file, NULL); + else + path = g_strdup (file); path = g_steal_pointer (&file); ::: plugins/create-project/gbp-create-project-widget.c @@ +341,3 @@ if (!ide_str_empty0 (path)) { + if (path[0] != '/') g_path_is_absolute here too @@ -343,1 +343,4 @@ - projects_dir = g_build_filename (g_get_home_dir (), path, NULL); + if (path[0] != '/') + projects_dir = g_build_filename (g_get_home_dir (), path, NULL); + else + projects_dir = g_strdup (path); g_steal_pointer (&path) here too ::: plugins/git/ide-git-clone-widget.c @@ +206,3 @@ if (!ide_str_empty0 (path)) { + if (path [0] != '/') Same @@ +209,3 @@ + projects_dir = g_build_filename (g_get_home_dir (), path, NULL); + else + projects_dir = g_strdup (path); Same
Created attachment 325519 [details] [review] using absolute path(modified)
Review of attachment 325519 [details] [review]: LGTM
Thanks for fixing this!