Created ag_app_open_chart()

It can open files from both the command line or the Open dialog
This commit is contained in:
Gergely Polonkai 2013-09-17 14:52:12 +02:00
parent 79815fc31d
commit d8f0fd60dd
1 changed files with 8 additions and 5 deletions

View File

@ -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 static void
open_cb(GSimpleAction *action, GVariant *parameter, gpointer user_data) 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)) { for (l = filenames; l; l = g_slist_next(l)) {
GFile *file; GFile *file;
char *data = l->data, char *data = l->data;
*uri;
if (data == NULL) { if (data == NULL) {
continue; continue;
} }
file = g_file_new_for_commandline_arg(data); file = g_file_new_for_commandline_arg(data);
ag_app_open_chart(AG_APP(user_data), file);
uri = g_file_get_uri(file);
g_free(uri);
} }
} }
@ -222,6 +224,7 @@ ag_app_open(GApplication *gapp, GFile **files, gint n_files, const gchar *hint)
gint i; gint i;
for (i = 0; i < n_files; i++) { for (i = 0; i < n_files; i++) {
ag_app_open_chart(AG_APP(gapp), files[i]);
} }
} }