mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-19 12:10:19 +00:00
refactor: route exit saves through FE persistence wrapper; keep text mode simple
This commit is contained in:
@@ -44,11 +44,20 @@ typedef struct
|
||||
char *icon; /* filename */
|
||||
} menu_entry;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gboolean success;
|
||||
gboolean partial_failure;
|
||||
gboolean config_failed;
|
||||
gboolean theme_failed;
|
||||
} fe_preferences_save_result;
|
||||
|
||||
int fe_args (int argc, char *argv[]);
|
||||
void fe_init (void);
|
||||
void fe_main (void);
|
||||
void fe_cleanup (void);
|
||||
void fe_exit (void);
|
||||
fe_preferences_save_result fe_preferences_persistence_save_all (void);
|
||||
int fe_timeout_add (int interval, void *callback, void *userdata);
|
||||
int fe_timeout_add_seconds (int interval, void *callback, void *userdata);
|
||||
void fe_timeout_remove (int tag);
|
||||
|
||||
@@ -1104,8 +1104,18 @@ zoitechat_exit (void)
|
||||
plugin_kill_all ();
|
||||
fe_cleanup ();
|
||||
|
||||
if (!save_config ())
|
||||
g_printerr ("Could not save zoitechat.conf.\n");
|
||||
{
|
||||
fe_preferences_save_result save_result;
|
||||
|
||||
save_result = fe_preferences_persistence_save_all ();
|
||||
if (!save_result.success)
|
||||
{
|
||||
if (save_result.partial_failure || (!save_result.config_failed && save_result.theme_failed))
|
||||
g_printerr ("Could not fully save preferences. zoitechat.conf was written, but colors.conf failed.\n");
|
||||
else
|
||||
g_printerr ("Could not save zoitechat.conf.\n");
|
||||
}
|
||||
}
|
||||
if (prefs.save_pevents)
|
||||
{
|
||||
pevent_save (NULL);
|
||||
|
||||
Reference in New Issue
Block a user