[Goodies-commits] r1456 - in xfce4-clipman-plugin/trunk: . panel-plugin po

Nick Schermer nick at xfce.org
Wed Jun 21 20:45:26 CEST 2006


Author: nick
Date: 2006-06-21 18:45:20 +0000 (Wed, 21 Jun 2006)
New Revision: 1456

Added:
   xfce4-clipman-plugin/trunk/configure.in.in
   xfce4-clipman-plugin/trunk/po/ChangeLog
   xfce4-clipman-plugin/trunk/po/LINGUAS
Removed:
   xfce4-clipman-plugin/trunk/configure.ac
Modified:
   xfce4-clipman-plugin/trunk/autogen.sh
   xfce4-clipman-plugin/trunk/panel-plugin/clipman.c
   xfce4-clipman-plugin/trunk/panel-plugin/clipman.h
Log:
* Added LINGUAS support
* Drop a new clip if we can't convert the new title
* Clear board on exit plugin


Modified: xfce4-clipman-plugin/trunk/autogen.sh
===================================================================
--- xfce4-clipman-plugin/trunk/autogen.sh	2006-06-19 09:03:22 UTC (rev 1455)
+++ xfce4-clipman-plugin/trunk/autogen.sh	2006-06-21 18:45:20 UTC (rev 1456)
@@ -2,10 +2,10 @@
 #
 # $Id$
 #
-# Copyright (c) 2002-2005
-#         The Xfce development team. All rights reserved.
+# Copyright (c) 2002-2006
+#         The Thunar development team. All rights reserved.
 #
-# Written for Xfce by Benedikt Meurer <benny at xfce.org>.
+# Written for Thunar by Benedikt Meurer <benny at xfce.org>.
 #
 
 (type xdt-autogen) >/dev/null 2>&1 || {
@@ -18,6 +18,22 @@
   exit 1
 }
 
+# verify that po/LINGUAS is present
+(test -f po/LINGUAS) >/dev/null 2>&1 || {
+  cat >&2 <<EOF
+autogen.sh: The file po/LINGUAS could not be found. Please check your snapshot
+            or try to checkout again.
+EOF
+  exit 1
+}
+
+# substitute revision and linguas
+linguas=`sed -e '/^#/d' po/LINGUAS`
+revision=`LC_ALL=C svn info $0 | awk '/^Revision: / {printf "%05d\n", $2}'`
+sed -e "s/@LINGUAS@/${linguas}/g" \
+    -e "s/@REVISION@/${revision}/g" \
+    < "configure.in.in" > "configure.in"
+
 exec xdt-autogen $@
 
-# vi:set ts=2 sw=2 et ai:
\ No newline at end of file
+# vi:set ts=2 sw=2 et ai:

Deleted: xfce4-clipman-plugin/trunk/configure.ac

Added: xfce4-clipman-plugin/trunk/configure.in.in
===================================================================
--- xfce4-clipman-plugin/trunk/configure.in.in	                        (rev 0)
+++ xfce4-clipman-plugin/trunk/configure.in.in	2006-06-21 18:45:20 UTC (rev 1456)
@@ -0,0 +1,59 @@
+dnl configure.ac
+dnl
+dnl xfce4-clipman-plugin - Clipboard manager for the Xfce desktop
+dnl
+dnl 2005 Eduard Roccatello <eduard at xfce.org>
+dnl 2006 Nick Schermer <nick at xfce.org>
+dnl
+
+dnl version info
+m4_define([clipman_version], [0.6.4])
+
+dnl init autoconf
+AC_INIT([xfce4-clipman-plugin], [clipman_version], [nickschermer at gmail.com])
+AC_PREREQ([2.50])
+
+dnl init automake
+CLIPMAN_VERSION=clipman_version
+AM_INIT_AUTOMAKE([xfce4-clipman-plugin], [$CLIPMAN_VERSION])
+AM_CONFIG_HEADER([config.h])
+AM_MAINTAINER_MODE
+
+dnl check for basic programs
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LIBTOOL
+AC_PROG_INTLTOOL()
+
+dnl check for standard header files
+AC_HEADER_STDC
+
+dnl Check for X11 installed
+XDT_CHECK_LIBX11_REQUIRE
+
+dnl required
+XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.6.0])
+XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])
+XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.90])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.90])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.90])
+
+AC_MSG_CHECKING([whether to use new header dialog])
+if $PKG_CONFIG --atleast-version 4.3.90.2 libxfcegui4-1.0 >/dev/null 2>&1; then
+  AC_DEFINE([USE_NEW_DIALOG], [1], [Define to use new header dialog])
+  AC_MSG_RESULT([yes])
+else
+  AC_MSG_RESULT([no])
+fi
+
+dnl Check for i18n support
+XDT_I18N([@LINGUAS@])
+
+dnl check for debugging support
+XDT_FEATURE_DEBUG()
+
+AC_OUTPUT([
+Makefile
+panel-plugin/Makefile
+po/Makefile.in
+])


Property changes on: xfce4-clipman-plugin/trunk/configure.in.in
___________________________________________________________________
Name: svn:executable
   + *

Modified: xfce4-clipman-plugin/trunk/panel-plugin/clipman.c
===================================================================
--- xfce4-clipman-plugin/trunk/panel-plugin/clipman.c	2006-06-19 09:03:22 UTC (rev 1455)
+++ xfce4-clipman-plugin/trunk/panel-plugin/clipman.c	2006-06-21 18:45:20 UTC (rev 1456)
@@ -34,9 +34,14 @@
 #include "clipman.h"
 #include "clipman-dialogs.h"
 
-static void clipman_construct (XfcePanelPlugin *plugin);
+/* The clipboards */
+static GtkClipboard *primaryClip;
+static GtkClipboard *defaultClip;
 
-/* Register Plugin */
+/* Register the plugin */
+static void
+clipman_construct (XfcePanelPlugin *plugin);
+
 XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (clipman_construct);
 
 static void
@@ -83,6 +88,9 @@
         }
     }
     
+    /* 'Save' the empty clipboard */    
+    clipman_save (clipman->plugin, clipman);
+    
     return FALSE;
 }
 
@@ -103,7 +111,7 @@
     }
 }
 
-static gchar *
+gchar *
 clipman_create_title (gchar *txt,
                       gint   chars)
 {
@@ -120,12 +128,21 @@
         i++;
     }
 
-    if (!g_utf8_validate(s, -1, NULL))
+    if (!g_utf8_validate (s, -1, NULL))
     {
-        u = g_locale_to_utf8(s, -1, NULL, NULL, NULL);
+	DBG ("Title is not utf8 complaint, we're going to convert it");
+	
+        u = g_locale_to_utf8 (s, -1, NULL, NULL, NULL);
 	g_free (s);
 	s = u;
-        DBG("Title was not UTF-8 complaint");
+	
+	/* Check the title again */
+	if (!g_utf8_validate (s, -1, NULL))
+	{
+	    DBG ("Title is still not utf8 complaint, we going to drop this clip");
+	    g_free (s);
+	    return NULL;
+	}
     }
 
     g_strstrip (s);
@@ -188,9 +205,16 @@
     {
         new_clip = g_new0 (ClipmanClip, 1);
         
-        new_clip->text     = g_strdup (txt);
-        new_clip->title    = clipman_create_title (txt,
-	                                           clipman->MenuCharacters);
+        new_clip->title    = clipman_create_title (txt, clipman->MenuCharacters);
+	
+	/* No valid title could be created, drop it... */
+	if (new_clip->title == NULL)
+	{
+	    g_free (new_clip)
+	    return;
+	}
+	
+	new_clip->text     = g_strdup (txt);
         new_clip->fromtype = type;
         
         g_ptr_array_add (clipman->clips, new_clip);
@@ -973,7 +997,17 @@
     guint        i;
     ClipmanClip *clip;
     GtkWidget   *dialog;
+    
+    /* Valgrind notes:
+       - primaryClip and defaultClip should be cleared, but gtk
+         takes care about this
+    */
+    
+    /* Free the clipboards */
+    gtk_clipboard_clear (primaryClip);
+    gtk_clipboard_clear (defaultClip);
 
+    /* Destroy the setting dialog, if this open */
     dialog = g_object_get_data (G_OBJECT (plugin), "dialog");
 
     if (dialog)

Modified: xfce4-clipman-plugin/trunk/panel-plugin/clipman.h
===================================================================
--- xfce4-clipman-plugin/trunk/panel-plugin/clipman.h	2006-06-19 09:03:22 UTC (rev 1455)
+++ xfce4-clipman-plugin/trunk/panel-plugin/clipman.h	2006-06-21 18:45:20 UTC (rev 1456)
@@ -118,8 +118,6 @@
 void
 clipman_remove_selection_clips (ClipmanPlugin *clipman);
 
-GtkClipboard *primaryClip, *defaultClip;
-
 G_END_DECLS
 
 #endif /* CLIPMAN_H */

Added: xfce4-clipman-plugin/trunk/po/ChangeLog
===================================================================

Added: xfce4-clipman-plugin/trunk/po/LINGUAS
===================================================================
--- xfce4-clipman-plugin/trunk/po/LINGUAS	                        (rev 0)
+++ xfce4-clipman-plugin/trunk/po/LINGUAS	2006-06-21 18:45:20 UTC (rev 1456)
@@ -0,0 +1,2 @@
+# set of available languages (in alphabetic order)
+hu ja




More information about the Goodies-commits mailing list