[nautilus-actions] Define nactuti_free_string_list new function



commit e95a81b95b6989f32a40bdd3ebe17f7e88d27ebc
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Jun 1 15:08:26 2009 +0200

    Define nactuti_free_string_list new function
---
 ChangeLog              |   14 ++++++++----
 src/common/Makefile.am |    2 +
 src/common/uti-lists.c |   49 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/common/uti-lists.h |   46 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 106 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 32d4751..83df80a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,13 +10,17 @@
 	Add forward declarations of, remove prefix from, static functions.
 	Do nothing on get_background_items callback.
 
-	* nact-gconf.c:
-	* nact-gconf.h:
-	* nact-gconf-keys.h:
-	* nact-storage.c:
-	* nact-storage.h:
+	* src/common/nact-gconf.c:
+	* src/common/nact-gconf.h:
+	* src/common/nact-gconf-keys.h:
+	* src/common/nact-storage.c:
+	* src/common/nact-storage.h:
 	New files, prepare for a new object hierarchy (with shorter names).
 
+	* src/common/uti-lists.c:
+	* src/common/uti-lists.h:
+	(nactuti_free_string_list) new function.
+
 2009-05-29 Pierre Wieser <pwieser trychlos org>
 
 	Move all sources directories under src/
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index 4402149..9ec148d 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -53,6 +53,8 @@ libnact_la_SOURCES = \
 	nautilus-actions-config-schema-writer.h		\
 	nautilus-actions-config-schema-reader.c		\
 	nautilus-actions-config-schema-reader.h		\
+	uti-lists.c									\
+	uti-lists.h									\
 	$(NULL)
 
 libnact_la_LIBADD = -lxml2 -luuid
diff --git a/src/common/uti-lists.c b/src/common/uti-lists.c
new file mode 100644
index 0000000..37f92c1
--- /dev/null
+++ b/src/common/uti-lists.c
@@ -0,0 +1,49 @@
+/*
+ * Nautilus Actions
+ * A Nautilus extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
+ *
+ * This Program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this Library; see the file COPYING.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include "uti-lists.h"
+
+/**
+ * Free a GSList of strings.
+ *
+ * @list: the GSList to be freed.
+ */
+void
+nactuti_free_string_list( GSList *list )
+{
+	GSList *item;
+	for( item = list ; item != NULL ; item = item->next ){
+		g_free(( gchar * ) item->data );
+	}
+	g_slist_free( list );
+}
diff --git a/src/common/uti-lists.h b/src/common/uti-lists.h
new file mode 100644
index 0000000..9d7465e
--- /dev/null
+++ b/src/common/uti-lists.h
@@ -0,0 +1,46 @@
+/*
+ * Nautilus Actions
+ * A Nautilus extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
+ *
+ * This Program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this Library; see the file COPYING.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifndef __NACTUTI_LISTS_H__
+#define __NACTUTI_LISTS_H__
+
+/*
+ * Some functions to ease the GSList list manipulations.
+ */
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+void     nactuti_free_string_list( GSList *list );
+
+G_END_DECLS
+
+#endif /* __NACTUTI_LISTS_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]