chessx icon indicating copy to clipboard operation
chessx copied to clipboard

WIP - 286 - Fix Open dialog is empty with KDE

Open christofferholmstedt opened this issue 2 years ago • 10 comments

See: https://sourceforge.net/p/chessx/bugs/286/

christofferholmstedt avatar Jul 31 '22 10:07 christofferholmstedt

I have compiled and use latest chessx master on Kubuntu 22.04. Currently with Qt 5.15.3. I have the problem with native file dialog is not working for me and this patch solves a problem so it is now possible to open files. Although it works I'm not sure this solves the correct problem therefore I'm opening this as draft pull request to track the work that goes into this.

christofferholmstedt avatar Jul 31 '22 10:07 christofferholmstedt

With the commit I still get the following log line when open dialog is opened:

kf.kio.core: couldn't create slave: "Unknown protocol 'file'."

Using master code without patch in 105d2f619f I still get the same log line:

kf.kio.core: couldn't create slave: "Unknown protocol 'file'."

When using master and toggling between directories I also get this problem:

kf.kio.widgets.kdirmodel: protocol mismatch: "file" vs ""

christofferholmstedt avatar Jul 31 '22 10:07 christofferholmstedt

I did another round now and compiled ChessX with qmake and debug flag set. The open file dialog now works for some reason but I get a completely different log message when I open the "open file dialog".

Qt: Session management error: networkIdsList argument is NULL

christofferholmstedt avatar Jul 31 '22 11:07 christofferholmstedt

I can confirm this bug is still there on Linux 5.18.16-arch1-1 and Qt 5.15.5+kde+r174-1.

I'm using KDE plasma: plasma-framework 5.96.0-1 and plasma-desktop 5.25.4-1.

It seems other Qt based application are encountering the same problem since an update of plasma.

zeFresk avatar Aug 15 '22 15:08 zeFresk

I tried to do some troubleshooting in the hope of helping you :

Despite the window being empty, writing in the input box shows matching files/directories.

chessx_bug

Clicking on them open a message box containing "Unable to find file ....". The problem is the same if you provide the full path to the engine directly.

chessx_bug2

Here is the output of the program :

kf.kio.core: couldn't create slave: "Protocole « file » inconnu."
kf.kio.widgets.kdirmodel: protocol mismatch: "file" vs ""
kf.kio.widgets.kdirmodel: protocol mismatch: "file" vs ""
kf.kio.core: couldn't create slave: "Protocole « file » inconnu."
kf.kio.core: couldn't create slave: "Protocole « file » inconnu."
kf.kio.widgets.kdirmodel: protocol mismatch: "file" vs ""
kf.kio.widgets.kdirmodel: protocol mismatch: "file" vs ""
kf.kio.widgets.kdirmodel: protocol mismatch: "file" vs ""
kf.kio.widgets.kdirmodel: protocol mismatch: "file" vs ""
kf.kio.widgets.kdirmodel: protocol mismatch: "file" vs ""
kf.windowsystem: Could not find any platform plugin

The problem is the same for all file dialog I tested.

EDIT: running chessx with sudo fix the problem

zeFresk avatar Aug 15 '22 16:08 zeFresk

I use a patch to basically create your build. It works for me on the open database dialog but to add an engine I still have to switch to gnome to do that.

tdtooke avatar Oct 24 '22 16:10 tdtooke

Hello, I was poking around and I might have found something to add. Using KDE plasma in arch, I find that the pull request proposed still leaves the dialog to find engines broken. Also error output from the dialogs that now show files. Although, setting the build to debug worked to get rid of these issues for me. Instead of this patch+debug build, if you just add the line QCoreApplication::setAttribute(Qt::AA_DontUseNativeDialogs); to main.cpp next to the other two calls to the function (currently line 100), without the code in the pull request, the broken file picker dialogs now work including the one for the engines and I get no error output in my terminal, all in the standard release build. (I've never posted to github so sorry if I'm missing something/doing this wrong.)

StealthyBong avatar Dec 14 '22 20:12 StealthyBong

Hello, I was poking around and I might have found something to add. Using KDE plasma in arch, I find that the pull request proposed still leaves the dialog to find engines broken. Also error output from the dialogs that now show files. Although, setting the build to debug worked to get rid of these issues for me. Instead of this patch+debug build, if you just add the line QCoreApplication::setAttribute(Qt::AA_DontUseNativeDialogs); to main.cpp next to the other two calls to the function (currently line 100), without the code in the pull request, the broken file picker dialogs now work including the one for the engines and I get no error output in my terminal, all in the standard release build. (I've never posted to github so sorry if I'm missing something/doing this wrong.)

Yea, I'm not sure why this is. I have no time to work on it right now but my first take would be to just figure out what is happening in the bakground in Qt when setting DontUseNativeDialogs...and how it is supposed to work. As I will not work on it in a foreseeable future it might to worth closing it to not clutter the project.

christofferholmstedt avatar Feb 06 '23 15:02 christofferholmstedt

Hello, I was poking around and I might have found something to add. Using KDE plasma in arch, I find that the pull request proposed still leaves the dialog to find engines broken. Also error output from the dialogs that now show files. Although, setting the build to debug worked to get rid of these issues for me. Instead of this patch+debug build, if you just add the line QCoreApplication::setAttribute(Qt::AA_DontUseNativeDialogs); to main.cpp next to the other two calls to the function (currently line 100), without the code in the pull request, the broken file picker dialogs now work including the one for the engines and I get no error output in my terminal, all in the standard release build. (I've never posted to github so sorry if I'm missing something/doing this wrong.)

This fixes the issue. Thank you.

jefersonnavarro avatar Mar 19 '23 15:03 jefersonnavarro

Hello, I was poking around and I might have found something to add. Using KDE plasma in arch, I find that the pull request proposed still leaves the dialog to find engines broken. Also error output from the dialogs that now show files. Although, setting the build to debug worked to get rid of these issues for me. Instead of this patch+debug build, if you just add the line QCoreApplication::setAttribute(Qt::AA_DontUseNativeDialogs); to main.cpp next to the other two calls to the function (currently line 100), without the code in the pull request, the broken file picker dialogs now work including the one for the engines and I get no error output in my terminal, all in the standard release build. (I've never posted to github so sorry if I'm missing something/doing this wrong.)

Adding QCoreApplication::setAttribute(Qt::AA_DontUseNativeDialogs); in line 100 worked. I downloaded the AUR package on Arch Linux and compiled with 'makepkg -s', tested and there was the bug but I did the change in code did 'make' on the other directory where make was (chessx/src/chessx-1.5.8/) and then 'makepkg -i' and I am now able to add engines like stockfish

binarydepth avatar Apr 26 '23 12:04 binarydepth