Fixed path to start external tools, added QucsApp::launchTool() function #175
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had installed Qucs in a local directory, in parallel with the main system-wide install, and noticed that the external tools launched (
qucsfilter
,qucstrans
, etc.) were always the ones from the system wide installation.Looking at the code I think there is a copy-and-paste error, in that almost all the tools were launched with code like
so the actual tool launched was the one in the environment path, but the debug message printed contained the right path !!
I took the opportunity to clean up this part of the code, eliminating the copy/paste and adding a new
launchTool()
function.Note that the code could probably be simplified even more, also in
qucs_init.cpp
, by having a Tool class handling the available external tools registration, where each registered tool will provide its executable name and its description to use in menus and messages, so the Tools menu built starting at https://github.com/Qucs/qucs/blob/master/qucs/qucs/qucs_init.cpp#L525 and https://github.com/Qucs/qucs/blob/master/qucs/qucs/qucs_init.cpp#L766 could "just" be built iterating over the available tools... but honestly it's still not clear to me if and how this could be done, so for the moment I am stopping here 馃槈Edit: just fixed syntax error in #elif APPLE part of last modification.