SUMMARY After recent porting to RunOrExecuteJob thingie, it asks whether I want to run or open JavaScript files. This is a regression. STEPS TO REPRODUCE 1. Open Dolphin 2. Click on a .js file OBSERVED RESULT It asks whether I want to run or execute it EXPECTED RESULT It opens it in Kate SOFTWARE/OS VERSIONS KDE Plasma Version: 5.19.80 KDE Frameworks Version: 5.73.0 git as of 2020-08-25 Qt Version: 5.14.2 ADDITIONAL INFORMATION Clicking on "Open" also doesn't do anything, I have to click "Run" which then opens it in Kate. JSON files also appear to be affected. CSS, Plain text, PDFs, PNGs, are not.
All of them or only some? Are they marked as executable?
Can confirm for non-executable files on my own system. This should only happen if the file is actually executable so there *is* an option to execute it.
Confirmed for .py (Python) files. Previously, I could select between "Execute" or "Open" (in editor), and the choice was respected. Now, "Execute" opens it in the editor, while "Open" does nothing at first, but seems to queue them. A final "Execute" choice will open all queued editor windows.
Apparently, application/javascript inherits application/x-executable which has it prompt for executing it. isExecutableMime in OpenUrlJob returns true for JS files and potentially others
KRun also checked the executable bit before, maybe that's the trick?
*** Bug 425431 has been marked as a duplicate of this bug. ***
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/137
*** Bug 425177 has been marked as a duplicate of this bug. ***
Git commit fdd7c47c85d5d6dbf21e05e7a0d6afcf383f1d24 by Ahmad Samir. Committed on 21/09/2020 at 12:26. Pushed by dfaure into branch 'master'. OpenUrlJob: handle all text scripts consistently Previously we only handled application/x-shellscript, but there are other scripts; a script is technically a file that inherits both text/plain and application/x-executable, e.g. .sh, .csh, .py, perl scripts ...etc. Treat all those mime types the way we handled shell scripts: - if it's not a local url, or isn't executable we open it in the preferred text editor - if it's executable either show the OpenOrExecute dialog or execute directly depending on how the job is configured The mimetype world is a confusing one: - Executables, this includes .exe files (MS Windows); and "application/x-executable" and "application/x-sharedlib", this depends on various parameters (e.g. stripped executables are x-sharedlib, the same executable if not stripped is x-executable...) - Scripts: shell, python, perl... etc scripts, which are text files that can be executed or opened as text. Adjust the unit test. Related: bug 425177 FIXED-IN: 5.75 M +43 -13 autotests/openurljobtest.cpp M +2 -0 autotests/openurljobtest.h M +40 -25 src/gui/openurljob.cpp https://invent.kde.org/frameworks/kio/commit/fdd7c47c85d5d6dbf21e05e7a0d6afcf383f1d24
*** Bug 427362 has been marked as a duplicate of this bug. ***