Display "executable" in info panel instead of "unknown"
ClosedPublic

Authored by umanovskis on Thu, Oct 3, 11:04 AM.

Details

Summary

Executable files often have no extension, so MIME detection doesn't work. We can make an educated guess that octet-stream files with execute bit set are executables.

Diff Detail

Repository
R36 Ark
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
umanovskis created this revision.Thu, Oct 3, 11:04 AM
Restricted Application added a project: Ark. · View Herald TranscriptThu, Oct 3, 11:04 AM
Restricted Application added subscribers: Ark, kde-utils-devel. · View Herald Transcript
umanovskis requested review of this revision.Thu, Oct 3, 11:04 AM

Before and after comparison.

elvisangelaccio requested changes to this revision.Tue, Oct 8, 8:30 PM

+1 for the idea.

part/infopanel.cpp
183–187

Please use mimeType.isDefault() instead.

184

Instead of using a custom string (which needs to be translated from scratch), we could get the mimetype using db.mimeTypeForName(QStringLiteral("application/x-executable")) and then get the comment() of this mimetype.

This revision now requires changes to proceed.Tue, Oct 8, 8:30 PM
umanovskis updated this revision to Diff 67526.Wed, Oct 9, 7:46 AM
  • Changed per review comments
elvisangelaccio accepted this revision.Sun, Oct 13, 9:05 PM
This revision is now accepted and ready to land.Sun, Oct 13, 9:05 PM
This revision was automatically updated to reflect the committed changes.