diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-10 12:23:58 (EST) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-11 10:35:20 (EST) |
commit | be8d2a019686850916f9a624522f69e91c891fc9 (patch) | |
tree | dbaaa075c158aeda87efa32240590f2466e239af /src | |
parent | babd9857027a20ac25d373a6378cceaf417e2634 (diff) | |
download | marquee-be8d2a019686850916f9a624522f69e91c891fc9.zip marquee-be8d2a019686850916f9a624522f69e91c891fc9.tar.gz marquee-be8d2a019686850916f9a624522f69e91c891fc9.tar.bz2 |
MqProfiles: Only save if restored profile insertion succeeds
Diffstat (limited to 'src')
-rw-r--r-- | src/config/profiles.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/config/profiles.c b/src/config/profiles.c index 021df5e..8a75401 100644 --- a/src/config/profiles.c +++ b/src/config/profiles.c @@ -139,9 +139,11 @@ changed(GFileMonitor G_GNUC_UNUSED *monitor, GFile G_GNUC_UNUSED *file, #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" /* False positive */ if (!g_key_file_has_group(profiles->key_file, profiles->current)) { - insert(profiles, profiles->current, - cur_name, cur_color); - mq_profiles_save(profiles); + if (insert(profiles, profiles->current, + cur_name, cur_color)) + { + mq_profiles_save(profiles); + } } g_free(cur_name); g_free(cur_color); |