mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 10:14:45 +00:00
Use generated DBus interface
This commit is contained in:
parent
51f4c454c0
commit
849cb5f88f
1 changed files with 4 additions and 5 deletions
|
|
@ -168,20 +168,19 @@ void PhonePanel::takeScreenshot()
|
||||||
qWarning() << "Could not take screenshot";
|
qWarning() << "Could not take screenshot";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QDBusInterface lInterface(QStringLiteral("org.kde.KWin"), QStringLiteral("/Screenshot"), QStringLiteral("org.kde.kwin.Screenshot"));
|
|
||||||
// Take fullscreen screenshot, and no pointer
|
// Take fullscreen screenshot, and no pointer
|
||||||
QDBusPendingCall pcall = lInterface.asyncCall("screenshotFullscreen", QVariant::fromValue(QDBusUnixFileDescriptor(lPipeFds[1])), false);
|
QDBusPendingCall pcall = m_screenshotInterface->screenshotFullscreen(QDBusUnixFileDescriptor(lPipeFds[1]), false);
|
||||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pcall, this);
|
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pcall, this);
|
||||||
QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [this](QDBusPendingCallWatcher* watcher) {
|
QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [](QDBusPendingCallWatcher* watcher) {
|
||||||
if (watcher->isError()) {
|
if (watcher->isError()) {
|
||||||
const auto error = watcher->error();
|
const auto error = watcher->error();
|
||||||
qWarning() << "Error calling KWin DBus interface:" << error.name() << error.message();
|
qWarning() << "Error calling KWin DBus interface:" << error.name() << error.message();
|
||||||
}
|
}
|
||||||
watcher->deleteLater();
|
watcher->deleteLater();
|
||||||
});
|
});
|
||||||
auto lWatcher = new QFutureWatcher<QImage>(this);
|
const auto lWatcher = new QFutureWatcher<QImage>(this);
|
||||||
QObject::connect(lWatcher, &QFutureWatcher<QImage>::finished, this,
|
QObject::connect(lWatcher, &QFutureWatcher<QImage>::finished, this,
|
||||||
[lWatcher, filePath, this] () {
|
[lWatcher, filePath] () {
|
||||||
lWatcher->deleteLater();
|
lWatcher->deleteLater();
|
||||||
const QImage lImage = lWatcher->result();
|
const QImage lImage = lWatcher->result();
|
||||||
qDebug() << lImage;
|
qDebug() << lImage;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue