[QGIS-Developer] [qgis/QGIS] Allow setting a custom path pre-processor for QgsPathResolver (#30842)

Raymond Nijssen r.nijssen at terglobo.nl
Fri Aug 16 05:24:30 PDT 2019


Hi Nyall and others here,

I'm writing here to the dev list because the PR has already been pulled 
and closed.

We implemented this new code in our plugin and it works very well! One 
thing is bothering me though, and I hope I am wrong here.

As I wanted to do a clean up in the plugin unload method, I figured I 
can never remove the preprocessor. Since our plugin overwrites the 
pathPreprocessor, it also overwrites any existing preprocessor. Or even 
worse, another plugin could overwrite ours! :)

I think the most elegant solution is a list of pathPreprocessors that 
will return either the input path or an edited one (like now). The path 
resolver would run them all in a chain and fix all paths for all 
plugins. By giving them an ID, it would also be possible to remove them 
(or overwrite them with a processor that always returns the input) on 
unloading the plugin.

I guess this is quite some work for a not much used feature (yet) and 
maybe the reason you chose to implement it this less comlplicated way. 
But it is potentially really hard to debug problems if 2 or more plugins 
collide on this and we want to reproduce the error. We would need to 
know all the plugins and versions our users have installed and look into 
that code.

Am I right? Please let me know your thoughts about this.

Kind regards,
Raymond



On 25-07-19 00:41, Nyall Dawson wrote:
> Merged #30842 <https://github.com/qgis/QGIS/pull/30842> into master.
> 
>> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub 
> <https://github.com/qgis/QGIS/pull/30842?email_source=notifications&email_token=AAFGO63EK64SG3XXAUAIAVTQBDLC3A5CNFSM4IFT6T2KYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOSV5I2GQ#event-2507836698>, 
> or mute the thread 
> <https://github.com/notifications/unsubscribe-auth/AAFGO63PMWSOTDPTH365GSLQBDLC3ANCNFSM4IFT6T2A>.
> 


More information about the QGIS-Developer mailing list