diff options
author | Thomas White <taw@bitwiz.me.uk> | 2018-04-01 11:08:38 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2018-04-01 11:08:38 +0200 |
commit | 6acebfa0b19e106c6dca91eceb31c6d1975828b5 (patch) | |
tree | d5e685310c8b2b93ce4246c2b518a259bb78c960 /src/narrative_window.c | |
parent | d21213ef38b2027e3ac668d6906d0ff439b1885a (diff) |
Use GFile for presentation loading
Diffstat (limited to 'src/narrative_window.c')
-rw-r--r-- | src/narrative_window.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/narrative_window.c b/src/narrative_window.c index 6bed315..42084b8 100644 --- a/src/narrative_window.c +++ b/src/narrative_window.c @@ -86,15 +86,13 @@ static gint saveas_response_sig(GtkWidget *d, gint response, { if ( response == GTK_RESPONSE_ACCEPT ) { - char *filename; - - filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(d)); + GFile *file = gtk_file_chooser_get_file(GTK_FILE_CHOOSER(d)); - if ( save_presentation(nw->p, filename) ) { + if ( save_presentation(nw->p, file) ) { //show_error(sw, "Failed to save presentation"); } - g_free(filename); + g_object_unref(file); } @@ -128,12 +126,16 @@ static void saveas_sig(GSimpleAction *action, GVariant *parameter, gpointer vp) static void save_sig(GSimpleAction *action, GVariant *parameter, gpointer vp) { NarrativeWindow *nw = vp; + GFile *file; if ( nw->p->filename == NULL ) { return saveas_sig(NULL, NULL, nw); } - save_presentation(nw->p, nw->p->filename); + /* FIXME: Do this properly with GFile */ + file = g_file_new_for_path(nw->p->filename); + save_presentation(nw->p, file); + g_object_unref(file); } |