diff --git a/schemas/linux/application.gschema.xml.in b/schemas/linux/application.gschema.xml.in index ebf3238..f0d40e2 100644 --- a/schemas/linux/application.gschema.xml.in +++ b/schemas/linux/application.gschema.xml.in @@ -69,7 +69,7 @@ - + true Update default session time from command line diff --git a/schemas/windows/application.gschema.xml.in b/schemas/windows/application.gschema.xml.in index 079f65a..4e57457 100644 --- a/schemas/windows/application.gschema.xml.in +++ b/schemas/windows/application.gschema.xml.in @@ -81,7 +81,7 @@ - + true Update default session time from command line diff --git a/src/objects/application/open.c b/src/objects/application/open.c index 87dc52a..5af3ff5 100644 --- a/src/objects/application/open.c +++ b/src/objects/application/open.c @@ -69,21 +69,6 @@ } - static void save_open_file(GApplication *application, const gchar *path) { - - GSettings * settings = pw3270_application_get_settings(application); - - if(g_settings_get_boolean(settings,"update-session-file")) { - - g_message("Updating default session file to '%s'",path); - g_settings_set_string(settings,"default-session-file",path); - - } - - gtk_recent_manager_add_item(gtk_recent_manager_get_default(),path); - - } - void pw3270_application_open(GApplication *application, GFile **files, gint n_files, const gchar G_GNUC_UNUSED(*hint)) { GtkWidget * window = GTK_WIDGET(gtk_application_get_active_window(GTK_APPLICATION(application))); @@ -130,8 +115,6 @@ pw3270_application_window_new_tab(window,path); } - save_open_file(application,path); - continue; } @@ -149,8 +132,6 @@ pw3270_application_window_new_tab(window, filename); } - save_open_file(application,filename); - continue; } diff --git a/src/objects/window/keyfile.c b/src/objects/window/keyfile.c index ed5d2ea..d23f062 100644 --- a/src/objects/window/keyfile.c +++ b/src/objects/window/keyfile.c @@ -158,6 +158,22 @@ } } + if(!*error) { + + GSettings * settings = pw3270_application_get_settings(g_application_get_default()); + + if(settings && g_settings_get_boolean(settings,"update-default-session-file")) { + + g_message("Updating default session file to '%s'",filename); + g_settings_set_string(settings,"default-session-file",filename); + + } + + gtk_recent_manager_add_item(gtk_recent_manager_get_default(),filename); + + } + + return new_session; } -- libgit2 0.21.2