Install mimetype definitions for kcfg/kcfgc/ui.rc/knotify & qrc files
ClosedPublic

Authored by kossebau on Nov 8 2017, 6:01 PM.

Details

Summary

When browsing folders of sources with KDE software, e.g. in Dolphin or
KDevelop, there are currently quite some files shown to be only simple text
files, despite being well-known special ones.

This patch adds mimetypes for a few typical special formats as used in
software building on KDE Frameworks and Qt.

Diff Detail

Repository
R244 KCoreAddons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Nov 8 2017, 6:01 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 8 2017, 6:01 PM
kossebau added inline comments.Nov 8 2017, 6:03 PM
src/mimetypes/kde5.xml
3647

This one surely should be also added to shared-mime-info, once proposed name and details have been checked.

Anyone up for that task, ideally someone who could run this also across Qt contributor eyes?
Surprised that one has not yet been added there.

ngraham added a subscriber: ngraham.Nov 8 2017, 7:45 PM
kossebau added inline comments.Nov 10 2017, 7:48 PM
src/mimetypes/kde5.xml
3647
kossebau updated this revision to Diff 22746.Nov 22 2017, 3:00 PM
  • drop qrc mimetype proposal, qt types are to be dealt with upstream
  • x-vnd -> vnd
dfaure accepted this revision.Nov 22 2017, 3:18 PM
This revision is now accepted and ready to land.Nov 22 2017, 3:18 PM
This revision was automatically updated to reflect the committed changes.

@dfaure thanks for review.

Given these are kf5-specific mimetypes I am unsure whether to propose them also for inclusion in shared-mime-info. What do you think?

I have been tempted to also add mimetypes for all the special scripty files (Messages.sh, ExtraDeskto.sh, XmlMessages.,sh). Having those defined might help both newcomers, but also oldies who have no clue about scripty details get some hint from their filemanager/IDE what kind of special files those are. Any opinion here as well?

dfaure added a comment.Dec 2 2017, 4:52 PM

I agree that those are really KF5 specific and developer-oriented, so rather unlikely to be e.g. sent by email to other people.

I'm unsure about mimetypes for special files by name, that seems too specialized. Mimetypes are for *types* of files, not for each specific file ;)
I mean, Messages.sh is a shell script, that's its type. Its specific purpose is something else, of course, but still you would use a viewer or editor for shell scripts to open it (which is the main reason for mimetypes: app associations).

I agree that those are really KF5 specific and developer-oriented, so rather unlikely to be e.g. sent by email to other people.

Okay, so for now not looking into pushing them upstream (too bad we gave up on "turning every user into a developer" ;) )

I'm unsure about mimetypes for special files by name, that seems too specialized. Mimetypes are for *types* of files, not for each specific file ;)
I mean, Messages.sh is a shell script, that's its type. Its specific purpose is something else, of course, but still you would use a viewer or editor for shell scripts to open it (which is the main reason for mimetypes: app associations).

But isn't Messages.sh a sub-type to shell-script, as it needs to match some further requirements, as defined by scripty expectations? And while there might be no specific viewer/editor/etc as handler assigned, it still a type of its own as handled by humans (outside of scripty server). So IMHO it is helpful to also have these files displayed annotated as such in filemanagers/dialogs, ideally both by icon and type tooltip. With such annotated presentation to humans for me being another raison d’être for mimetypes :)
So IMHO "Messages,sh" & Co match things already in shared-mime-info like "AUTHORS", "COPYING", "CREDITS", "LICENSE", where there also usually is no specific handler, still it is helpful when browsing files to have these special files annotated.
But given @ltoscano's plan to overhaul string extraction, I currently will not invest more into the scripty-specific file types, would rather first see to find someone who could find some Qt developer to pursue https://bugreports.qt.io/browse/QTBUG-64435 given this is another set of modern Qt file types which are badly presented when browsing files in file managers or IDEs. Any hint who could be motivated there?