From b15fe1ddf13de866d1ad8068db1d4632b5bbe094 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Thu, 24 Nov 2011 23:37:43 +0100 Subject: [PATCH] fix fishlim config handler --- plugins/fishlim/keystore.c | 10 +--------- plugins/fishlim/xchat_plugin.c | 8 ++++++++ plugins/fishlim/xchat_plugin.h | 1 + 3 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 plugins/fishlim/xchat_plugin.h diff --git a/plugins/fishlim/keystore.c b/plugins/fishlim/keystore.c index 6eccccaf..ff30faa7 100644 --- a/plugins/fishlim/keystore.c +++ b/plugins/fishlim/keystore.c @@ -29,20 +29,12 @@ #include "fish.h" #include "misc.h" #include "keystore.h" +#include "xchat_plugin.h" static char *keystore_password = NULL; -/** - * Returns the path to the key store file. - */ -static gchar *get_config_filename() { - // TODO use xchat_get_info(ph, "xchatdirfs") - const gchar *homedir = g_get_home_dir(); - return g_build_filename(homedir, ".xchat2", "blow.ini", NULL); -} - /** * Opens the key store file: ~/.xchat2/blow.ini */ diff --git a/plugins/fishlim/xchat_plugin.c b/plugins/fishlim/xchat_plugin.c index dc67fddb..dd410548 100644 --- a/plugins/fishlim/xchat_plugin.c +++ b/plugins/fishlim/xchat_plugin.c @@ -22,6 +22,7 @@ */ +#include #include #include @@ -47,6 +48,13 @@ static const char usage_delkey[] = "Usage: DELKEY , deletes th static xchat_plugin *ph; +/** + * Returns the path to the key store file. + */ +gchar *get_config_filename() { + return g_build_filename(xchat_get_info(ph, "xchatdirfs"), "blow.ini", NULL); +} + /** * Appends data to a string. Returns true if there was sufficient memory. * Frees *s and returns false if an error occurs. diff --git a/plugins/fishlim/xchat_plugin.h b/plugins/fishlim/xchat_plugin.h new file mode 100644 index 00000000..40e21816 --- /dev/null +++ b/plugins/fishlim/xchat_plugin.h @@ -0,0 +1 @@ +gchar *get_config_filename();