void gtr_open_file (const char * path) { 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); }
static void response_cb (GtkDialog * dialog, int response, gpointer unused UNUSED) { if (response == GTK_RESPONSE_HELP) { char * uri = g_strconcat (gtr_get_help_uri (), "/html/preferences.html", NULL); gtr_open_uri (uri); g_free (uri); } if (response == GTK_RESPONSE_CLOSE) gtk_widget_destroy (GTK_WIDGET (dialog)); }
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); } gtr_open_uri (uri); g_free (uri); }
void gtr_open_file (const char * path) { char * uri; GFile * file = g_file_new_for_path (path); g_object_unref (G_OBJECT (file)); 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); } gtr_open_uri (uri); g_free (uri); }