← Back to team overview

kicad-developers team mailing list archive

pcbnew file import plugins

 

After looking into and discussing
https://bugs.launchpad.net/kicad/+bug/1551628 with nick i am not sure
the filter is the best way of advising kicad of which plugin to use

I was thinking the best way to solve this would be for each of the
plugins to have a static
 "bool CanYouHandleThis( FILE )"
function (obviously with a better name) and when a file is loaded each
of the plugins are checked to see if they understand the file,

With each of the responses if they are all no, then a error can be
reported, and for any that are yes the loading can then be handed off
to it/them (if dynamic plugins are enabled at some point in the future
(which you would really need some sort of what can you read interface
anyway) then you may get to the point where multiple can handle a
single file)

This would allow the user to not have to set the filter which i am not
sure many people would think as the problem anyway as far as i am
aware its not the normal method for setting what type a file is. And
also move away from blindly trusting extensions

Thanks

Simon


Follow ups