diff --git a/src/extension/menu/app-menu-plugin.cpp b/src/extension/menu/app-menu-plugin.cpp index e50ef39..c37a1c4 100644 --- a/src/extension/menu/app-menu-plugin.cpp +++ b/src/extension/menu/app-menu-plugin.cpp @@ -146,10 +146,18 @@ void AppContentMenu::addToDesktopAction(QObject *parent, const QString &appId, Q } QObject::connect(list.last(), &QAction::triggered, parent, [appId, path] { - QFile file(appId); - bool ret = file.copy(path); - if (ret) { - QProcess::startDetached("chmod a+x ", {path}); + if (QFile::copy(appId, path)) { + // 设置权限755 + // QFile::Permissions permissions(0x0755); // 这也是可以的 + QFile::Permissions permissions = { + QFile::ReadUser | QFile::WriteUser | QFile::ExeUser | + QFile::ReadGroup | QFile::ExeGroup | + QFile::ReadOther | QFile::ExeOther + }; + + if (QFile::setPermissions(path, permissions)) { + qWarning() << "set file permissions failed, file:" << path; + } } }); }