From d8f0fd60dd4384f868cf79b2ef364949bd1d0126 Mon Sep 17 00:00:00 2001 From: "Gergely POLONKAI (W00d5t0ck)" Date: Tue, 17 Sep 2013 14:52:12 +0200 Subject: [PATCH] Created ag_app_open_chart() It can open files from both the command line or the Open dialog --- src/ag-app.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ag-app.c b/src/ag-app.c index 7201c98..e68990b 100644 --- a/src/ag-app.c +++ b/src/ag-app.c @@ -104,6 +104,11 @@ quit_cb(GSimpleAction *action, GVariant *parameter, gpointer user_data) } } +static void +ag_app_open_chart(AgApp *app, GFile *file) +{ +} + static void open_cb(GSimpleAction *action, GVariant *parameter, gpointer user_data) { @@ -135,17 +140,14 @@ open_cb(GSimpleAction *action, GVariant *parameter, gpointer user_data) for (l = filenames; l; l = g_slist_next(l)) { GFile *file; - char *data = l->data, - *uri; + char *data = l->data; if (data == NULL) { continue; } file = g_file_new_for_commandline_arg(data); - - uri = g_file_get_uri(file); - g_free(uri); + ag_app_open_chart(AG_APP(user_data), file); } } @@ -222,6 +224,7 @@ ag_app_open(GApplication *gapp, GFile **files, gint n_files, const gchar *hint) gint i; for (i = 0; i < n_files; i++) { + ag_app_open_chart(AG_APP(gapp), files[i]); } }