SUMMARY If I try to generate a blank text file through the dolphin menu and change the extension to something like "mp3", it will forcibly add a .txt extension to the file. STEPS TO REPRODUCE 1. Launch dolphin. 2. Right-click into some folder, select 'Create New' -> 'Text File...'. 3. Name the new file as "file.mp3" and click Ok. OBSERVED RESULT Creates a file named "file.mp3.txt". EXPECTED RESULT Should create a file named "file.mp3". SOFTWARE/OS VERSIONS Operating System: Debian GNU/Linux KDE Plasma Version: 5.24.5 KDE Frameworks Version: 5.94.0 Qt Version: 5.15.4 Kernel Version: 5.18.0-2-amd64 (64-bit) Graphics Platform: X11 Processors: 16 × AMD Ryzen 7 2700 Eight-Core Processor Memory: 15.5 GiB of RAM Graphics Processor: AMD VEGA10
mp3 isn't a valid extension for a text file. Why would you want to do this? If you want to create a new empty file with a filename extension of your choice, you should use Create New > Empty File. Does that work for your use case?
(In reply to Nate Graham from comment #1) > mp3 isn't a valid extension for a text file. Why would you want to do this? > > If you want to create a new empty file with a filename extension of your > choice, you should use Create New > Empty File. Does that work for your use > case? There's no such option in the right-click menu. Also, if the file is empty, it wouldn't make a difference that it isn't a text file.
Oh, maybe it's a local patch added by Fedora. Either way, can reproduce. The fact that you want to do this seems odd to me, but being prevented from doing so is definitely a bug. :)
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/884
Git commit ebe6706ccad4bd94d767dff4ebd4fde4c73cb31c by Nicolas Fella. Committed on 30/06/2022 at 12:51. Pushed by nicolasfella into branch 'master'. [knewfilemenu] Don't forcibly change file extension The code tries to 'fix' file extensions, but that may not be what the user wants They expect the extension they typed to be used This mechanism was originally introduced to fix cases where desktop files without .desktop extensions where misdetected as other files, but that is better fixed by always setting the .desktop extension M +0 -17 src/filewidgets/knewfilemenu.cpp https://invent.kde.org/frameworks/kio/commit/ebe6706ccad4bd94d767dff4ebd4fde4c73cb31c