[geany/geany] 2ed4fc: Remove pref "Use project-based session files", now always enabled
Thomas Martitz
git-noreply at xxxxx
Fri Mar 4 23:03:24 UTC 2022
Branch: refs/heads/master
Author: Thomas Martitz <thomas.martitz at mailbox.org>
Committer: Thomas Martitz <thomas.martitz at mailbox.org>
Date: Thu, 17 Feb 2022 21:40:36 UTC
Commit: 2ed4fc9eb6fa12fe03de3917ebe00b4485894f8a
https://github.com/geany/geany/commit/2ed4fc9eb6fa12fe03de3917ebe00b4485894f8a
Log Message:
-----------
Remove pref "Use project-based session files", now always enabled
As per #267 we agreed that this pref makes little sense. Especially
as we're considering to move the project session files to a completely
separate file (so neither geany.conf nor $project.geany).
Currently, if not checked, the project session files would be stored
in the (new) session.conf file, overwriting the non-project session.
This is what #267 is about.
Modified Paths:
--------------
data/geany.glade
src/keyfile.c
src/libmain.c
src/prefs.c
src/project.c
src/project.h
Modified: data/geany.glade
16 lines changed, 0 insertions(+), 16 deletions(-)
===================================================================
@@ -1445,22 +1445,6 @@
<object class="GtkVBox" id="vbox35">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <child>
- <object class="GtkCheckButton" id="check_project_session">
- <property name="label" translatable="yes">Use project-based session files</property>
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">False</property>
- <property name="tooltip-text" translatable="yes">Whether to store a project's session files and open them when re-opening the project</property>
- <property name="use-underline">True</property>
- <property name="draw-indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
<child>
<object class="GtkCheckButton" id="check_project_file_in_basedir">
<property name="label" translatable="yes">Store project file inside the project base directory</property>
Modified: src/keyfile.c
2 lines changed, 0 insertions(+), 2 deletions(-)
===================================================================
@@ -458,7 +458,6 @@ static void save_dialog_prefs(GKeyFile *config)
/* general */
g_key_file_set_boolean(config, PACKAGE, "pref_main_load_session", prefs.load_session);
- g_key_file_set_boolean(config, PACKAGE, "pref_main_project_session", project_prefs.project_session);
g_key_file_set_boolean(config, PACKAGE, "pref_main_project_file_in_basedir", project_prefs.project_file_in_basedir);
g_key_file_set_boolean(config, PACKAGE, "pref_main_save_winpos", prefs.save_winpos);
g_key_file_set_boolean(config, PACKAGE, "pref_main_save_wingeom", prefs.save_wingeom);
@@ -815,7 +814,6 @@ static void load_dialog_prefs(GKeyFile *config)
prefs.confirm_exit = utils_get_setting_boolean(config, PACKAGE, "pref_main_confirm_exit", FALSE);
prefs.suppress_status_messages = utils_get_setting_boolean(config, PACKAGE, "pref_main_suppress_status_messages", FALSE);
prefs.load_session = utils_get_setting_boolean(config, PACKAGE, "pref_main_load_session", TRUE);
- project_prefs.project_session = utils_get_setting_boolean(config, PACKAGE, "pref_main_project_session", TRUE);
project_prefs.project_file_in_basedir = utils_get_setting_boolean(config, PACKAGE, "pref_main_project_file_in_basedir", FALSE);
prefs.save_winpos = utils_get_setting_boolean(config, PACKAGE, "pref_main_save_winpos", TRUE);
prefs.save_wingeom = utils_get_setting_boolean(config, PACKAGE, "pref_main_save_wingeom", prefs.save_winpos);
Modified: src/libmain.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -957,7 +957,7 @@ static void load_startup_files(gint argc, gchar **argv)
main_load_project_from_command_line(filename, FALSE);
argc--, argv++;
/* force session load if using project-based session files */
- load_session = project_prefs.project_session;
+ load_session = TRUE;
g_free(filename);
}
Modified: src/prefs.c
6 lines changed, 0 insertions(+), 6 deletions(-)
===================================================================
@@ -409,9 +409,6 @@ static void prefs_init_dialog(void)
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_load_session");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), prefs.load_session);
- widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_project_session");
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), project_prefs.project_session);
-
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_project_file_in_basedir");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), project_prefs.project_file_in_basedir);
@@ -892,9 +889,6 @@ on_prefs_dialog_response(GtkDialog *dialog, gint response, gpointer user_data)
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_load_session");
prefs.load_session = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
- widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_project_session");
- project_prefs.project_session = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
-
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_project_file_in_basedir");
project_prefs.project_file_in_basedir = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
Modified: src/project.c
56 lines changed, 22 insertions(+), 34 deletions(-)
===================================================================
@@ -50,7 +50,7 @@
#include <errno.h>
-ProjectPrefs project_prefs = { NULL, FALSE, FALSE };
+ProjectPrefs project_prefs = { NULL, FALSE };
static GeanyProjectPrivate priv;
@@ -112,7 +112,7 @@ static gboolean have_session_docs(void)
static gboolean handle_current_session(void)
{
- if (!app->project && project_prefs.project_session)
+ if (!app->project)
{
/* save session in case the dialog is cancelled */
configuration_save_default_session();
@@ -275,12 +275,9 @@ gboolean project_load_file_with_session(const gchar *locale_file_name)
{
if (project_load_file(locale_file_name))
{
- if (project_prefs.project_session)
- {
- configuration_open_files();
- document_new_file_if_non_open();
- ui_focus_current_document();
- }
+ configuration_open_files();
+ document_new_file_if_non_open();
+ ui_focus_current_document();
return TRUE;
}
return FALSE;
@@ -413,12 +410,10 @@ gboolean project_close(gboolean open_default)
if (!write_config())
g_warning("Project file \"%s\" could not be written", app->project->file_name);
- if (project_prefs.project_session)
- {
- /* close all existing tabs first */
- if (!document_close_all())
- return FALSE;
- }
+ /* close all existing tabs first */
+ if (!document_close_all())
+ return FALSE;
+
ui_set_statusbar(TRUE, _("Project \"%s\" closed."), app->project->name);
destroy_project(open_default);
return TRUE;
@@ -461,16 +456,13 @@ static void destroy_project(gboolean open_default)
apply_editor_prefs(); /* ensure that global settings are restored */
- if (project_prefs.project_session)
+ /* after closing all tabs let's open the tabs found in the default config */
+ if (open_default && cl_options.load_session)
{
- /* after closing all tabs let's open the tabs found in the default config */
- if (open_default && cl_options.load_session)
- {
- configuration_reload_default_session();
- configuration_open_files();
- document_new_file_if_non_open();
- ui_focus_current_document();
- }
+ configuration_reload_default_session();
+ configuration_open_files();
+ document_new_file_if_non_open();
+ ui_focus_current_document();
}
g_signal_emit_by_name(geany_object, "project-close");
@@ -1072,15 +1064,12 @@ static gboolean load_config(const gchar *filename)
apply_editor_prefs();
build_load_menu(config, GEANY_BCS_PROJ, (gpointer)p);
- if (project_prefs.project_session)
- {
- /* save current (non-project) session (it could have been changed since program startup) */
- configuration_save_default_session();
- /* now close all open files */
- document_close_all();
- /* read session files so they can be opened with configuration_open_files() */
- configuration_load_session_files(config, FALSE);
- }
+ /* save current (non-project) session (it could have been changed since program startup) */
+ configuration_save_default_session();
+ /* now close all open files */
+ document_close_all();
+ /* read session files so they can be opened with configuration_open_files() */
+ configuration_load_session_files(config, FALSE);
g_signal_emit_by_name(geany_object, "project-open", config);
g_key_file_free(config);
@@ -1135,8 +1124,7 @@ static gboolean write_config(void)
g_key_file_set_integer(config, "long line marker", "long_line_column", p->priv->long_line_column);
/* store the session files into the project too */
- if (project_prefs.project_session)
- configuration_save_session_files(config);
+ configuration_save_session_files(config);
build_save_menu(config, (gpointer)p, GEANY_BCS_PROJ);
g_signal_emit_by_name(geany_object, "project-save", config);
/* write the file */
Modified: src/project.h
1 lines changed, 0 insertions(+), 1 deletions(-)
===================================================================
@@ -55,7 +55,6 @@ void project_write_config(void);
typedef struct ProjectPrefs
{
gchar *session_file;
- gboolean project_session;
gboolean project_file_in_basedir;
} ProjectPrefs;
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list