Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fenugrec opened this issue Nov 15, 2022 · 8 comments · Fixed by lxqt/libqtxdg#288
Closed
Labels

Comments

@fenugrec
Copy link

fenugrec commented Nov 15, 2022

Expected Behavior

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

Current Behavior
  • can't associate to a program listed in the Applications that handle CSV documents category
  • for every attempt at setting Calc as the application, it adds a duplicate entry for Krita in the Other Applicationscategory !
    assoc-1

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

assoc-2

Possible Solution
  • workaround : edit mimeapps.list / lxqt-mimeapps.list manually ...
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
  • Distribution & Version: Arch
  • Kernel: 6.0.2
  • Qt Version: 6.4.0
  • liblxqt Version: 1.1.0
  • lxqt-build-tools Version: n/a
  • Package version: 1.1.0
@fenugrec
Copy link
Author

Additional information I just noticed while typing up the issue :

  • running xdg-open $csvfile_whatever from the console opens it using Calc
  • double-clicking the same .csv file from pcmanfm-qt opens it in notepad

@tsujan
Copy link
Member

tsujan commented Nov 15, 2022

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).

@tsujan tsujan added the bug label Nov 15, 2022
@fenugrec
Copy link
Author

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
Copy link
Member

tsujan commented Nov 15, 2022

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

@tsujan
Copy link
Member

tsujan commented Nov 27, 2022

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
Copy link
Member

tsujan commented Nov 27, 2022

lxqt/libqtxdg#287

tsujan added a commit to lxqt/libqtxdg that referenced this issue Nov 27, 2022
Previously, the (final) targets of symlink desktop entries were loaded and failed to meet the requirements of mime-type association. The patch solves the problem by loading the symlinks themselves.

I didn't find any side effect in the code or in practice. The only difference I've found is that, if a menu item corresponding to a symlink desktop entry is dragged and dropped, it'll be created as a symlink, not as its target — which isn't a problem and seems more natural to me.

Fixes #287 and closes lxqt/lxqt-config#897
@fenugrec
Copy link
Author

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
Copy link
Member

tsujan commented Nov 29, 2022

I will need to rebuild all lxqt-* packages

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

I tested it here, and it worked fine.

tsujan added a commit to lxqt/libqtxdg that referenced this issue Dec 12, 2022
Previously, the (final) targets of symlink desktop entries were loaded and failed to meet the requirements of mime-type association. The patch solves the problem by loading the symlinks themselves.

I didn't find any side effect in the code or in practice. The only difference I've found is that, if a menu item corresponding to a symlink desktop entry is dragged and dropped, it'll be created as a symlink, not as its target — which isn't a problem and seems more natural to me.

Fixes #287 and closes lxqt/lxqt-config#897
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants