(trunk gtk) #5320 'can't opena folder with '#' in its name': in gtr_open_file(), use g_file_new_for_path().

This commit is contained in:
Jordan Lee 2013-07-24 17:11:21 +00:00
parent cc1b1cd430
commit 16ab373503
1 changed files with 3 additions and 13 deletions

View File

@ -361,21 +361,11 @@ gtr_get_help_uri (void)
void
gtr_open_file (const char * path)
{
char * uri;
if (g_path_is_absolute (path))
{
uri = g_strdup_printf ("file://%s", path);
}
else
{
char * cwd = g_get_current_dir ();
uri = g_strdup_printf ("file://%s/%s", cwd, path);
g_free (cwd);
}
GFile * file = g_file_new_for_path (path);
gchar * uri = g_file_get_uri (file);
gtr_open_uri (uri);
g_free (uri);
g_object_unref (file);
}
void