mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
servicemenuinstaller: use Q_GLOBAL_STATIC
Global statics should be avoided when possible. This fixes a clazy warning.
This commit is contained in:
parent
6496721110
commit
299aff588d
|
@ -19,10 +19,11 @@
|
|||
|
||||
#include "../../../config-packagekit.h"
|
||||
|
||||
const static QStringList binaryPackages = {QStringLiteral("application/vnd.debian.binary-package"),
|
||||
QStringLiteral("application/x-rpm"),
|
||||
QStringLiteral("application/x-xz"),
|
||||
QStringLiteral("application/zstd")};
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QStringList, binaryPackages, ({QLatin1String("application/vnd.debian.binary-package"),
|
||||
QLatin1String("application/x-rpm"),
|
||||
QLatin1String("application/x-xz"),
|
||||
QLatin1String("application/zstd")}))
|
||||
|
||||
enum PackageOperation {
|
||||
Install,
|
||||
Uninstall
|
||||
|
@ -297,7 +298,7 @@ bool cmdInstall(const QString &archive, QString &errorText)
|
|||
return false;
|
||||
}
|
||||
} else {
|
||||
if (binaryPackages.contains(QMimeDatabase().mimeTypeForFile(archive).name())) {
|
||||
if (binaryPackages->contains(QMimeDatabase().mimeTypeForFile(archive).name())) {
|
||||
packageKit(PackageOperation::Install, archive);
|
||||
}
|
||||
const QString dir = generateDirPath(archive);
|
||||
|
@ -366,7 +367,7 @@ bool cmdUninstall(const QString &archive, QString &errorText)
|
|||
return false;
|
||||
}
|
||||
} else {
|
||||
if (binaryPackages.contains(QMimeDatabase().mimeTypeForFile(archive).name())) {
|
||||
if (binaryPackages->contains(QMimeDatabase().mimeTypeForFile(archive).name())) {
|
||||
packageKit(PackageOperation::Uninstall, archive);
|
||||
}
|
||||
const QString dir = generateDirPath(archive);
|
||||
|
|
Loading…
Reference in a new issue