[geany/geany-plugins] b0e81f: markdown: Fix finding the help file on Windows

Colomban Wendling git-noreply at xxxxx
Sat Mar 12 23:30:03 UTC 2016


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sat, 12 Mar 2016 23:30:03 UTC
Commit:      b0e81f7f07d69139f424c54139c9fba7eb4db7a9
             https://github.com/geany/geany-plugins/commit/b0e81f7f07d69139f424c54139c9fba7eb4db7a9

Log Message:
-----------
markdown: Fix finding the help file on Windows


Modified Paths:
--------------
    markdown/src/Makefile.am
    markdown/src/plugin.c

Modified: markdown/src/Makefile.am
6 lines changed, 3 insertions(+), 3 deletions(-)
===================================================================
@@ -18,9 +18,9 @@ noinst_HEADERS = \
 markdown_la_CFLAGS = \
 	$(AM_CFLAGS) \
 	$(MARKDOWN_CFLAGS) \
-	-DMARKDOWN_DATA_DIR=\"$(pkgdatadir)/markdown\" \
-	-DMARKDOWN_DOC_DIR=\"$(docdir)/markdown\" \
-	-DMARKDOWN_HELP_FILE=\"$(docdir)/markdown/html/help.html\"
+	-DMARKDOWN_DATA_DIR=PLUGINDATADIR \
+	-DMARKDOWN_DOC_DIR=PLUGINDOCDIR \
+	-DMARKDOWN_HELP_FILE=\"$(GP_DOCDIR)/$(plugin)/html/help.html\"
 
 markdown_la_LIBADD = \
 	$(COMMONLIBS) \


Modified: markdown/src/plugin.c
13 lines changed, 11 insertions(+), 2 deletions(-)
===================================================================
@@ -46,7 +46,6 @@ PLUGIN_SET_TRANSLATABLE_INFO(LOCALEDIR, GETTEXT_PACKAGE,
 #ifndef MARKDOWN_HELP_FILE
 #  define MARKDOWN_HELP_FILE MARKDOWN_DOC_DIR "/html/help.html"
 #endif
-#define MARKDOWN_HELP_FILE_URI "file://" MARKDOWN_HELP_FILE
 
 #define MARKDOWN_PREVIEW_LABEL _("Markdown Preview")
 
@@ -138,7 +137,17 @@ GtkWidget *plugin_configure(GtkDialog *dialog)
 /* Called to show the plugin's help */
 void plugin_help(void)
 {
-  utils_open_browser(MARKDOWN_HELP_FILE_URI);
+#ifdef G_OS_WIN32
+  gchar *prefix = g_win32_get_package_installation_directory_of_module(NULL);
+#else
+  gchar *prefix = NULL;
+#endif
+  gchar *uri = g_strconcat("file://", prefix ? prefix : "", MARKDOWN_HELP_FILE, NULL);
+
+  utils_open_browser(uri);
+
+  g_free(uri);
+  g_free(prefix);
 }
 
 /* All of the various signal handlers call this function to update the



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list