Commit 1472e940 authored by Méven Car's avatar Méven Car
Browse files

PlatformKWinWayland: Print an error in console when DBus call fails

Reviewers: davidre, davidedmundson, #spectacle

Reviewed By: davidedmundson

Tags: #spectacle

Differential Revision: https://phabricator.kde.org/D29305
parent f00994d9
...@@ -142,7 +142,18 @@ template <typename ArgType> ...@@ -142,7 +142,18 @@ template <typename ArgType>
void PlatformKWinWayland::callDBus(const QString &theGrabMethod, ArgType theArgument, int theWriteFile) void PlatformKWinWayland::callDBus(const QString &theGrabMethod, ArgType theArgument, int theWriteFile)
{ {
QDBusInterface lInterface(QStringLiteral("org.kde.KWin"), QStringLiteral("/Screenshot"), QStringLiteral("org.kde.kwin.Screenshot")); QDBusInterface lInterface(QStringLiteral("org.kde.KWin"), QStringLiteral("/Screenshot"), QStringLiteral("org.kde.kwin.Screenshot"));
lInterface.asyncCall(theGrabMethod, QVariant::fromValue(QDBusUnixFileDescriptor(theWriteFile)), theArgument); QDBusPendingCall pcall = lInterface.asyncCall(theGrabMethod, QVariant::fromValue(QDBusUnixFileDescriptor(theWriteFile)), theArgument);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pcall, this);
QObject::connect(watcher, &QDBusPendingCallWatcher::finished,
this, [this](QDBusPendingCallWatcher* watcher) {
if (watcher->isError()) {
const auto error = watcher->error();
qWarning() << "Error calling KWin DBus interface:" << error.name() << error.message();
newScreenshotFailed();
}
watcher->deleteLater();
});
} }
template <typename ArgType> template <typename ArgType>
......
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