> @@ -94,6 +94,54 @@ PLUGIN_SET_TRANSLATABLE_INFO(LOCALEDIR, GETTEXT_PACKAGE, 
> PLUGIN_NAME,
>                               PLUGIN_VERSION, "Enrico Trotta 
> <[email protected]>")
>  
>  
> +/* Windows compatibility for resolving system plugin data path.
> + * This only works if the plugin's data is installed in the same tree as the
> + * plugin DLL, which might not be true (as the DLL has to be in Geany's 
> libdir
> + * but the plugin's data might be anywhere in theory) */

@codebrainz Actually GRssource is probably not the best idea here, as those are 
more configuration than data files the plugin requires.  GResource look like a 
good idea for UI definitions, icons or the like, things that are part of the 
app itself, but sounds odd for configuration.

@eht16 
> Why so complicated?
`g_win32_get_package_installation_directory_of_module(NULL);` works perfectly 
fine and returns "C:\Program Files (x86)\Geany". We use exactly this also in 
Geany itself.

Yeah, that does the same as my more complicated version if both are installed 
at the same location (which is the installer thing).  And it's probably fine, 
as my version doesn't handle better the case the data files are not next to the 
plugin DLL either.
It's slightly worse in theory IMO, as my version should work also if the plugin 
was installed in a 3rd part directory, and Geany made to look in that tree's 
*lib/* folder -- as it would look for the files in that tree rather than 
Geany's.

> Btw, PLUGINDATADIR cannot be used here because it contains the absolute path 
> of the prefix used at `./configure`.

Sad.  We probably should make this one also usable, like others.
Though, I successfully used it by doing `./configure --prefix=/ && make install 
DESTDIR=/somewhere` -- this "fixes" all paths at once as it removes all prefix.

---

Looking at either of those, I wonder if we shound't provide a 
`libgeany-plugins` GP plugins can link to and which would provide the path 
lookups (so has access to GP's configured directories at least on *NIX, which 
code in Geany couldn't).  Looks like many plugins could need something like 
this.

---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/402/files#r55922038

Reply via email to