GNOME Bugzilla – Bug 762762
Critical warnings when passing relative path to --profile
Last modified: 2016-02-29 23:33:49 UTC
When running 'epiphany --profile=ephytest' everything seems to work properly, except for EphyUriTester which emits a bunch of criticals as it doesn't handle relative paths properly. Two easy solutions: (a) we could normalize it there, or (b) seems nicer to normalize it in ephy_file_helpers_init?
Created attachment 322510 [details] [review] uri-tester: Handle relative profile dirs When Epiphany is run with --profile and a relative path to the profile dir, it mostly works fine, with the exception of a bunch of criticals coming from EphyUriTester. Fix it.
Created attachment 322511 [details] [review] file-helpers: convert profile_dir to absolute path When Epiphany is run with --profile and a relative path to the profile dir, it mostly works fine, with the exception of a bunch of criticals coming from EphyUriTester. Fix it here so the rest of the code doesn't have to worry about relative paths.
(pick one)
Review of attachment 322511 [details] [review]: This one looks simpler and safer. Thanks! ::: lib/ephy-file-helpers.c @@ +335,3 @@ + GFile *file = g_file_new_for_path (profile_dir); + dot_dir = g_file_get_path (file); + g_object_unref (file); We can avoid the gobject creation/destruction if the path is already absolute which is the most common case. We can do: if (g_path_is_absolute (path)) g_strdup() else g_file_new
(In reply to Carlos Garcia Campos from comment #4) > We can avoid the gobject creation/destruction if the path is already > absolute which is the most common case. We can do: > > if (g_path_is_absolute (path)) > g_strdup() > else > g_file_new Really think that's worth adding a conditional for?
(In reply to Michael Catanzaro from comment #5) > (In reply to Carlos Garcia Campos from comment #4) > > We can avoid the gobject creation/destruction if the path is already > > absolute which is the most common case. We can do: > > > > if (g_path_is_absolute (path)) > > g_strdup() > > else > > g_file_new > > Really think that's worth adding a conditional for? Yes.
Should also handle the case where g_file_get_path returns NULL (probably if the user passes something weird to --profile).
Created attachment 322545 [details] [review] file-helpers: convert profile_dir to absolute path When Epiphany is run with --profile and a relative path to the profile dir, it mostly works fine, with the exception of a bunch of criticals coming from EphyUriTester. Fix it here so the rest of the code doesn't have to worry about relative paths.
(In reply to Michael Catanzaro from comment #8) > Created attachment 322545 [details] [review] [review] > file-helpers: convert profile_dir to absolute path > > When Epiphany is run with --profile and a relative path to the profile > dir, it mostly works fine, with the exception of a bunch of criticals > coming from EphyUriTester. Fix it here so the rest of the code doesn't > have to worry about relative paths. Looks like I forgot to 'git add'
Created attachment 322605 [details] [review] file-helpers: convert profile_dir to absolute path When Epiphany is run with --profile and a relative path to the profile dir, it mostly works fine, with the exception of a bunch of criticals coming from EphyUriTester. Fix it here so the rest of the code doesn't have to worry about relative paths.
Attachment 322605 [details] pushed as 27fdc93 - file-helpers: convert profile_dir to absolute path