Create a wrapper around QMimeDatabase
ClosedPublic

Authored by rempt on Mar 19 2016, 7:51 AM.

Details

Summary

Since 5.0, Qt has its won internal mimedatabase, which is used as a fallback on Windows and OSX. Since the mechanism to extend the contents needs a) updatemimedatabase, which is a pig to build on Windows, and b) needs the XDG system for adding paths, which is alien on Windows and OSX, it's hard to extend the database with the extra mimetypes Krita needs to know about.

This wrapper has a fallback for mimetypes that Qt doesn't know about, and which we cannot reliably add to the share/mime on Windows and OSX. For now, these patterns are hard-coded in KisMimeDatabase, but they should come from the import/export plugins. The problem is that they then should be defined in the .json files, and those aren't translated yet.

It's also a bit weird to depend on this huge, generic thing when all we need to do is load and save the file types we already know about, so in future when we can read all relevant information from the import/export plugins we might even want to drop using QMimeDatabase.

Diff Detail

Repository
R37 Krita
Lint
Lint Skipped
Unit
Unit Tests Skipped
rempt updated this revision to Diff 2843.Mar 19 2016, 7:51 AM
rempt retitled this revision from to Create a wrapper around QMimeDatabase.
rempt updated this object.
rempt edited the test plan for this revision. (Show Details)
rempt set the repository for this revision to R37 Krita.
rempt added a project: Krita: 3.0 bugs sprint.
rempt added a subscriber: Krita: 3.0 bugs sprint.
Restricted Application added a subscriber: woltherav. ยท View Herald TranscriptMar 19 2016, 7:51 AM
stefanobonicatti accepted this revision.Mar 20 2016, 9:25 AM
stefanobonicatti edited edge metadata.

This is ok with me, this is a typical case where the library is working against you so.. a wrapper is more then fine and we still use Qt as a fallback.

I'm also in favor for the complete substitution of the system if we really aren't losing any sort of compatibility with other apps, or OS (which seems the opposite for now).

This revision is now accepted and ready to land.Mar 20 2016, 9:25 AM
dkazakov edited edge metadata.Mar 25 2016, 8:15 AM

@rempt, could you close this request now? :)

rempt closed this revision.Mar 25 2016, 8:36 AM