Commit 86e3748f authored by Stefan Brüns's avatar Stefan Brüns

[AppStream Runner] Use categorized logging

Summary:
Add category org.kde.plasma.runner.appstream, like done for the Services
runner, i.e. org.kde.plasma.runner.services

Reviewers: #plasma, apol, ngraham

Reviewed By: apol

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D14805
parent 74a38143
add_definitions(-DTRANSLATION_DOMAIN="plasma_runner_appstream")
add_library(krunner_appstream MODULE appstreamrunner.cpp)
set(krunner_appstream_SRCS
appstreamrunner.cpp
)
ecm_qt_declare_logging_category(krunner_appstream_SRCS
HEADER debug.h
IDENTIFIER RUNNER_APPSTREAM
CATEGORY_NAME org.kde.plasma.runner.appstream
DEFAULT_SEVERITY Warning)
add_library(krunner_appstream MODULE ${krunner_appstream_SRCS})
target_link_libraries(krunner_appstream PUBLIC KF5::Runner KF5::I18n KF5::Service AppStreamQt)
install(TARGETS krunner_appstream DESTINATION ${KDE_INSTALL_PLUGINDIR})
......
......@@ -30,6 +30,8 @@
#include <KLocalizedString>
#include <KServiceTypeTrader>
#include "debug.h"
K_EXPORT_PLASMA_RUNNER(installer, InstallerRunner)
InstallerRunner::InstallerRunner(QObject *parent, const QVariantList &args)
......@@ -107,7 +109,7 @@ void InstallerRunner::run(const Plasma::RunnerContext &/*context*/, const Plasma
{
const QUrl appstreamUrl = match.data().toUrl();
if (!QDesktopServices::openUrl(appstreamUrl))
qWarning() << "couldn't open" << appstreamUrl;
qCWarning(RUNNER_APPSTREAM) << "couldn't open" << appstreamUrl;
}
QList<AppStream::Component> InstallerRunner::findComponentsByString(const QString &query)
......@@ -116,7 +118,7 @@ QList<AppStream::Component> InstallerRunner::findComponentsByString(const QStrin
QString error;
static bool opened = m_db.load(&error);
if(!opened) {
qWarning() << "Had errors when loading AppStream metadata pool" << error;
qCWarning(RUNNER_APPSTREAM) << "Had errors when loading AppStream metadata pool" << error;
}
return m_db.search(query);
......
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