Bug 481035 - New custom Known Type in File Associations is ignored
Summary: New custom Known Type in File Associations is ignored
Status: REPORTED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_filetypes (show other bugs)
Version: 5.27.10
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-08 00:23 UTC by Geri
Modified: 2024-02-15 02:53 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot of file association (178.22 KB, image/png)
2024-02-08 00:23 UTC, Geri
Details
Screenschot of file association text/plain (64.08 KB, image/png)
2024-02-08 00:29 UTC, Geri
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Geri 2024-02-08 00:23:44 UTC
Created attachment 165655 [details]
Screenshot of file association

SUMMARY

See also SU: How to set a shell script as KDE file association – https://superuser.com/q/1828467/516482

I'm connecting to a Win10 with an .rdp file supplied by Citrix Netscaler Gateway via download in my FF.

I wrote a shell script that takes the .rdp file as $1 and it works on Bash's cmd line:

#!/bin/bash
...
xfreerdp "$1" /monitors:0,2 /floatbar:sticky:off,default:hidden,show:always /u:<...> /p:<...>
...

To be able to run this script from within GUI apps I created a new File Association with Known Type: application/rdp. *.RDP, *.rdp already was assigned to Known Type: x-remmina (which worked with .rdp files as intended) so I moved them from there to my new one:

See attachment for a screenshot.

There's a ~/.local/share/applications/Bash-RDP.desktop. In FF I have set Applications -> Content Type: RDP file, Action: Use (default).

This neither works as intended when opening the downloaded .rdp in FF's downloads drop-down or Downloads Library nor in my Downloads folder in Dolphin. If I do so xfreerdp appears in the taskbar with a progress circle for a few seconds only and without any further visual representation. And an xfreerdp task remains at every try which I have to kill afterwards.

After a few hours of try and error and after asking a question at SuperUser ( https://superuser.com/q/1826544/516482 ) I came to the following conclusion: My new File Association is ignored. The previous one assigned to *.rdp is still used: x-remmina. How do I know? Well, xfreerdp was the first in its Application Preference Order. I moved it one down so that Kate was at the top. Selecting an .rdp file by double-clicking it in Dolphin opened it in Kate.

See second and third attachment once I can upload more here.

STEPS TO REPRODUCE

1. + Add... File Association -> Known Type -> Group: application, Type name: txt
2. Select Known Type text/plain, – Remove Filename Pattern: *.txt
3. + Add... Filename Pattern: *.txt to the Known Type: application/txt created at 1.
4. ✓Apply (otherwise the new Known Type isn't shown in the further [I think this is a bug by itself])
5.  + Add... Application: Mousepad
6. ✓Apply

It looks fine now, but double-clicking a .txt file in Dolphin still opens it in Kate. OK, let's dig deeper:

7. 🖋️ Edit... Application: Mousepad
    7.1. This is confusing. There is an application to Open With: (Kate) on the General tab
    and there's a Program: to run (Mousepad) on the Application tab, which can be different(?!?).
    7.2. With selecting Change... it becomes even more confusing: A dialog opens with the same controls as on the File type group in File Associations and you can perform an endless loop now with:
        7.2.1. Edit... Application: Mousepad
        7.2.2. Open With: ... Change...
        7.2.3. GOTO 7.2.1.
     
OBSERVED RESULT

Files of a Filename Pattern defined in a new custom File Association do not open with the application defined there.

EXPECTED RESULT

.rdp, & .RDP files should open in the Application of the File Association they are defined in.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: openSUSE Tumbleweed 20240201
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.114.0
Qt Version: 5.15.12
Comment 1 Geri 2024-02-08 00:29:04 UTC
Created attachment 165656 [details]
Screenschot of file association text/plain
Comment 2 Geri 2024-02-08 00:40:57 UTC
STEPS TO REPRODUCE cont'd

[Can I really not edit the description here?]

8. Select (original) Known Type: text/plain
8 Note that there's no *.txt in the Filename Patterns
9. Move Okular to the top in Application Preference Order
10. ✓Apply
11. Double-click on a .txt file in Dolphin, Okular opens with it (although there's no pattern *.txt associated with it and although there's a file association with a *.txt pattern that has Mousepad associated with it.)