lxqt / lxqt-config

Tools to configure LXQt and the underlying operating system
https://lxqt.github.io
GNU Lesser General Public License v2.1
81 stars 60 forks source link

lxqt-config-file-associations : weird behaviour, cannot change association #897

Closed fenugrec closed 1 year ago

fenugrec commented 1 year ago
Expected Behavior

It should be fairly straightforward to change file associations. Current example is with text/csv files.

Current Behavior

[EDIT - second screenshot, scrolling down the ApplicationChooser dialog]

assoc-2

Possible Solution
Steps to Reproduce (for bugs)
  1. get annoyed by a program "stealing" file associations from another that was there before
  2. run lxqt-config-file-associations
  3. try to change association : UI does nothing, unless I pick some random application in the "Other Applications" category. In the screenshots below, I was able to do that and assign Notepad (from wine...). If I try to assign Krita or Calc again, it doesn't do anything
  4. Enjoy opening .csv files in notepad now !
System Information
fenugrec commented 1 year ago

Additional information I just noticed while typing up the issue :

tsujan commented 1 year ago

Thanks for the report.

  1. For some reason, Calc can't be assigned. I can confirm that.
  2. Two ApplicationChooser dialogs are possible, which isn't right.

I can't confirm the duplication of Krita under Other Applications with V1.2.0: There are 22 Krita items there, and their number always remains 22 (that's a weird choice of Krita — see /usr/share/applications).

fenugrec commented 1 year ago
2. Two `ApplicationChooser` dialogs are possible, which isn't right.

Sorry, my post wasn't very clear, that's actually 2 attachments , so 2 screenshots - I couldn't show everything in one.

There are 22 Krita items there, and their number always remains 22 (that's a weird choice of Krita — see /usr/share/applications).

Ah, I hadn't actually counted them - it just seemed like I tried about 20 times, so it seemed about right P) Indeed, I have 23 krita_*.desktop files in /usr/share/applications !

tsujan commented 1 year ago

Anyway, the behavior you detected shows that there's a bug somewhere. And I agree: it's very weird.

tsujan commented 1 year ago

I haven't look into the code yet but the problem should be in libqtxdg because pcmanfm-qt has no problem in setting Calc as the default application for text/csv, while qtxdg-mat does:

$ qtxdg-mat defapp text/csv -s libreoffice-calc.desktop
Could not set '/usr/lib/libreoffice/share/xdg/calc.desktop' as default for 'text/csv'

EDIT: OK, I found the problem in libqtxdg :)

tsujan commented 1 year ago

https://github.com/lxqt/libqtxdg/issues/287

fenugrec commented 1 year ago

Thanks ! I will need to rebuild all lxqt-* packages to test this, so it may take a bit before I get time to do so.

tsujan commented 1 year ago

I will need to rebuild all lxqt-* packages

If you had LXQt 1.2.0, you would just need to apply the patch at https://github.com/lxqt/libqtxdg/pull/288. But yes, with 1.1.0, you have to upgrade.

I tested it here, and it worked fine.