CVS: sylpheedclaws/sylpheed-claws/src/plugins/pgpmime plugin.c,1.1.2.22,1.1.2.23

[email protected] Fri, 15 Dec 2006 16:41:13 +0000
Newsgroups gmane.mail.sylpheed.claws.cvs
Message-ID <[email protected]>
Update of /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/plugins/pgpmime
In directory sunsite.dk:/tmp/cvs-serv8976/src/plugins/pgpmime

Modified Files:
      Tag: gtk2
	plugin.c 
Log Message:
2006-12-15 [wwp]	2.6.1cvs40

	* src/wizard.c
	* src/common/plugin.c
	* src/common/plugin.h
	* src/gtk/about.c
	* src/plugins/bogofilter/bogofilter.c
	* src/plugins/clamav/clamav_plugin.c
	* src/plugins/demo/demo.c
	* src/plugins/dillo_viewer/dillo_viewer.c
	* src/plugins/pgpcore/plugin.c
	* src/plugins/pgpinline/plugin.c
	* src/plugins/pgpmime/plugin.c
	* src/plugins/spamassassin/spamassassin.c
	* src/plugins/trayicon/trayicon.c
		factorize some translatable strings (plugins-related),
		fix missing punctuation in several places,
		remove useless translatable \n in about.c,
		and factorize plugin init code w/ a new function
		check_plugin_version() in common/plugin.c.
		Patch by Fabien Vantard <[email protected]>. 

Index: plugin.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/plugins/pgpmime/plugin.c,v
retrieving revision 1.1.2.22
retrieving revision 1.1.2.23
diff -u -d -r1.1.2.22 -r1.1.2.23
--- plugin.c	2006/11/27 08:07:17	1.1.2.22
+++ plugin.c	2006/12/15 16:41:09	1.1.2.23
@@ -28,18 +28,15 @@
 #include "version.h"
 #include "common/claws.h"
 #include "pgpmime.h"
+#include "plugin.h"
+
+#define PLUGIN_NAME (_("PGP/MIME"))
 
 gint plugin_init(gchar **error)
 {
-	if ((claws_get_version() > VERSION_NUMERIC)) {
-		*error = g_strdup(_("Your version of Claws Mail is newer than the version the PGP/MIME plugin was built with"));
-		return -1;
-	}
-
-	if ((claws_get_version() < MAKE_NUMERIC_VERSION(2, 1, 0, 1))) {
-		*error = g_strdup(_("Your version of Claws Mail is too old for the PGP/MIME plugin"));
+	if (!check_plugin_version(MAKE_NUMERIC_VERSION(2, 1, 0, 1),
+				VERSION_NUMERIC, PLUGIN_NAME, error))
 		return -1;
-	}
 
 	pgpmime_init();
 
@@ -53,7 +50,7 @@
 
 const gchar *plugin_name(void)
 {
-	return _("PGP/MIME");
+	return PLUGIN_NAME;
 }
 
 const gchar *plugin_desc(void)