summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-11-14 16:28:56 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-11-14 16:28:56 +0000
commita9a380fd54357f8a762f83175eaac2642de3663b (patch)
treec941cbda1d4db9972865c76b607fa4b306682525 /src
parent8f461f72e6dc9bf565c3542d084ffff98cb2fbae (diff)
downloadirssi-a9a380fd54357f8a762f83175eaac2642de3663b.zip
settings_save() now sends "setup saved" signal - patch by peder@ifi.uio.no
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2003 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/core/settings.c7
-rw-r--r--src/core/settings.h2
-rw-r--r--src/fe-common/core/fe-settings.c2
3 files changed, 6 insertions, 5 deletions
diff --git a/src/core/settings.c b/src/core/settings.c
index bbc85b97..a827aeff 100644
--- a/src/core/settings.c
+++ b/src/core/settings.c
@@ -584,7 +584,7 @@ int settings_reread(const char *fname)
return TRUE;
}
-int settings_save(const char *fname)
+int settings_save(const char *fname, int autosave)
{
char *str;
int error;
@@ -601,6 +601,7 @@ int settings_save(const char *fname)
signal_emit("gui dialog", 2, "error", str);
g_free(str);
}
+ signal_emit("setup saved", 2, fname, GINT_TO_POINTER(autosave);
return !error;
}
@@ -613,7 +614,7 @@ static void sig_autosave(void)
return;
if (!irssi_config_is_changed(NULL))
- settings_save(NULL);
+ settings_save(NULL, TRUE);
else {
fname = g_strconcat(mainconfig->fname, ".autosave", NULL);
str = g_strdup_printf("Configuration file was modified "
@@ -624,7 +625,7 @@ static void sig_autosave(void)
signal_emit("gui dialog", 2, "warning", str);
g_free(str);
- settings_save(fname);
+ settings_save(fname, TRUE);
g_free(fname);
}
}
diff --git a/src/core/settings.h b/src/core/settings.h
index b68c4d26..e0df975a 100644
--- a/src/core/settings.h
+++ b/src/core/settings.h
@@ -81,7 +81,7 @@ void settings_clean_invalid(void);
/* if `fname' is NULL, the default is used */
int settings_reread(const char *fname);
-int settings_save(const char *fname);
+int settings_save(const char *fname, int autosave);
int irssi_config_is_changed(const char *fname);
void settings_init(void);
diff --git a/src/fe-common/core/fe-settings.c b/src/fe-common/core/fe-settings.c
index ba838663..71ec1bf1 100644
--- a/src/fe-common/core/fe-settings.c
+++ b/src/fe-common/core/fe-settings.c
@@ -258,7 +258,7 @@ static void cmd_reload(const char *data)
static void settings_save_fe(const char *fname)
{
- if (settings_save(fname)) {
+ if (settings_save(fname, FALSE /* not autosaved */)) {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
TXT_CONFIG_SAVED, fname);
}