Deduplicate string for plugins' block prefix in clawsrc.
[claws.git] / src / common / plugin.c
index 91c8ef15210f432f3324eb96a7d5b75e24e89aa4..56772148589d969b95927360d335e1ebb3cbcf5c 100644 (file)
 #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);