SF.net SVN: geany:[5003] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sun Jun 6 17:21:52 UTC 2010


Revision: 5003
          http://geany.svn.sourceforge.net/geany/?rev=5003&view=rev
Author:   eht16
Date:     2010-06-06 17:21:52 +0000 (Sun, 06 Jun 2010)

Log Message:
-----------
Fix reducing paths to project name in the Documents list (patch by Eugene Arshinov, thanks).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/sidebar.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-06-06 17:14:35 UTC (rev 5002)
+++ trunk/ChangeLog	2010-06-06 17:21:52 UTC (rev 5003)
@@ -2,6 +2,9 @@
 
  * tagmanager/tm_workspace.c:
    Fix two memory leaks (patch by Daniel Marjamaki, thanks).
+ * src/sidebar.c:
+   Fix reducing paths to project name in the Documents list
+   (patch by Eugene Arshinov, thanks).
 
 
 2010-06-04  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/src/sidebar.c
===================================================================
--- trunk/src/sidebar.c	2010-06-06 17:14:35 UTC (rev 5002)
+++ trunk/src/sidebar.c	2010-06-06 17:21:52 UTC (rev 5003)
@@ -359,20 +359,15 @@
 		gsize len = strlen(project_base_path);
 		const gchar *rest;
 
+		if (project_base_path[len-1] == G_DIR_SEPARATOR)
+			project_base_path[len-1] = '\0';
+
 		/* check whether the dir name matches or uses the project base path */
-		if (!utils_str_equal(project_base_path, tmp_dirname))
-		{
-			const gchar *sep =
-				(project_base_path[len-1] == G_DIR_SEPARATOR) ? NULL : G_DIR_SEPARATOR_S;
-			setptr(project_base_path, g_strconcat(project_base_path, sep, NULL));
-		}
 		if (g_str_has_prefix(tmp_dirname, project_base_path))
 		{
 			rest = tmp_dirname + len;
-			dirname = g_strdup_printf("%s%s%s",
-				app->project->name,
-				(*rest != G_DIR_SEPARATOR && *rest != '\0') ? G_DIR_SEPARATOR_S : "",
-				rest);
+			if (*rest == G_DIR_SEPARATOR || *rest == '\0')
+				dirname = g_strdup_printf("%s%s", app->project->name, rest);
 		}
 		g_free(project_base_path);
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list