elementary / applications-menu

Applications Menu for elementary OS and the Pantheon desktop environment
https://elementary.io
GNU General Public License v3.0
103 stars 35 forks source link

DesktopFilePlugin: Remove unused mime support #449

Closed davidmhewitt closed 3 years ago

davidmhewitt commented 3 years ago

There seems to be a bunch of code here that's supposed to offer up an application if you provide a URI/mime and there's a desktop file that reports it supports opening that.

However... there's a condition right at the top of the method here that says: https://github.com/elementary/applications-menu/blob/9ee21f7e9d51957456ee1de86ab971dc785c85c2/src/synapse-plugins/desktop-file-plugin.vala#L352

mime_type is never set anywhere, so it's always null. In fact, I'm not sure we're even constructing a UriMatch class anywhere. So we have a bunch of code in DesktopFileService that parses all of the mimes that everything supports and caches it in RAM, then nothing that ever uses that information.

So, if we drop all that, we can save some RAM, CPU cycles and disk I/O.