Commit 18873eed authored by James Liggett's avatar James Liggett

Add utility function for converting lists of GFile objects to lists of

	* libanjuta/anjuta-utils.c:
	* libanjuta/anjuta-utils.h:
	Add utility function for converting lists of GFile objects to lists of 
	relative paths.

svn path=/trunk/; revision=4745
parent e8e43456
2009-02-15 James Liggett <jim@jim-desktop>
* libanjuta/anjuta-utils.c:
* libanjuta/anjuta-utils.h:
Add utility function for converting lists of GFile objects to lists of
relative paths.
2009-02-15 Johannes Schmid <jhs@gnome.org>
* plugins/project-wizard/templates/Makefile.am:
......@@ -1958,3 +1958,34 @@ anjuta_util_convert_gfile_list_to_path_list (GList *list)
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;
}
......@@ -137,6 +137,8 @@ gchar* anjuta_util_get_user_config_file_path (const gchar* path, ...);
/* 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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment