<p></p>
<p><b>@kugel-</b> requested changes on this pull request.</p>
<hr>
<p>In <a href="https://github.com/geany/geany/pull/2776#discussion_r606839912">src/keyfile.c</a>:</p>
<pre style='color:#555'>> @@ -1187,6 +1214,22 @@ gboolean configuration_load(void)
}
+gboolean configuration_load(void)
+{
+ gboolean prefs_loaded = read_config_file(PREFERENCES_FILE, PREFERENCES);
+ /* backwards-compatibility: try to read session from preferences if session file doesn't exist */
+ gchar *session_filename = SESSION_FILE;
+ gchar *session_file = g_build_filename(app->configdir, session_filename, NULL);
</pre>
<p><code>g_free(session_file)</code> is missing</p>
<hr>
<p>In <a href="https://github.com/geany/geany/pull/2776#discussion_r606841206">src/keyfile.c</a>:</p>
<pre style='color:#555'>> - load_dialog_prefs(config);
- load_ui_prefs(config);
- project_load_prefs(config);
- configuration_load_session_files(config, TRUE);
-
+ switch (payload)
+ {
+ case PREFERENCES:
+ load_dialog_prefs(config);
+ load_ui_prefs(config);
+ project_load_prefs(config);
+ break;
+ case SESSION:
+ configuration_load_session_files(config, TRUE);
+ break;
+ }
/* this signal can be used e.g. to delay building UI elements until settings have been read */
g_signal_emit_by_name(geany_object, "load-settings", config);
</pre>
<p>The signal should be emitted only once, arguably for the PREFERENCES payload. Might add another signal for load-session ?</p>
<hr>
<p>In <a href="https://github.com/geany/geany/pull/2776#discussion_r606841410">src/keyfile.c</a>:</p>
<pre style='color:#555'>> {
GKeyFile *config = g_key_file_new();
- gchar *configfile = g_build_filename(app->configdir, "geany.conf", NULL);
+ gchar *configfile = g_build_filename(app->configdir, filename, NULL);
gchar *data;
g_key_file_load_from_file(config, configfile, G_KEY_FILE_NONE, NULL);
/* this signal can be used e.g. to prepare any settings before Stash code reads them below */
g_signal_emit_by_name(geany_object, "save-settings", config);
</pre>
<p>The signal should be emitted only once, arguably for the PREFERENCES payload. Might add another signal for save-session?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/2776#pullrequestreview-627564285">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJYPKU56GJWI7XZQR7TTHC26XANCNFSM42KJV3OQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAIOWJYJKYNZ44NRUFMFXNLTHC26XA5CNFSM42KJV3O2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOEVT557I.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/2776#pullrequestreview-627564285",
"url": "https://github.com/geany/geany/pull/2776#pullrequestreview-627564285",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>