summaryrefslogtreecommitdiff
path: root/src/bin/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/config.c')
-rw-r--r--src/bin/config.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/bin/config.c b/src/bin/config.c
index b205b8f..9cb4fa2 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -8,6 +8,7 @@
8#include "utils.h" 8#include "utils.h"
9 9
10#define CONF_VER 22 10#define CONF_VER 22
11#define CONFIG_KEY "config"
11 12
12#define LIM(v, min, max) {if (v >= max) v = max; else if (v <= min) v = min;} 13#define LIM(v, min, max) {if (v >= max) v = max; else if (v <= min) v = min;}
13 14
@@ -207,7 +208,7 @@ config_shutdown(void)
207} 208}
208 209
209void 210void
210config_save(Config *config, const char *key) 211config_save(Config *config)
211{ 212{
212 Eet_File *ef; 213 Eet_File *ef;
213 char buf[PATH_MAX], buf2[PATH_MAX]; 214 char buf[PATH_MAX], buf2[PATH_MAX];
@@ -221,7 +222,6 @@ config_save(Config *config, const char *key)
221 main_config_sync(config); 222 main_config_sync(config);
222 return; 223 return;
223 } 224 }
224 if (!key) key = config->config_key;
225 config->font.orig_size = config->font.size; 225 config->font.orig_size = config->font.size;
226 eina_stringshare_del(config->font.orig_name); 226 eina_stringshare_del(config->font.orig_name);
227 config->font.orig_name = NULL; 227 config->font.orig_name = NULL;
@@ -236,7 +236,7 @@ config_save(Config *config, const char *key)
236 ef = eet_open(buf, EET_FILE_MODE_WRITE); 236 ef = eet_open(buf, EET_FILE_MODE_WRITE);
237 if (ef) 237 if (ef)
238 { 238 {
239 ok = eet_data_write(ef, edd_base, key, config, 1); 239 ok = eet_data_write(ef, edd_base, CONFIG_KEY, config, 1);
240 eet_close(ef); 240 eet_close(ef);
241 if (ok) ecore_file_mv(buf, buf2); 241 if (ok) ecore_file_mv(buf, buf2);
242 } 242 }
@@ -581,21 +581,19 @@ config_new(void)
581 581
582 582
583Config * 583Config *
584config_load(const char *key) 584config_load(void)
585{ 585{
586 Eet_File *ef; 586 Eet_File *ef;
587 char buf[PATH_MAX]; 587 char buf[PATH_MAX];
588 const char *cfgdir; 588 const char *cfgdir;
589 Config *config = NULL; 589 Config *config = NULL;
590 590
591 EINA_SAFETY_ON_NULL_RETURN_VAL(key, NULL);
592
593 cfgdir = _config_home_get(); 591 cfgdir = _config_home_get();
594 snprintf(buf, sizeof(buf), "%s/terminology/config/standard/base.cfg", cfgdir); 592 snprintf(buf, sizeof(buf), "%s/terminology/config/standard/base.cfg", cfgdir);
595 ef = eet_open(buf, EET_FILE_MODE_READ); 593 ef = eet_open(buf, EET_FILE_MODE_READ);
596 if (ef) 594 if (ef)
597 { 595 {
598 config = eet_data_read(ef, edd_base, key); 596 config = eet_data_read(ef, edd_base, CONFIG_KEY);
599 eet_close(ef); 597 eet_close(ef);
600 if (config) 598 if (config)
601 { 599 {
@@ -731,9 +729,6 @@ config_load(const char *key)
731 config->font_set = 1; 729 config->font_set = 1;
732 } 730 }
733 731
734 if (config)
735 config->config_key = eina_stringshare_add(key); /* not in eet */
736
737 return config; 732 return config;
738} 733}
739 734
@@ -804,7 +799,6 @@ config_fork(const Config *config)
804 CPY(mouse_over_focus); 799 CPY(mouse_over_focus);
805 CPY(disable_focus_visuals); 800 CPY(disable_focus_visuals);
806 CPY(temporary); 801 CPY(temporary);
807 SCPY(config_key);
808 CPY(font_set); 802 CPY(font_set);
809 CPY(gravatar); 803 CPY(gravatar);
810 CPY(notabs); 804 CPY(notabs);
@@ -851,8 +845,6 @@ config_del(Config *config)
851 eina_stringshare_del(config->helper.local.video); 845 eina_stringshare_del(config->helper.local.video);
852 eina_stringshare_del(config->helper.local.image); 846 eina_stringshare_del(config->helper.local.image);
853 847
854 eina_stringshare_del(config->config_key); /* not in eet */
855
856 EINA_LIST_FREE(config->keys, key) 848 EINA_LIST_FREE(config->keys, key)
857 { 849 {
858 eina_stringshare_del(key->keyname); 850 eina_stringshare_del(key->keyname);