diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2007-04-29 11:20:36 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2007-04-29 11:20:36 +0000 |
commit | 983ee1db888e8f478990ac900ce01cfefe30c890 (patch) | |
tree | d58ee78680258feb12ab96039a393b7784db1c54 /src/fe-common/core | |
parent | 09f2bf2c058da1e6dd57d67d71f45f2477dc5209 (diff) | |
download | irssi-983ee1db888e8f478990ac900ce01cfefe30c890.zip |
Factor out code from set_print into a function to get a printable
representation of a setting.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4470 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/core')
-rw-r--r-- | src/fe-common/core/fe-settings.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/fe-common/core/fe-settings.c b/src/fe-common/core/fe-settings.c index dccfcba9..24cf8b9e 100644 --- a/src/fe-common/core/fe-settings.c +++ b/src/fe-common/core/fe-settings.c @@ -33,28 +33,12 @@ static void set_print(SETTINGS_REC *rec) { - const char *value; - char value_int[MAX_INT_STRLEN]; - - switch (rec->type) { - case SETTING_TYPE_BOOLEAN: - value = settings_get_bool(rec->key) ? "ON" : "OFF"; - break; - case SETTING_TYPE_INT: - ltoa(value_int, settings_get_int(rec->key)); - value = value_int; - break; - case SETTING_TYPE_STRING: - case SETTING_TYPE_TIME: - case SETTING_TYPE_LEVEL: - case SETTING_TYPE_SIZE: - value = settings_get_str(rec->key); - break; - default: - value = ""; - } + char *value; + + value = settings_get_print(rec); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_SET_ITEM, rec->key, value); + g_free(value); } static void set_boolean(const char *key, const char *value) |