Binary executable

This commit is contained in:
reionwong 2021-07-29 03:44:29 +08:00
parent 211a442d90
commit db01805563
2 changed files with 19 additions and 1 deletions

View file

@ -716,6 +716,24 @@ void FolderModel::openSelected()
for (const QUrl &url : urls) {
KFileItem item(url);
QString mimeType = item.mimetype();
// runnable
if (mimeType == "application/x-executable" ||
mimeType == "application/x-sharedlib" ||
mimeType == "application/x-iso9660-appimage" ||
mimeType == "application/vnd.appimage") {
QFileInfo fileInfo(url.toLocalFile());
if (!fileInfo.isExecutable()) {
QFile file(url.toLocalFile());
file.setPermissions(file.permissions() | QFile::ExeOwner | QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther);
}
FileLauncher::self()->launchExecutable(url.toLocalFile());
continue;
}
QString defaultAppDesktopFile = m_mimeAppManager->getDefaultAppByMimeType(item.currentMimeType());
// If no default application is found,

View file

@ -179,7 +179,7 @@ Item {
}
Item {
visible: settings.viewMethod === 0
visible: true
height: statusBarHeight
}
}