anjuta r4678 - in trunk: . plugins/gbf-am plugins/gbf-mkfile



Author: jhs
Date: Mon Feb  2 08:30:11 2009
New Revision: 4678
URL: http://svn.gnome.org/viewvc/anjuta?rev=4678&view=rev

Log:
2009-02-02  Jens Georg  <mail jensge org>

	* plugins/gbf-am/gbf-am-project.c (uri_is_parent), (uri_normalize),
	(uri_get_chrooted_path):
	* plugins/gbf-mkfile/gbf-mkfile-project.c (uri_is_parent),
	(uri_get_chrooted_path):
	
	#511589 - fix c&p error in uri_is_parent; fix uri_get_chrooted_path to 
	return paths starting with "/"

Modified:
   trunk/ChangeLog
   trunk/plugins/gbf-am/gbf-am-project.c
   trunk/plugins/gbf-mkfile/gbf-mkfile-project.c

Modified: trunk/plugins/gbf-am/gbf-am-project.c
==============================================================================
--- trunk/plugins/gbf-am/gbf-am-project.c	(original)
+++ trunk/plugins/gbf-am/gbf-am-project.c	Mon Feb  2 08:30:11 2009
@@ -308,7 +308,7 @@
 
 	parent = g_file_new_for_commandline_arg (parent_uri);
 	child = g_file_new_for_commandline_arg (child_uri);
-	retval = g_file_equal (parent, child);
+	retval = g_file_has_prefix (child, parent);
 	g_object_unref (parent);
 	g_object_unref (child);
 
@@ -366,8 +366,6 @@
 		g_object_unref (file);
 	}
 
-	GBF_DEBUG (g_debug (G_STRLOC" path_or_uri: %s, base_uri: %s, normalized: %s\n",
-		path_or_uri, base_uri, normalized_uri));
 	return normalized_uri;
 }
 
@@ -393,11 +391,13 @@
 	}
 	else
 	{
-
+		gchar *tmp;
 		root = g_file_new_for_uri (root_uri);
 		file = g_file_new_for_uri (uri);
 
-		path = g_file_get_relative_path (root, file);
+		tmp = g_file_get_relative_path (root, file);
+		path = g_build_filename (G_DIR_SEPARATOR_S, tmp, NULL);
+		g_free (tmp);
 
 		g_object_unref (root);
 		g_object_unref (file);

Modified: trunk/plugins/gbf-mkfile/gbf-mkfile-project.c
==============================================================================
--- trunk/plugins/gbf-mkfile/gbf-mkfile-project.c	(original)
+++ trunk/plugins/gbf-mkfile/gbf-mkfile-project.c	Mon Feb  2 08:30:11 2009
@@ -300,7 +300,7 @@
 
 	parent = g_file_new_for_commandline_arg (parent_uri);
 	child = g_file_new_for_commandline_arg (child_uri);
-	retval = g_file_equal (parent, child);
+	retval = g_file_has_prefix (child, parent);
 	g_object_unref (parent);
 	g_object_unref (child);
 
@@ -385,11 +385,13 @@
 	}
 	else
 	{
-
+		char *tmp;
 		root = g_file_new_for_uri (root_uri);
 		file = g_file_new_for_uri (uri);
 
-		path = g_file_get_relative_path (root, file);
+		tmp = g_file_get_relative_path (root, file);
+		path = g_build_filename (G_DIR_SEPARATOR_S, tmp, NULL);
+		g_free (tmp);
 
 		g_object_unref (root);
 		g_object_unref (file);



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