summaryrefslogtreecommitdiffstats
path: root/examples/agent/pkagentexample.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2021-10-30 12:06:43 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2021-10-30 12:06:43 +0900
commit28de2ff84f59ac0b173670aa9c5331bc77c1e63f (patch)
tree43dcf0f461ee5552100b648e38979982c971597d /examples/agent/pkagentexample.cpp
downloadpolkit-tqt-28de2ff84f59ac0b173670aa9c5331bc77c1e63f.tar.gz
polkit-tqt-28de2ff84f59ac0b173670aa9c5331bc77c1e63f.zip
Initial import from polkit-qt-1 debian snapshot archive.
https://snapshot.debian.org/package/polkit-qt-1/0.103.0-1/ Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'examples/agent/pkagentexample.cpp')
-rw-r--r--examples/agent/pkagentexample.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/agent/pkagentexample.cpp b/examples/agent/pkagentexample.cpp
new file mode 100644
index 000000000..ed36363ba
--- /dev/null
+++ b/examples/agent/pkagentexample.cpp
@@ -0,0 +1,17 @@
+#define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE 1
+
+#include <polkitagent/polkitagent.h>
+#include "pkagentexample.h"
+#include <glib-object.h>
+#include <QtCore/QDebug>
+#include "polkitqt1-subject.h"
+
+PkAgentExample::PkAgentExample(int &argc, char **argv)
+ : QCoreApplication(argc, argv)
+{
+ g_type_init();
+
+ PolkitQt1::UnixSessionSubject session(getpid());
+
+ m_listener.registerListener(session, "/org/kde/PolicyKit1/AuthenticationAgent");
+}