You are not logged in.

#1 2021-06-10 09:47:20

seands
Member
Registered: 2020-09-06
Posts: 14

[SOLVED] QGIS adds file associations for many types it can't open

I'm using KDE and a while ago I installed the QGIS community package but noticed it associated itself with a huge number of file extensions that I don't want it to open, like PNGs and JPGs. Initially I manually removed file extensions from Settings -> Applications -> File Associations on a piecemeal basis as I found them, but today I finally got frustrated enough to check and I realised that QGIS has added itself to maybe 90% of all file extensions registered on my system. What's more, QGIS can't even open most of the extensions it claims to handle. There are some really obscure ones added by QGIS like "multipart/appledouble". This is clearly a bug, but I don't know where to be able to report and/or fix it. Are file associations defined in the upstream QGIS package itself, or in the Arch package, or what?

As an aside, the KDE GUI for managing file associations also doesn't seem to support a way to quickly list or remove all of the extensions for a particular application. Instead, to remove QGIS registered extensions I seem to have to manually go through every file extension in turn, finding and removing QGIS in the list. This is time consuming, so perhaps there's a quicker way?
(I'd also like to remove all of WINE's associations - it adds itself to the top of the priority list such that it opens text files with an emulated version of Notepad over Kate or KWrite...)

Last edited by seands (2021-06-10 13:10:52)

Offline

#2 2021-06-10 10:32:06

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,410

Re: [SOLVED] QGIS adds file associations for many types it can't open

Once you set explicit defaults for your user they shouldn't get overridden by whatever system packages do. The general logic and list of how that happens is explained in: https://wiki.archlinux.org/title/Default_applications and https://wiki.archlinux.org/title/XDG_MIME_Applications see the shared mime DB heading in that article there are also some tools there that might help you to define this quicker and more properly.

AS for why it's registered for all of those that's indeed a weird one, normally this is defined in the .desktop file and the list for qgjs

application/x-qgis-project;application/x-qgis-project-container;application/x-qgis-layer-settings;application/x-qgis-layer-definition;application/x-qgis-composer-template;image/tiff;image/jpeg;image/jp2;application/x-raster-aig;application/x-raster-ecw;application/x-raster-mrsid;application/x-mapinfo-mif;application/x-esri-shape

reads reasonable

Offline

#3 2021-06-10 11:17:51

seands
Member
Registered: 2020-09-06
Posts: 14

Re: [SOLVED] QGIS adds file associations for many types it can't open

Thanks for the info.

V1del wrote:

Once you set explicit defaults for your user they shouldn't get overridden by whatever system packages do.

What counts as explicitly setting defaults? Editing any file association with the KDE GUI, or editing the list and priorities for a particular extension, or something else?

V1del wrote:

AS for why it's registered for all of those that's indeed a weird one, normally this is defined in the .desktop file and the list for qgjs

Indeed, I found a file somewhere in the QGIS source that also listed only those few. Something is broken! Reading the page you linked I had a look in /usr/share/mime/packages and found qgis.xml. It only contains XML structures for application/x-qgis-project, application/x-qgis-project-container, application/x-qgis-layer-settings, application/x-qgis-layer-definition, and application/x-qgis-composer-template. That's also the only file in that directory that mentions 'qgis' so I don't think one of the others (libreoffice.xml, akonadi-mime.xml, kde5.xml, etc.) are somehow providing all these incorrect file associations.
Is there somewhere I can see all of the files that get used to build the file association database, so I can look to see if there are any rogue ones?

Also, perhaps a clue here is that uninstalling QGIS removes all of those rogue associations, and reinstalling it makes them come back. So it seems related to the Arch package or the software itself.

Offline

#4 2021-06-10 12:02:55

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,410

Re: [SOLVED] QGIS adds file associations for many types it can't open

Changing them explicitly in KDE GUI will lead to this end result yes. It ultimately boils down to that the ~/.config/mimeapps.list file contains your real wanted default preferences, as those won't get touched or updated by the automated association hooks.

Offline

#5 2021-06-10 13:10:16

seands
Member
Registered: 2020-09-06
Posts: 14

Re: [SOLVED] QGIS adds file associations for many types it can't open

I see. In my hunt for settings I did come across a file that had the entries I had manually added and removed from the KDE GUI so I guess it was that one. While trying to fix this I cleared out all of the locations where MIME types get stored in my home directory, and found and nuked one or two in deprecated locations as listed on the Arch wiki links above. I also reset the .local/share/mime directory as per this StackExchange answer and it seems to be fine now. I guess I had some old configuration files hanging around from a previous version of KDE and somehow that got very messed up. I still have no idea how QGIS managed to take on so many extensions though - seems like it might have managed to become some "default" application added to all extensions? Anyway it's working now, thanks for your pointers which helped me figure it out.

Offline

Board footer

Powered by FluxBB