Add a definition of MIME type application/x-pie-executable.

This resolves incorrect identification of binary executables with libmagick >= 5.33.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/130/head
Slávek Banko 3 years ago
parent 0b1a3e154b
commit a5def4f9a4
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -106,7 +106,7 @@ KBuildServiceTypeFactory::createEntry(const TQString &file, const char *resource
|| (mime == "media/builtin-trash") || (mime == "media/builtin-trash")
|| (mime == "media/builtin-webbrowser") ) || (mime == "media/builtin-webbrowser") )
e = new KDEDesktopMimeType( &desktopFile ); e = new KDEDesktopMimeType( &desktopFile );
else if ( mime == "application/x-executable" || mime == "application/x-shellscript" ) else if ( mime == "application/x-executable" || mime == "application/x-pie-executable" || mime == "application/x-shellscript" )
e = new KExecMimeType( &desktopFile ); e = new KExecMimeType( &desktopFile );
else if ( !mime.isEmpty() ) else if ( !mime.isEmpty() )
e = new KMimeType( &desktopFile ); e = new KMimeType( &desktopFile );

@ -22,7 +22,8 @@ tde_create_translated_desktop(
x-jar.desktop x-arj.desktop x-tarz.desktop x-jar.desktop x-arj.desktop x-tarz.desktop
x-gzpostscript.desktop postscript.desktop octet-stream.desktop x-gzpostscript.desktop postscript.desktop octet-stream.desktop
x-shellscript.desktop x-desktop.desktop x-shellscript.desktop x-desktop.desktop
x-executable.desktop x-executable-script.desktop x-archive.desktop x-lha.desktop x-executable.desktop x-pie-executable.desktop x-executable-script.desktop
x-archive.desktop x-lha.desktop
x-tbz.desktop x-tgz.desktop x-awk.desktop x-tbz.desktop x-tgz.desktop x-awk.desktop
x-perl.desktop x-perl-module.desktop x-compress.desktop x-cpio.desktop x-perl.desktop x-perl-module.desktop x-compress.desktop x-cpio.desktop
x-rpm.desktop msword.desktop x-sharedlib.desktop x-rpm.desktop msword.desktop x-sharedlib.desktop

@ -8,7 +8,8 @@ mimetypeapplicationdata_DATA = x-dvi.desktop x-gzdvi.desktop x-bz2dvi.desktop \
x-jar.desktop x-arj.desktop x-tarz.desktop \ x-jar.desktop x-arj.desktop x-tarz.desktop \
x-gzpostscript.desktop postscript.desktop octet-stream.desktop \ x-gzpostscript.desktop postscript.desktop octet-stream.desktop \
x-shellscript.desktop x-desktop.desktop \ x-shellscript.desktop x-desktop.desktop \
x-executable.desktop x-executable-script.desktop x-archive.desktop x-lha.desktop \ x-executable.desktop x-pie-executable.desktop x-executable-script.desktop \
x-archive.desktop x-lha.desktop \
x-tbz.desktop x-tgz.desktop x-awk.desktop \ x-tbz.desktop x-tgz.desktop x-awk.desktop \
x-perl.desktop x-perl-module.desktop x-compress.desktop x-cpio.desktop \ x-perl.desktop x-perl-module.desktop x-compress.desktop x-cpio.desktop \
x-rpm.desktop msword.desktop x-sharedlib.desktop \ x-rpm.desktop msword.desktop x-sharedlib.desktop \

@ -0,0 +1,6 @@
[Desktop Entry]
Comment=Executable File
Icon=application-x-executable
Type=MimeType
MimeType=application/x-pie-executable
X-TDE-IsAlso=application/x-executable

@ -50,54 +50,41 @@ KElfPlugin::KElfPlugin(TQObject *parent, const char *name,
: KFilePlugin(parent, name, args) : KFilePlugin(parent, name, args)
{ {
// Executables const TQCString elfMimeTypes[]= {
KFileMimeTypeInfo* info = addMimeTypeInfo( "application/x-executable" ); "application/x-executable",
"application/x-pie-executable",
KFileMimeTypeInfo::GroupInfo* group = 0L; "application/x-sharedlib"
KFileMimeTypeInfo::GroupInfo* group2 = 0L; };
const int elfMimeTypesCount = sizeof(elfMimeTypes)/sizeof(elfMimeTypes[0]);
group = addGroupInfo(info, "Technical", i18n("Embedded Metadata"));
group2 = addGroupInfo(info, "Icon", i18n("Embedded Icon(s)")); for (int i = 0; i < elfMimeTypesCount; i++)
{
KFileMimeTypeInfo::ItemInfo* item; KFileMimeTypeInfo* info = addMimeTypeInfo(elfMimeTypes[i]);
item = addItemInfo(group, "Name", i18n("Internal Name"), TQVariant::String); KFileMimeTypeInfo::GroupInfo* group = 0L;
item = addItemInfo(group, "Description", i18n("Description"), TQVariant::String); KFileMimeTypeInfo::GroupInfo* group2 = 0L;
item = addItemInfo(group, "License", i18n("License"), TQVariant::String);
item = addItemInfo(group, "Copyright", i18n("Copyright"), TQVariant::String); group = addGroupInfo(info, "Technical", i18n("Embedded Metadata"));
item = addItemInfo(group, "Authors", i18n("Author(s)"), TQVariant::String); group2 = addGroupInfo(info, "Icon", i18n("Embedded Icon(s)"));
item = addItemInfo(group, "Product", i18n("Product"), TQVariant::String);
item = addItemInfo(group, "Organization", i18n("Organization"), TQVariant::String); KFileMimeTypeInfo::ItemInfo* item;
item = addItemInfo(group, "Version", i18n("Version"), TQVariant::String);
item = addItemInfo(group, "DateTime", i18n("Compilation Date/Time"), TQVariant::String); item = addItemInfo(group, "Name", i18n("Internal Name"), TQVariant::String);
item = addItemInfo(group, "SystemIcon", i18n("Requested Icon"), TQVariant::String); item = addItemInfo(group, "Description", i18n("Description"), TQVariant::String);
item = addItemInfo(group, "SCMModule", i18n("SCM Module"), TQVariant::String); item = addItemInfo(group, "License", i18n("License"), TQVariant::String);
item = addItemInfo(group, "SCMRevision", i18n("SCM Revision"), TQVariant::String); item = addItemInfo(group, "Copyright", i18n("Copyright"), TQVariant::String);
item = addItemInfo(group, "Notes", i18n("Comments"), TQVariant::String); item = addItemInfo(group, "Authors", i18n("Author(s)"), TQVariant::String);
item = addItemInfo(group, "Product", i18n("Product"), TQVariant::String);
item = addItemInfo(group2, "EmbeddedIcon", i18n("Icon Name(s)"), TQVariant::String); item = addItemInfo(group, "Organization", i18n("Organization"), TQVariant::String);
item = addItemInfo(group, "Version", i18n("Version"), TQVariant::String);
// Shared libraries item = addItemInfo(group, "DateTime", i18n("Compilation Date/Time"), TQVariant::String);
info = addMimeTypeInfo( "application/x-sharedlib" ); item = addItemInfo(group, "SystemIcon", i18n("Requested Icon"), TQVariant::String);
item = addItemInfo(group, "SCMModule", i18n("SCM Module"), TQVariant::String);
group = addGroupInfo(info, "Technical", i18n("Embedded Metadata")); item = addItemInfo(group, "SCMRevision", i18n("SCM Revision"), TQVariant::String);
group2 = addGroupInfo(info, "Icon", i18n("Embedded Icon(s)")); item = addItemInfo(group, "Notes", i18n("Comments"), TQVariant::String);
item = addItemInfo(group, "Name", i18n("Internal Name"), TQVariant::String); item = addItemInfo(group2, "EmbeddedIcon", i18n("Icon Name(s)"), TQVariant::String);
item = addItemInfo(group, "Description", i18n("Description"), TQVariant::String); }
item = addItemInfo(group, "License", i18n("License"), TQVariant::String);
item = addItemInfo(group, "Copyright", i18n("Copyright"), TQVariant::String);
item = addItemInfo(group, "Authors", i18n("Author(s)"), TQVariant::String);
item = addItemInfo(group, "Product", i18n("Product"), TQVariant::String);
item = addItemInfo(group, "Organization", i18n("Organization"), TQVariant::String);
item = addItemInfo(group, "Version", i18n("Version"), TQVariant::String);
item = addItemInfo(group, "DateTime", i18n("Compilation Date/Time"), TQVariant::String);
item = addItemInfo(group, "SystemIcon", i18n("Requested Icon"), TQVariant::String);
item = addItemInfo(group, "SCMModule", i18n("SCM Module"), TQVariant::String);
item = addItemInfo(group, "SCMRevision", i18n("SCM Revision"), TQVariant::String);
item = addItemInfo(group, "Notes", i18n("Comments"), TQVariant::String);
item = addItemInfo(group2, "EmbeddedIcon", i18n("Icon Name(s)"), TQVariant::String);
} }

@ -155,8 +155,10 @@ pid_t KRun::runURL( const KURL& u, const TQString& _mimetype, TQWidget* window,
noAuth = true; noAuth = true;
} }
} }
else if (_mimetype == "application/x-executable") else if (_mimetype == "application/x-executable" || _mimetype == "application/x-pie-executable")
{
noRun = true; noRun = true;
}
} }
else if ( isExecutable(_mimetype) ) else if ( isExecutable(_mimetype) )
{ {
@ -1452,6 +1454,7 @@ bool KRun::isExecutable( const TQString& serviceType )
serviceType == "media/builtin-trash" || serviceType == "media/builtin-trash" ||
serviceType == "media/builtin-webbrowser" || serviceType == "media/builtin-webbrowser" ||
serviceType == "application/x-executable" || serviceType == "application/x-executable" ||
serviceType == "application/x-pie-executable" ||
serviceType == "application/x-msdos-program" || serviceType == "application/x-msdos-program" ||
serviceType == "application/x-shellscript" ); serviceType == "application/x-shellscript" );
} }

@ -700,7 +700,7 @@ TQPixmap KFileItem::pixmap( int _size, int _state ) const
if (p.isNull()) if (p.isNull())
kdWarning() << "Pixmap not found for mimetype " << m_pMimeType->name() << endl; kdWarning() << "Pixmap not found for mimetype " << m_pMimeType->name() << endl;
if ( mime->name() == "application/x-executable" ) { if ( mime->name() == "application/x-executable" || mime->name() == "application/x-pie-executable" ) {
// At first glance it might seem to be a good idea to // At first glance it might seem to be a good idea to
// look for .desktop files for this executable before resorting to the embedded icon // look for .desktop files for this executable before resorting to the embedded icon
// in the same fashion as the minicli, but on close examination this is NOT A GOOD IDEA. // in the same fashion as the minicli, but on close examination this is NOT A GOOD IDEA.

Loading…
Cancel
Save