yorikvanhavre / BIM_Workbench

A BIM Workbench for FreeCAD
363 stars 77 forks source link

IfcOpenShell installation via BIM Setup dialog fails #83

Closed azuk closed 2 years ago

azuk commented 3 years ago

If I install BIM workbench and then attempt to install IfcOpenShell via "BIM Setup" dialog's "download and install it" link, I get an error dialog box with a message "Unable to run the command specified. The file or folder /current/directory/#install does not exist." The dialog box is titled "Error -- KIO Client ?" KIO client is part of KDE (which I use) and is perhaps used to download the IfcOpenShell package under the hood but is given just a string "#install" instead of the correct URL? Just guessing.

/current/directory/ part in the error message is whatever directory is the current working directory of the process (shell in this case) used to start FreeCAD. "#install" part probably originates from BIM workbench's dialogSetup.ui file.

OS: Ubuntu 20.04.3 LTS (KDE/plasma) Word size of FreeCAD: 64-bit Version: 0.20.24436 (Git) Build type: Debug Branch: master Hash: bf527ba5ed9cbde0813e702c2f3793fb55f5be7c Python version: 3.8.10 Qt version: 5.12.8 Coin version: 4.0.0 OCC version: 7.3.0 Locale: English/United States (en_US)

azuk commented 3 years ago

I ended up debugging this a bit and the problem is that "labelIfcOpenShell" QLabel in dialogSetup.ui has openExternalLinks set to true, which implies that linkActivated signal is not emitted and therefore handleLink() function (which is connected to labelIfcOpenShell's linkActivated) is never invoked -- instead the "#install" "link" is passed on to QDesktopServices::openUrl().

"labelIfcOpenShell" QLabel contains both an external link and the magic "#install" link. Thankfully handleLink knows how to handle both of them, so the fix is to simply set openExternalLinks property to false.