Commit d56e6d49 authored by Laurent Montel's avatar Laurent Montel 😁

Fix some clazy warning

parent 1ad7a788
......@@ -248,7 +248,7 @@ void DiscoverObject::openLocalPackage(const QUrl& localfile)
auto mime = db.mimeTypeForUrl(localfile);
auto fIsFlatpakBackend = [](AbstractResourcesBackend* backend) { return backend->metaObject()->className() == QByteArray("FlatpakBackend"); };
if (mime.name().startsWith(QLatin1String("application/vnd.flatpak")) && !kContains(ResourcesModel::global()->backends(), fIsFlatpakBackend)) {
openApplication(QUrl(QLatin1String("appstream://org.kde.discover.flatpak")));
openApplication(QUrl(QStringLiteral("appstream://org.kde.discover.flatpak")));
showPassiveNotification(i18n("Cannot interact with flatpak resources without the flatpak backend %1. Please install it first.", localfile.toDisplayString()));
} else {
setRootObjectProperty("defaultStartup", true);
......
......@@ -74,7 +74,7 @@ void processArgs(QCommandLineParser* parser, DiscoverObject* mainWindow)
mainWindow->openMode(parser->value(QStringLiteral("mode")));
if(parser->isSet(QStringLiteral("search")))
mainWindow->openSearch(parser->value(QStringLiteral("search")));
Q_EMIT mainWindow->openSearch(parser->value(QStringLiteral("search")));
if(parser->isSet(QStringLiteral("local-filename")))
mainWindow->openLocalPackage(QUrl::fromUserInput(parser->value(QStringLiteral("local-filename")), {}, QUrl::AssumeLocalFile));
......
......@@ -197,7 +197,7 @@ void FwupdResource::setDeviceDetails(FwupdDevice* dev)
if (fwupd_device_get_icons(dev)->len >= 1)
m_iconName = QString::fromUtf8((const gchar *)g_ptr_array_index(fwupd_device_get_icons(dev), 0));// Check whether given icon exists or not!
else
m_iconName = QString::fromUtf8("device-notifier");
m_iconName = QStringLiteral("device-notifier");
}
QString FwupdResource::cacheFile() const
......
......@@ -64,7 +64,7 @@ public:
}
else if(value.toInt() == Qt::Unchecked)
{
if(fwupd_client_modify_remote(m_backend->backend->client,fwupd_remote_get_id(remote),QString(QLatin1String("Enabled")).toUtf8().constData(),(QString(QLatin1String("false")).toUtf8().constData()),nullptr,nullptr))
if(fwupd_client_modify_remote(m_backend->backend->client,fwupd_remote_get_id(remote),QStringLiteral("Enabled").toUtf8().constData(),(QStringLiteral("false").toUtf8().constData()),nullptr,nullptr))
item->setData(value, role);
}
......
......@@ -42,7 +42,7 @@ KNSBackendTest::KNSBackendTest(QObject* parent)
, m_r(nullptr)
{
QStandardPaths::setTestModeEnabled(true);
ResourcesModel* model = new ResourcesModel(QLatin1String("kns-backend"), this);
ResourcesModel* model = new ResourcesModel(QStringLiteral("kns-backend"), this);
Q_ASSERT(!model->backends().isEmpty());
auto findTestBackend = [](AbstractResourcesBackend* backend) {
return backend->name() == QLatin1String("discover_ktexteditor_codesnippets_core.knsrc");
......
......@@ -126,10 +126,10 @@ void PackageKitBackend::updateProxy()
return;
everHad = KProtocolManager::useProxy();
PackageKit::Daemon::global()->setProxy(KProtocolManager::proxyFor(QLatin1String("http")),
KProtocolManager::proxyFor(QLatin1String("https")),
KProtocolManager::proxyFor(QLatin1String("ftp")),
KProtocolManager::proxyFor(QLatin1String("socks")),
PackageKit::Daemon::global()->setProxy(KProtocolManager::proxyFor(QStringLiteral("http")),
KProtocolManager::proxyFor(QStringLiteral("https")),
KProtocolManager::proxyFor(QStringLiteral("ftp")),
KProtocolManager::proxyFor(QStringLiteral("socks")),
{},
{});
}
......@@ -450,10 +450,10 @@ ResultsStream * PackageKitBackend::findResourceByPackageName(const QUrl& url)
if (url.isLocalFile()) {
QMimeDatabase db;
const auto mime = db.mimeTypeForUrl(url);
if ( mime.inherits(QLatin1String("application/vnd.debian.binary-package"))
|| mime.inherits(QLatin1String("application/x-rpm"))
|| mime.inherits(QLatin1String("application/x-tar"))
|| mime.inherits(QLatin1String("application/x-xz-compressed-tar"))
if ( mime.inherits(QStringLiteral("application/vnd.debian.binary-package"))
|| mime.inherits(QStringLiteral("application/x-rpm"))
|| mime.inherits(QStringLiteral("application/x-tar"))
|| mime.inherits(QStringLiteral("application/x-xz-compressed-tar"))
) {
pkg = new LocalFilePKResource(url, this);
}
......
......@@ -119,7 +119,7 @@ void PackageKitNotifier::checkOfflineUpdates()
if (!success) {
const QString errorDetails = group.readEntry("ErrorDetails");
KNotification *notification = new KNotification(QLatin1String("offlineupdate-failed"), KNotification::Persistent | KNotification::DefaultEvent);
KNotification *notification = new KNotification(QStringLiteral("offlineupdate-failed"), KNotification::Persistent | KNotification::DefaultEvent);
notification->setIconName(QStringLiteral("error"));
notification->setText(i18n("Offline Updates"));
notification->setText(i18n("Failed to update %1 packages\n%2", packages.count(), errorDetails));
......@@ -137,7 +137,7 @@ void PackageKitNotifier::checkOfflineUpdates()
notification->sendEvent();
} else {
KNotification *notification = new KNotification(QLatin1String("offlineupdate-successful"));
KNotification *notification = new KNotification(QStringLiteral("offlineupdate-successful"));
notification->setIconName(QStringLiteral("system-software-update"));
notification->setTitle(i18n("Offline Updates"));
notification->setText(i18n("Successfully updated %1 packages", packages.count()));
......
......@@ -200,7 +200,7 @@ QStringList DiscoverNotifier::loadedModules() const
void DiscoverNotifier::showRebootNotification()
{
KNotification *notification = new KNotification(QLatin1String("notification"), KNotification::Persistent | KNotification::DefaultEvent);
KNotification *notification = new KNotification(QStringLiteral("notification"), KNotification::Persistent | KNotification::DefaultEvent);
notification->setIconName(QStringLiteral("system-software-update"));
notification->setActions(QStringList{QLatin1String("Restart")});
notification->setTitle(i18n("Restart is required"));
......@@ -219,7 +219,7 @@ void DiscoverNotifier::reboot()
void DiscoverNotifier::foundUpgradeAction(UpgradeAction* action)
{
KNotification *notification = new KNotification(QLatin1String("distupgrade-notification"), KNotification::Persistent | KNotification::DefaultEvent);
KNotification *notification = new KNotification(QStringLiteral("distupgrade-notification"), KNotification::Persistent | KNotification::DefaultEvent);
notification->setIconName(QStringLiteral("system-software-update"));
notification->setActions(QStringList{QLatin1String("Upgrade")});
notification->setTitle(i18n("Upgrade available"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment