anjuta r4745 - in trunk: . libanjuta
- From: jrliggett svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r4745 - in trunk: . libanjuta
- Date: Sun, 15 Feb 2009 22:58:02 +0000 (UTC)
Author: jrliggett
Date: Sun Feb 15 22:58:02 2009
New Revision: 4745
URL: http://svn.gnome.org/viewvc/anjuta?rev=4745&view=rev
Log:
* libanjuta/anjuta-utils.c:
* libanjuta/anjuta-utils.h:
Add utility function for converting lists of GFile objects to lists of
relative paths.
Modified:
trunk/ChangeLog
trunk/libanjuta/anjuta-utils.c
trunk/libanjuta/anjuta-utils.h
Modified: trunk/libanjuta/anjuta-utils.c
==============================================================================
--- trunk/libanjuta/anjuta-utils.c (original)
+++ trunk/libanjuta/anjuta-utils.c Sun Feb 15 22:58:02 2009
@@ -1958,3 +1958,34 @@
return path_list;
}
+GList *
+anjuta_util_convert_gfile_list_to_relative_path_list (GList *list,
+ const gchar *parent)
+{
+ GFile *parent_file;
+ GList *path_list;
+ GList *current_file;
+ gchar *path;
+
+ parent_file = g_file_new_for_path (parent);
+ path_list = NULL;
+
+ if (parent_file)
+ {
+ current_file = list;
+
+ while (current_file)
+ {
+ path = g_file_get_relative_path (parent_file, current_file->data);
+
+ /* Ignore files with invalid paths */
+ if (path)
+ path_list = g_list_append (path_list, path);
+ }
+
+ g_object_unref (parent_file);
+ }
+
+ return path_list;
+}
+
Modified: trunk/libanjuta/anjuta-utils.h
==============================================================================
--- trunk/libanjuta/anjuta-utils.h (original)
+++ trunk/libanjuta/anjuta-utils.h Sun Feb 15 22:58:02 2009
@@ -137,6 +137,8 @@
/* Function for converting GFile objects to string paths
* Free the returned list with anjuta_util_glist_strings_free. */
GList *anjuta_util_convert_gfile_list_to_path_list (GList *list);
+GList *anjuta_util_convert_gfile_list_to_relative_path_list (GList *list,
+ const gchar *parent);
/* Temporarily copied here */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]