Paste P583

Masterwork From Distant Lands
ActivePublic

Authored by apol on Apr 13 2020, 6:15 PM.
diff --git a/src/portaltest.cpp b/src/portaltest.cpp
index e34e12a..d9f421f 100644
--- a/src/portaltest.cpp
+++ b/src/portaltest.cpp
@@ -35,6 +35,8 @@
#include <QSystemTrayIcon>
#include <QTemporaryFile>
#include <QWindow>
+#include <KRun>
+#include <QDesktopServices>
#include <KNotification>
@@ -106,6 +108,12 @@ PortalTest::PortalTest(QWidget *parent, Qt::WindowFlags f)
}
});
+ connect(m_mainWindow->krun, &QPushButton::clicked, this, [this] {
+ new KRun(m_mainWindow->kurlrequester->url(), this);
+ });
+ connect(m_mainWindow->openurl, &QPushButton::clicked, this, [this] {
+ QDesktopServices::openUrl(m_mainWindow->kurlrequester->url());
+ });
connect(m_mainWindow->inhibit, &QPushButton::clicked, this, &PortalTest::inhibitRequested);
connect(m_mainWindow->uninhibit, &QPushButton::clicked, this, &PortalTest::uninhibitRequested);
connect(m_mainWindow->openFile, &QPushButton::clicked, this, &PortalTest::openFileRequested);
@@ -266,7 +274,7 @@ void PortalTest::gotPreparePrintResponse(uint response, const QVariantMap &resul
// TODO num-copies, pages
- writer.setPageSize(QPagedPaintDevice::A4);
+ writer.setPageSize(QPageSize(QPageSize::A4));
painter.drawPixmap(QPoint(0,0), QPixmap(m_mainWindow->selectedFiles->text()));
painter.end();
@@ -388,7 +396,7 @@ void PortalTest::requestDeviceAccess()
QDBusPendingCall pendingCall = QDBusConnection::sessionBus().asyncCall(message);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingCall);
- connect(watcher, &QDBusPendingCallWatcher::finished, [this] (QDBusPendingCallWatcher *watcher) {
+ connect(watcher, &QDBusPendingCallWatcher::finished, [] (QDBusPendingCallWatcher *watcher) {
QDBusPendingReply<QDBusObjectPath> reply = *watcher;
if (reply.isError()) {
qWarning() << "Couldn't get reply";
diff --git a/src/portaltest.ui b/src/portaltest.ui
index 2368b12..749291c 100644
--- a/src/portaltest.ui
+++ b/src/portaltest.ui
@@ -85,7 +85,31 @@
</widget>
</item>
<item row="2" column="1">
- <widget class="KUrlRequester" name="kurlrequester"/>
+ <layout class="QHBoxLayout" name="horizontalLayout_7">
+ <item>
+ <widget class="KUrlRequester" name="kurlrequester">
+ <property name="url">
+ <url>
+ <string>https://kde.org</string>
+ </url>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="openurl">
+ <property name="text">
+ <string>openUrl</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="krun">
+ <property name="text">
+ <string>KRun</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_15">
@@ -415,6 +439,7 @@
<zorder>label_14</zorder>
<zorder>screenshotButton</zorder>
<zorder>label_15</zorder>
+ <zorder>krun</zorder>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
apol edited the content of this paste. (Show Details)Apr 13 2020, 6:15 PM
apol changed the title of this paste from untitled to Masterwork From Distant Lands.