SF.net SVN: geany: [1608] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sun Jun 10 20:09:22 UTC 2007


Revision: 1608
          http://svn.sourceforge.net/geany/?rev=1608&view=rev
Author:   eht16
Date:     2007-06-10 13:09:22 -0700 (Sun, 10 Jun 2007)

Log Message:
-----------
Fix broken help menu item on Windows. Add additional directory separator to generated READMEs.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/callbacks.c
    trunk/src/utils.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-06-10 19:28:50 UTC (rev 1607)
+++ trunk/ChangeLog	2007-06-10 20:09:22 UTC (rev 1608)
@@ -4,13 +4,15 @@
                     symbol list item.
  * src/build.c: Hide Next Error menu item and unnecessary separator from
                 build menu on Windows.
+ * src/callbacks.c: Fix broken help menu item on Windows.
+ * src/utils.c: Add additional directory separator to generated READMEs.
 
 
 2007-06-09  Enrico Tröger  <enrico.troeger at uvena.de>
 
  * THANKS, src/document.c:
-   Apply from François Cami and Guillaume Duviol to improve replacement
-   of tabs by spaces (thank you).
+   Apply patch from François Cami and Guillaume Duviol to improve
+   replacement of tabs by spaces (thank you).
  * src/templates.c: Change PHP short open tag to the full open tag.
  * src/document.c: Prevent hang if searching for a regular expression
                    fails (closes #1733676).

Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c	2007-06-10 19:28:50 UTC (rev 1607)
+++ trunk/src/callbacks.c	2007-06-10 20:09:22 UTC (rev 1608)
@@ -1391,13 +1391,19 @@
 on_help1_activate                      (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
+	gint skip;
+	gchar *uri;
+
 #ifdef G_OS_WIN32
-	gchar *uri = g_strconcat("file:///", g_path_skip_root(app->docdir), "/index.html", NULL);
+	skip = 8;
+	uri = g_strconcat("file:///", app->docdir, "/index.html", NULL);
+	g_strdelimit(uri, "\\", '/'); // replace '\\' by '/'
 #else
-	gchar *uri = g_strconcat("file://", app->docdir, "index.html", NULL);
+	skip = 7;
+	uri = g_strconcat("file://", app->docdir, "index.html", NULL);
 #endif
 
-	if (! g_file_test(uri + 7, G_FILE_TEST_IS_REGULAR))
+	if (! g_file_test(uri + skip, G_FILE_TEST_IS_REGULAR))
 	{	// fall back to online documentation if it is not found on the hard disk
 		g_free(uri);
 		uri = g_strconcat(GEANY_HOMEPAGE, "manual/index.html", NULL);

Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c	2007-06-10 19:28:50 UTC (rev 1607)
+++ trunk/src/utils.c	2007-06-10 20:09:22 UTC (rev 1608)
@@ -812,6 +812,11 @@
 	{	// try to write geany.conf
 		error_nr = access(app->configdir, W_OK);
 	}
+#ifdef G_OS_WIN32
+# define DIR_SEP "\\" // on Windows we need an additional dir separator
+#else
+# define DIR_SEP ""
+#endif
 
 	// make subdir for filetype definitions
 	if (error_nr == 0)
@@ -828,7 +833,7 @@
 			gchar *text = g_strconcat(
 "Copy files from ", data_dir, " to this directory to overwrite "
 "them. To use the defaults, just delete the file in this directory.\nFor more information read "
-"the documentation (in ", doc_dir, "index.html or visit " GEANY_HOMEPAGE ").", NULL);
+"the documentation (in ", doc_dir, DIR_SEP "index.html or visit " GEANY_HOMEPAGE ").", NULL);
 			utils_write_file(filedefs_readme, text);
 			g_free(text);
 		}
@@ -849,7 +854,7 @@
 		{
 			gchar *text = g_strconcat(
 "There are several template files in this directory. For these templates you can use wildcards.\n\
-For more information read the documentation (in ", doc_dir, "index.html or visit " GEANY_HOMEPAGE ").",
+For more information read the documentation (in ", doc_dir, DIR_SEP "index.html or visit " GEANY_HOMEPAGE ").",
 					NULL);
 			utils_write_file(templates_readme, text);
 			g_free(text);


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