commit 8395c4c673c7d313f24050d030491412e808192c
parent 89af524b6729737d8a3ad22a4aa1fe27481f80d1
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Sun, 21 Aug 2016 22:59:42 +0200
Deduplicate string for plugins' block prefix in clawsrc.
Diffstat:
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/common/plugin.c b/src/common/plugin.c
@@ -42,6 +42,12 @@
#include "claws.h"
#include "timing.h"
+#ifdef G_OS_WIN32
+#define PLUGINS_BLOCK_PREFIX "PluginsWin32_"
+#else
+#define PLUGINS_BLOCK_PREFIX "Plugins_"
+#endif
+
struct _Plugin
{
gchar *filename;
@@ -142,11 +148,7 @@ void plugin_save_list(void)
for (type_cur = plugin_types; type_cur != NULL; type_cur = g_slist_next(type_cur)) {
rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
-#ifdef G_OS_WIN32
- block = g_strconcat("PluginsWin32_", type_cur->data, NULL);
-#else
- block = g_strconcat("Plugins_", type_cur->data, NULL);
-#endif
+ block = g_strconcat(PLUGINS_BLOCK_PREFIX, type_cur->data, NULL);
if ((pfile = prefs_write_open(rcpath)) == NULL ||
(prefs_set_block_label(pfile, block) < 0)) {
g_warning("failed to write plugin list");
@@ -593,11 +595,7 @@ void plugin_load_all(const gchar *type)
plugin_types = g_slist_append(plugin_types, g_strdup(type));
rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
-#ifdef G_OS_WIN32
- block = g_strconcat("PluginsWin32_", type, NULL);
-#else
- block = g_strconcat("Plugins_", type, NULL);
-#endif
+ block = g_strconcat(PLUGINS_BLOCK_PREFIX, type, NULL);
if ((pfile = prefs_read_open(rcpath)) == NULL ||
(prefs_set_block_label(pfile, block) < 0)) {
g_free(rcpath);