An attempt to update my Falkon addons to Qt6
This weekend I had no access to my trusty home workstation and worked on my portable Thinkpad T440p and thus I decided to work on my Falkon plugins. I postponed this for a long time.
Objective
The main objective is to port the add-ons to Qt6 / PySide6 and update version and author signature.
Progress
I managed to port the ToolbarTools and Unloader. Unloader probably can be rewritten in QML for better compatibility. I will leave that for later when I will have will to do that.
And than it had done me properly. I started porting TabCounter and it had kicked me properly (like it should, it is never simple). While porting it to Qt6 was as simple as the two previous add-ons, just changing “pyside2” to “pyside6” in an import statements and done. The problems which stuck with me started when I noticed that Falkon actually crashes at exit when TabCounter is enabled.
Debugging
So I started debugging TabCounter add-on like a pro. I added a lot of print statements all over the exit related code. All seemed to be executing correctly, so I fired QtCreator to get easy to use interface for debugger and after recompiling Falkon for debug symbols I found that it crashes in the general python library. So the problem needs to be in my add-on code, somewhere.
I continued to comment the code and attempted to isolate the code which causes the crash. It turned out the issue is caused by Qt connects to the Falkon code (navigation panel). It looks like the connects are not cleared when add-on is unloaded (is it truly fully unloaded, I wonder now) and I should disconnect the connections manually. Also, due to some reasons I do not know about I put in one connect a python lambda function which had to be removed to fully resolve the crash at exit.
Side effect
During the debugging and trying to blame other code rather than my own for the crashing issue I found a warning in the PyFalkon Shiboken compilation log.
qt.shiboken: (pyfalkon) template baseclass 'QCborStreamReader::StringResult<QByteArray>' of 'QCborStringResultByteArray' is not known
qt.shiboken: (pyfalkon) template baseclass 'QCborStreamReader::StringResult<QString>' of 'QCborStringResultString' is not known
Fix turned out to be a simple new include, so I prepared a Merge Request with potential fix and left it for later.
Conclusion
My energy was spent after finding the cause and I left it for later. The other add-on will be ported soon as well. After porting I will go over the store.falkon.org items and update them accordingly.
Notes
I will probably be adding these kinds of nonsense posts more often, it is fun to write them and share the headache.