[Commits] [SCM] claws branch, master, updated. 3.14.0-21-g8395c4c

ticho at claws-mail.org ticho at claws-mail.org
Sun Aug 21 23:00:35 CEST 2016


The branch, master has been updated
       via  8395c4c673c7d313f24050d030491412e808192c (commit)
      from  89af524b6729737d8a3ad22a4aa1fe27481f80d1 (commit)

Summary of changes:
 src/common/plugin.c |   18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)


- Log -----------------------------------------------------------------
commit 8395c4c673c7d313f24050d030491412e808192c
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sun Aug 21 22:59:42 2016 +0200

    Deduplicate string for plugins' block prefix in clawsrc.

diff --git a/src/common/plugin.c b/src/common/plugin.c
index 91c8ef1..5677214 100644
--- 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);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list