CVS: sylpheedclaws/sylpheed-claws/src/plugins/demo demo.c,1.13.2.11,1.13.2.12

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

Modified Files:
      Tag: gtk2
	demo.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: demo.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/plugins/demo/demo.c,v
retrieving revision 1.13.2.11
retrieving revision 1.13.2.12
diff -u -d -r1.13.2.11 -r1.13.2.12
--- demo.c	2006/11/27 08:07:04	1.13.2.11
+++ demo.c	2006/12/15 16:41:03	1.13.2.12
@@ -17,7 +17,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
- #include <glib.h>
+#include <glib.h>
 #include <glib/gi18n.h>
 
 
@@ -28,6 +28,8 @@
 #include "hooks.h"
 #include "log.h"
 
+#define PLUGIN_NAME (_("Demo"))
+
 gboolean my_log_hook(gpointer source, gpointer data)
 {
 	LogText *logtext = (LogText *)source;
@@ -41,15 +43,9 @@
 
 gint plugin_init(gchar **error)
 {
-	if ((claws_get_version() > VERSION_NUMERIC)) {
-		*error = g_strdup(_("Your claws-mail version is newer than the version the plugin was built with"));
-		return -1;
-	}
-
-	if ((claws_get_version() < MAKE_NUMERIC_VERSION(0, 8, 11, 39))) {
-		*error = g_strdup(_("Your claws-mail version is too old"));
+	if (!check_plugin_version(MAKE_NUMERIC_VERSION(0, 8, 11, 39),
+				VERSION_NUMERIC, PLUGIN_NAME, error))
 		return -1;
-	}
 
 	hook_id = hooks_register_hook(LOG_APPEND_TEXT_HOOKLIST, my_log_hook, NULL);
 	if (hook_id == -1) {
@@ -71,7 +67,7 @@
 
 const gchar *plugin_name(void)
 {
-	return _("Demo");
+	return PLUGIN_NAME;
 }
 
 const gchar *plugin_desc(void)
@@ -79,7 +75,7 @@
 	return _("This Plugin is only a demo of how to write plugins for Claws Mail. "
 	         "It installs a hook for new log output and writes it to stdout."
 	         "\n\n"
-	         "It is not really useful");
+	         "It is not really useful.");
 }
 
 const gchar *plugin_type(void)