Hello community,
here is the log from the commit of package kauth for openSUSE:Factory checked in at 2017-03-03 15:11:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kauth (Old)
and /work/SRC/openSUSE:Factory/.kauth.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kauth"
Fri Mar 3 15:11:48 2017 rev:42 rq:461399 version:5.31.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/kauth/kauth.changes 2017-02-03 17:43:51.908353454 +0100
+++ /work/SRC/openSUSE:Factory/.kauth.new/kauth.changes 2017-03-03 15:11:49.289749407 +0100
@@ -1,0 +2,7 @@
+Thu Feb 9 09:23:52 UTC 2017 - hrvoje.senjan@gmail.com
+
+- Update to 5.31.0
+ * For more details please see:
+ https://www.kde.org/announcements/kde-frameworks-5.31.0.php
+
+-------------------------------------------------------------------
Old:
----
kauth-5.30.0.tar.xz
New:
----
kauth-5.31.0.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kauth.spec ++++++
--- /var/tmp/diff_new_pack.dSVPSH/_old 2017-03-03 15:11:49.793678058 +0100
+++ /var/tmp/diff_new_pack.dSVPSH/_new 2017-03-03 15:11:49.797677491 +0100
@@ -18,9 +18,9 @@
%bcond_without lang
%define lname libKF5Auth5
-%define _tar_path 5.30
+%define _tar_path 5.31
Name: kauth
-Version: 5.30.0
+Version: 5.31.0
Release: 0
%define kf5_version %{version}
BuildRequires: cmake >= 3.0
@@ -30,10 +30,10 @@
BuildRequires: kf5-filesystem
BuildRequires: libpolkit-qt5-1-devel
%if %{with lang}
-BuildRequires: cmake(Qt5LinguistTools) >= 5.5.0
+BuildRequires: cmake(Qt5LinguistTools) >= 5.6.0
%endif
-BuildRequires: cmake(Qt5DBus) >= 5.5.0
-BuildRequires: cmake(Qt5Widgets) >= 5.5.0
+BuildRequires: cmake(Qt5DBus) >= 5.6.0
+BuildRequires: cmake(Qt5Widgets) >= 5.6.0
Summary: Framework which lets applications perform actions as a privileged user
License: LGPL-2.1+
Group: System/GUI/KDE
++++++ kauth-5.30.0.tar.xz -> kauth-5.31.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/CMakeLists.txt new/kauth-5.31.0/CMakeLists.txt
--- old/kauth-5.30.0/CMakeLists.txt 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/CMakeLists.txt 2017-02-05 11:47:11.000000000 +0100
@@ -1,17 +1,17 @@
cmake_minimum_required(VERSION 3.0)
-set(KF5_VERSION "5.30.0") # handled by release scripts
-set(KF5_DEP_VERSION "5.30.0") # handled by release scripts
+set(KF5_VERSION "5.31.0") # handled by release scripts
+set(KF5_DEP_VERSION "5.31.0") # handled by release scripts
project(KAuth VERSION ${KF5_VERSION})
include(FeatureSummary)
-find_package(ECM 5.30.0 NO_MODULE)
+find_package(ECM 5.31.0 NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules")
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
-set(REQUIRED_QT_VERSION 5.5.0)
+set(REQUIRED_QT_VERSION 5.6.0)
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets DBus)
include(KDEInstallDirs)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
@@ -47,6 +47,7 @@
add_subdirectory(src)
add_subdirectory(autotests)
+add_subdirectory(examples)
# create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Auth")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/autotests/BackendsManager.cpp new/kauth-5.31.0/autotests/BackendsManager.cpp
--- old/kauth-5.30.0/autotests/BackendsManager.cpp 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/autotests/BackendsManager.cpp 2017-02-05 11:47:11.000000000 +0100
@@ -33,7 +33,7 @@
namespace KAuth
{
-AuthBackend *BackendsManager::auth = 0;
+AuthBackend *BackendsManager::auth = nullptr;
QHash< QThread *, HelperProxy * > proxiesForThreads = QHash< QThread *, HelperProxy * >();
BackendsManager::BackendsManager()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/autotests/HelperTest.cpp new/kauth-5.31.0/autotests/HelperTest.cpp
--- old/kauth-5.30.0/autotests/HelperTest.cpp 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/autotests/HelperTest.cpp 2017-02-05 11:47:11.000000000 +0100
@@ -51,7 +51,7 @@
Q_OBJECT
public:
- HelperTest(QObject *parent = 0) : QObject(parent)
+ HelperTest(QObject *parent = nullptr) : QObject(parent)
{ }
private Q_SLOTS:
@@ -62,6 +62,7 @@
void testExecuteJobSignals();
void testTwoCalls();
void testActionData();
+ void testHelperFailure();
void cleanup() {}
void cleanupTestCase() {}
@@ -74,7 +75,7 @@
};
HelperHandler::HelperHandler()
- : QObject(0)
+ : QObject(nullptr)
{
/* Hello adventurer. What you see here might hurt your eyes, but let me explain why you don't want
to touch this code. We are dealing with same-process async DBus requests, and if this seems obscure
@@ -103,7 +104,7 @@
m_helperProxy = new DBusHelperProxy(QDBusConnection::sessionBus());
m_helper = new TestHelper;
// The timer is here just to prevent the app from crashing.
- QTimer *timer = new QTimer(0);
+ QTimer *timer = new QTimer(nullptr);
QVERIFY(m_helperProxy->initHelper(QLatin1String("org.kde.kf5auth.autotest")));
@@ -223,5 +224,16 @@
QCOMPARE(job->data(), args);
}
+void HelperTest::testHelperFailure()
+{
+ KAuth::Action action(QLatin1String("org.kde.kf5auth.autotest.failingaction"));
+ action.setHelperId(QLatin1String("org.kde.kf5auth.autotest"));
+ QVERIFY(action.isValid());
+ QCOMPARE(action.status(), KAuth::Action::AuthRequiredStatus);
+ KAuth::ExecuteJob *job = action.execute();
+ QVERIFY(!job->exec());
+ QVERIFY(job->error());
+}
+
QTEST_MAIN(HelperTest)
#include "HelperTest.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/autotests/SetupActionTest.cpp new/kauth-5.31.0/autotests/SetupActionTest.cpp
--- old/kauth-5.30.0/autotests/SetupActionTest.cpp 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/autotests/SetupActionTest.cpp 2017-02-05 11:47:11.000000000 +0100
@@ -28,7 +28,7 @@
Q_OBJECT
public:
- SetupActionTest(QObject *parent = 0)
+ SetupActionTest(QObject *parent = nullptr)
: QObject(parent)
{ }
@@ -66,7 +66,7 @@
QVERIFY(action.isValid());
// Now with regexp check
- emit changeCapabilities(0);
+ emit changeCapabilities(nullptr);
action = KAuth::Action(QLatin1String("/safinvalid124%$&"));
QVERIFY(!action.isValid());
@@ -93,7 +93,7 @@
action.setName(QLatin1String("i.do.not.exist"));
QVERIFY(!action.isValid());
- emit changeCapabilities(0);
+ emit changeCapabilities(nullptr);
action = KAuth::Action(QLatin1String("i.do.not.exist"), QLatin1String("details"));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/autotests/TestHelper.cpp new/kauth-5.31.0/autotests/TestHelper.cpp
--- old/kauth-5.30.0/autotests/TestHelper.cpp 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/autotests/TestHelper.cpp 2017-02-05 11:47:11.000000000 +0100
@@ -65,3 +65,9 @@
return ActionReply::SuccessReply();
}
+
+ActionReply TestHelper::failingaction(QVariantMap args)
+{
+ Q_UNUSED(args)
+ return ActionReply::HelperErrorReply();
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/autotests/TestHelper.h new/kauth-5.31.0/autotests/TestHelper.h
--- old/kauth-5.30.0/autotests/TestHelper.h 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/autotests/TestHelper.h 2017-02-05 11:47:11.000000000 +0100
@@ -34,6 +34,7 @@
ActionReply echoaction(QVariantMap args);
ActionReply standardaction(QVariantMap args);
ActionReply longaction(QVariantMap args);
+ ActionReply failingaction(QVariantMap args);
};
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/autotests/pythontest.py new/kauth-5.31.0/autotests/pythontest.py
--- old/kauth-5.30.0/autotests/pythontest.py 1970-01-01 01:00:00.000000000 +0100
+++ new/kauth-5.31.0/autotests/pythontest.py 2017-02-05 11:47:11.000000000 +0100
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+#-*- coding: utf-8 -*-
+
+from __future__ import print_function
+
+import sys
+
+sys.path.append(sys.argv[1])
+
+from PyQt5 import QtCore
+from PyQt5 import QtWidgets
+
+from PyKF5 import KAuth
+
+def main():
+ app = QtWidgets.QApplication(sys.argv)
+
+ a = KAuth.KAuth.Action()
+ assert(a.status() == KAuth.KAuth.Action.InvalidStatus)
+
+if __name__ == '__main__':
+ sys.exit(main())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/cmake/rules_PyKF5.py new/kauth-5.31.0/cmake/rules_PyKF5.py
--- old/kauth-5.30.0/cmake/rules_PyKF5.py 1970-01-01 01:00:00.000000000 +0100
+++ new/kauth-5.31.0/cmake/rules_PyKF5.py 2017-02-05 11:47:11.000000000 +0100
@@ -0,0 +1,41 @@
+#
+# Copyright 2016 Stephen Kelly
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os, sys
+
+import rules_engine
+sys.path.append(os.path.dirname(os.path.dirname(rules_engine.__file__)))
+import Qt5Ruleset
+
+def local_function_rules():
+ return [
+ ["KAuth::ActionReply", "ActionReply", ".*", ".*", ".*int.*", rules_engine.function_discard],
+ ]
+
+class RuleSet(Qt5Ruleset.RuleSet):
+ def __init__(self):
+ Qt5Ruleset.RuleSet.__init__(self)
+ self._fn_db = rules_engine.FunctionRuleDb(lambda: local_function_rules() + Qt5Ruleset.function_rules())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/examples/CMakeLists.txt new/kauth-5.31.0/examples/CMakeLists.txt
--- old/kauth-5.30.0/examples/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/kauth-5.31.0/examples/CMakeLists.txt 2017-02-05 11:47:11.000000000 +0100
@@ -0,0 +1,6 @@
+# We only need to build the examples, to be sure they are up-to-date.
+add_executable(client client.cpp)
+target_link_libraries(client KF5::Auth)
+
+add_executable(helper helper.cpp)
+target_link_libraries(helper KF5::Auth)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/examples/client.cpp new/kauth-5.31.0/examples/client.cpp
--- old/kauth-5.30.0/examples/client.cpp 1970-01-01 01:00:00.000000000 +0100
+++ new/kauth-5.31.0/examples/client.cpp 2017-02-05 11:47:11.000000000 +0100
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2017 Elvis Angelaccio
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA .
+ */
+
+#undef QT_NO_CAST_FROM_ASCII
+
+#include <KAuth>
+
+#include <QCoreApplication>
+#include <QDebug>
+
+using namespace KAuth;
+
+int main(int argc, char **argv)
+{
+ QCoreApplication app(argc, argv);
+
+ QString filename = "foo.txt";
+
+ //! [client_how_to_call_helper]
+ QVariantMap args;
+ args["filename"] = filename;
+ Action readAction("org.kde.kf5auth.example.read");
+ readAction.setHelperId("org.kde.kf5auth.example");
+ readAction.setArguments(args);
+ ExecuteJob *job = readAction.execute();
+ if (!job->exec()) {
+ qDebug() << "KAuth returned an error code:" << job->error();
+ } else {
+ QString contents = job->data()["contents"].toString();
+ }
+ //! [client_how_to_call_helper]
+
+ return app.exec();
+}
+
+#include "client.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/examples/helper.cpp new/kauth-5.31.0/examples/helper.cpp
--- old/kauth-5.30.0/examples/helper.cpp 1970-01-01 01:00:00.000000000 +0100
+++ new/kauth-5.31.0/examples/helper.cpp 2017-02-05 11:47:11.000000000 +0100
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2017 Elvis Angelaccio
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA .
+ */
+
+#undef QT_NO_CAST_FROM_ASCII
+
+#include <QFile>
+#include <QTextStream>
+#include <QThread>
+
+//! [helper_declaration]
+#include <KAuth>
+
+using namespace KAuth;
+
+class MyHelper : public QObject
+{
+ Q_OBJECT
+ public Q_SLOTS:
+ ActionReply read(const QVariantMap& args);
+ ActionReply write(const QVariantMap& args);
+ ActionReply longaction(const QVariantMap& args);
+};
+//! [helper_declaration]
+
+//! [helper_read_action]
+ActionReply MyHelper::read(const QVariantMap& args)
+{
+ ActionReply reply;
+ QString filename = args["filename"].toString();
+ QFile file(filename);
+ if (!file.open(QIODevice::ReadOnly)) {
+ reply = ActionReply::HelperErrorReply();
+ reply.setErrorDescription(file.errorString());
+ return reply;
+ }
+ QTextStream stream(&file);
+ QString contents;
+ stream >> contents;
+ reply.data()["contents"] = contents;
+ return reply;
+}
+//! [helper_read_action]
+
+ActionReply MyHelper::write(const QVariantMap &args)
+{
+ Q_UNUSED(args)
+ return ActionReply::SuccessReply();
+}
+
+//! [helper_longaction]
+ActionReply MyHelper::longaction(const QVariantMap&)
+{
+ for (int i = 1; i <= 100; i++) {
+ if (HelperSupport::isStopped())
+ break;
+ HelperSupport::progressStep(i);
+ QThread::usleep(250000);
+ }
+ return ActionReply::SuccessReply();
+}
+//! [helper_longaction]
+
+//! [helper_main]
+KAUTH_HELPER_MAIN("org.kde.kf5auth.example", MyHelper)
+//! [helper_main]
+
+#include "helper.moc"
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/metainfo.yaml new/kauth-5.31.0/metainfo.yaml
--- old/kauth-5.30.0/metainfo.yaml 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/metainfo.yaml 2017-02-05 11:47:11.000000000 +0100
@@ -17,3 +17,4 @@
public_lib: true
group: Frameworks
subgroup: Tier 2
+public_example_dir: examples/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/po/ar/kauth5_qt.po new/kauth-5.31.0/po/ar/kauth5_qt.po
--- old/kauth-5.30.0/po/ar/kauth5_qt.po 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/po/ar/kauth5_qt.po 2017-02-05 11:47:11.000000000 +0100
@@ -1,32 +1,32 @@
-# Safa Alfulaij , 2014.
+# Safa Alfulaij , 2014, 2017.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-06-28 15:38+0300\n"
-"PO-Revision-Date: 2014-06-06 11:21+0300\n"
+"PO-Revision-Date: 2017-01-25 21:34+0300\n"
"Last-Translator: Safa Alfulaij \n"
-"Language-Team: Arabic \n"
+"Language-Team: Arabic \n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
-"X-Generator: Lokalize 1.5\n"
+"X-Generator: Lokalize 2.0\n"
"X-Qt-Contexts: true\n"
#: backends/dbus/DBusHelperProxy.cpp:86
#, qt-format
msgctxt "KAuth::DBusHelperProxy|"
msgid "DBus Backend error: service start %1 failed: %2"
-msgstr ""
+msgstr "خطأ في سند DBus: فشل بدء الخدمة %1: %2"
#: backends/dbus/DBusHelperProxy.cpp:96
#, qt-format
msgctxt "KAuth::DBusHelperProxy|"
msgid "DBus Backend error: connection to helper failed. %1"
-msgstr ""
+msgstr "خطأ في سند DBus: فشل الاتّصال بالمساعد. %1"
#: backends/dbus/DBusHelperProxy.cpp:121
#, qt-format
@@ -34,22 +34,22 @@
msgid ""
"DBus Backend error: could not contact the helper. Connection error: %1. "
"Message error: %2"
-msgstr ""
+msgstr "خطأ في سند DBus: تعذّر الاتّصال بالمساعد. خطأ الاتّصال: %1. الرّسالة: %2"
#: kauthexecutejob.cpp:88
msgctxt "KAuth::ExecuteJob|"
msgid "Tried to start an invalid action"
-msgstr "حاول بدء إجراء غير صالح"
+msgstr "جرت محاولة بدء إجراء غير صالح"
#: kauthexecutejob.cpp:102
msgctxt "KAuth::ExecuteJob|"
msgid "Unknown execution mode chosen"
-msgstr ""
+msgstr "اختير وضع تنفيذ مجهول"
#: kauthexecutejob.cpp:140
msgctxt "KAuth::ExecuteJob|"
msgid "Unknown status for the authentication procedure"
-msgstr ""
+msgstr "حالة مجهولة لإجراء الاستيثاق"
#: kauthexecutejob.cpp:152
msgctxt "KAuth::ExecuteJob|"
@@ -57,8 +57,9 @@
"The current backend only allows helper authorization, but this action does "
"not have a helper."
msgstr ""
+"يسمح السّند الحاليّ باستيثاق المساعد فقط، ولكن هذا الإجراء لا يملك مساعدًا."
#: kauthexecutejob.cpp:160 kauthexecutejob.cpp:184
msgctxt "KAuth::ExecuteJob|"
msgid "The backend does not specify how to authorize"
-msgstr ""
+msgstr "لا يحدّد هذا السّند طريقة الاستيثاق"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/po/ast/kauth5_qt.po new/kauth-5.31.0/po/ast/kauth5_qt.po
--- old/kauth-5.30.0/po/ast/kauth5_qt.po 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/po/ast/kauth5_qt.po 2017-02-05 11:47:11.000000000 +0100
@@ -1,8 +1,8 @@
-# enolp , 2016.
+# enolp , 2016, 2017.
msgid ""
msgstr ""
"Project-Id-Version: \n"
-"PO-Revision-Date: 2016-12-20 21:29+0100\n"
+"PO-Revision-Date: 2017-01-10 01:43+0100\n"
"Last-Translator: enolp \n"
"Language-Team: Asturian \n"
"Language: ast\n"
@@ -26,14 +26,14 @@
msgstr "Fallu del backend de DBus: falló la conexón del ayudante. %1"
#: backends/dbus/DBusHelperProxy.cpp:121
-#, fuzzy, qt-format
+#, qt-format
msgctxt "KAuth::DBusHelperProxy|"
msgid ""
"DBus Backend error: could not contact the helper. Connection error: %1. "
"Message error: %2"
msgstr ""
-"Fallu del backend de DBus: falló la conexón del ayudante. Fallu de conexón: "
-"%1. Mensaxe de fallu: %2"
+"Fallu del backend de DBus: nun pudo contautase col ayudante. Fallu de "
+"conexón: %1. Mensaxe de fallu: %2"
#: kauthexecutejob.cpp:88
msgctxt "KAuth::ExecuteJob|"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/po/de/kauth5_qt.po new/kauth-5.31.0/po/de/kauth5_qt.po
--- old/kauth-5.30.0/po/de/kauth5_qt.po 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/po/de/kauth5_qt.po 2017-02-05 11:47:11.000000000 +0100
@@ -4,7 +4,7 @@
# Stephan Johach , 2004, 2005, 2006, 2007.
# Georg Schuster , 2005.
# Thomas Reitelbach , 2005, 2006, 2007, 2008, 2009.
-# Burkhard Lück , 2006, 2007, 2009, 2010, 2011, 2012, 2013, 2014, 2016.
+# Burkhard Lück , 2006, 2007, 2009, 2010, 2011, 2012, 2013, 2014, 2016, 2017.
# Frederik Schwarzer , 2007, 2008, 2009, 2010, 2011, 2012, 2013.
# Johannes Obermayr , 2010.
# Panagiotis Papadopoulos , 2010.
@@ -14,7 +14,7 @@
"Project-Id-Version: kdelibs4\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2014-03-23 01:50+0000\n"
-"PO-Revision-Date: 2016-12-19 15:31+0100\n"
+"PO-Revision-Date: 2017-01-08 21:15+0100\n"
"Last-Translator: Burkhard Lück \n"
"Language-Team: German \n"
"Language: de\n"
@@ -26,14 +26,11 @@
"Plural-Forms: nplurals=2; plural=n != 1;\n"
#: backends/dbus/DBusHelperProxy.cpp:86
-#, fuzzy, qt-format
-#| msgctxt "KAuth::DBusHelperProxy|"
-#| msgid "DBus Backend error: connection to helper failed. "
+#, qt-format
msgctxt "KAuth::DBusHelperProxy|"
msgid "DBus Backend error: service start %1 failed: %2"
msgstr ""
-"Fehler im D-Bus-Hintergrundprogramm: Verbindung zu Hilfsanwendung "
-"fehlgeschlagen. "
+"Fehler im D-Bus-Hintergrundprogramm: Start des Dienstes %1 fehlgeschlagen: %2"
#: backends/dbus/DBusHelperProxy.cpp:96
#, qt-format
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/po/gl/kauth5_qt.po new/kauth-5.31.0/po/gl/kauth5_qt.po
--- old/kauth-5.30.0/po/gl/kauth5_qt.po 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/po/gl/kauth5_qt.po 2017-02-05 11:47:11.000000000 +0100
@@ -59,7 +59,7 @@
#: kauthexecutejob.cpp:88
msgctxt "KAuth::ExecuteJob|"
msgid "Tried to start an invalid action"
-msgstr "Tentouse iniciar unha acción non válida"
+msgstr "Intentouse iniciar unha acción non válida"
#: kauthexecutejob.cpp:102
msgctxt "KAuth::ExecuteJob|"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/src/AuthBackend.cpp new/kauth-5.31.0/src/AuthBackend.cpp
--- old/kauth-5.30.0/src/AuthBackend.cpp 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/src/AuthBackend.cpp 2017-02-05 11:47:11.000000000 +0100
@@ -33,7 +33,7 @@
};
AuthBackend::AuthBackend()
- : QObject(0)
+ : QObject(nullptr)
, d(new Private)
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/src/BackendsManager.cpp new/kauth-5.31.0/src/BackendsManager.cpp
--- old/kauth-5.30.0/src/BackendsManager.cpp 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/src/BackendsManager.cpp 2017-02-05 11:47:11.000000000 +0100
@@ -33,8 +33,8 @@
namespace KAuth
{
-AuthBackend *BackendsManager::auth = 0;
-HelperProxy *BackendsManager::helper = 0;
+AuthBackend *BackendsManager::auth = nullptr;
+HelperProxy *BackendsManager::helper = nullptr;
BackendsManager::BackendsManager()
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/src/CMakeLists.txt new/kauth-5.31.0/src/CMakeLists.txt
--- old/kauth-5.30.0/src/CMakeLists.txt 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/src/CMakeLists.txt 2017-02-05 11:47:11.000000000 +0100
@@ -49,6 +49,29 @@
REQUIRED_HEADERS KAuth_HEADERS
)
+find_package(PythonModuleGeneration)
+
+if (PythonModuleGeneration_FOUND)
+ ecm_generate_python_binding(
+ TARGET KF5::Auth
+ PYTHONNAMESPACE PyKF5
+ MODULENAME KAuth
+ RULES_FILE "${CMAKE_SOURCE_DIR}/cmake/rules_PyKF5.py"
+ INSTALL_DIR_SUFFIX ${KDE_INSTALL_PYTHONBINDINGSDIR}
+ SIP_INCLUDES $
+ SIP_DEPENDS
+ QtWidgets/QtWidgetsmod.sip
+ PyKF5/KCoreAddons/KCoreAddonsmod.sip
+ HEADERS
+ kauth.h
+ kauthhelpersupport.h
+ kauthaction.h
+ kauthactionreply.h
+ kauthexecutejob.h
+ kauthobjectdecorator.h
+ )
+endif()
+
# KAuth policy generator executable
# Compile only if fake backend has not been selected
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/src/backends/dbus/DBusHelperProxy.cpp new/kauth-5.31.0/src/backends/dbus/DBusHelperProxy.cpp
--- old/kauth-5.30.0/src/backends/dbus/DBusHelperProxy.cpp 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/src/backends/dbus/DBusHelperProxy.cpp 2017-02-05 11:47:11.000000000 +0100
@@ -37,14 +37,14 @@
static void debugMessageReceived(int t, const QString &message);
DBusHelperProxy::DBusHelperProxy()
- : responder(0)
+ : responder(nullptr)
, m_stopRequest(false)
, m_busConnection(QDBusConnection::systemBus())
{
}
DBusHelperProxy::DBusHelperProxy(const QDBusConnection &busConnection)
- : responder(0)
+ : responder(nullptr)
, m_stopRequest(false)
, m_busConnection(busConnection)
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/src/kauthaction.cpp new/kauth-5.31.0/src/kauthaction.cpp
--- old/kauth-5.30.0/src/kauthaction.cpp 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/src/kauthaction.cpp 2017-02-05 11:47:11.000000000 +0100
@@ -34,7 +34,7 @@
class ActionData : public QSharedData
{
public:
- ActionData() : valid(false), parent(0), timeout(-1) {}
+ ActionData() : valid(false), parent(nullptr), timeout(-1) {}
ActionData(const ActionData &other)
: QSharedData(other)
, name(other.name)
@@ -201,7 +201,7 @@
ExecuteJob *Action::execute(ExecutionMode mode)
{
- return new ExecuteJob(*this, mode, 0);
+ return new ExecuteJob(*this, mode, nullptr);
}
bool Action::hasHelper() const
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/src/kauthactionreply.cpp new/kauth-5.31.0/src/kauthactionreply.cpp
--- old/kauth-5.30.0/src/kauthactionreply.cpp 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/src/kauthactionreply.cpp 2017-02-05 11:47:11.000000000 +0100
@@ -50,7 +50,15 @@
}
const ActionReply ActionReply::HelperErrorReply()
{
- return ActionReply(ActionReply::HelperErrorType);
+ ActionReply reply(ActionReply::HelperErrorType);
+ reply.setError(-1);
+ return reply;
+}
+const ActionReply ActionReply::HelperErrorReply(int error)
+{
+ ActionReply reply(ActionReply::HelperErrorType);
+ reply.setError(error);
+ return reply;
}
const ActionReply ActionReply::NoResponderReply()
{
@@ -164,6 +172,16 @@
}
}
+int ActionReply::error() const
+{
+ return d->errorCode;
+}
+
+void ActionReply::setError(int error)
+{
+ d->errorCode = error;
+}
+
QString ActionReply::errorDescription() const
{
return d->errorDescription;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/src/kauthactionreply.h new/kauth-5.31.0/src/kauthactionreply.h
--- old/kauth-5.30.0/src/kauthactionreply.h 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/src/kauthactionreply.h 2017-02-05 11:47:11.000000000 +0100
@@ -134,21 +134,7 @@
source code tree you find a complete example. Let's look at that. The
helper.h file declares the class that implements the helper. It looks like:
- @code
- #include
-
- using namespace KAuth;
-
- class MyHelper : public QObject
- {
- Q_OBJECT
-
- public Q_SLOTS:
- ActionReply read(const QVariantMap& args);
- ActionReply write(const QVariantMap& args);
- ActionReply longaction(const QVariantMap& args);
- };
- @endcode
+ @snippet helper.h helper_declaration
The slot names are the last part of the action name, without the helper's ID if
it's a prefix, with all the dots replaced by underscores. In this case, the
@@ -170,27 +156,7 @@
Let's look at the read action implementation. Its purpose is to read files:
- @code
- ActionReply MyHelper::read(QVariantMap args)
- {
- ActionReply reply;
- QString filename = args["filename"].toString();
- QFile file(filename);
- if (!file.open(QIODevice::ReadOnly)) {
- reply = ActionReply::HelperErrorReply;
- reply.setErrorCode(file.error());
-
- return reply;
- }
-
- QTextStream stream(&file);
- QString contents;
- stream >> contents;
- reply.data()["contents"] = contents;
-
- return reply;
- }
- @endcode
+ @snippet helper.cpp helper_read_action
First, the code creates a default reply object. The default constructor creates
a reply that reports success. Then it gets the filename parameter from the
@@ -206,16 +172,14 @@
it. Instead, you use the KAUTH_HELPER_MAIN() macro that will take care of
everything. It's used like this:
- @code
- KAUTH_HELPER_MAIN("org.kde.kf5auth.example", MyHelper)
- @endcode
+ @snippet helper.cpp helper_main
The first parameter is the string containing the helper identifier. Please note
that you need to use this same string in the application's code to tell the
library which helper to call, so please stay away from typos, because we don't
have any way to detect them. The second parameter is the name of the helper's
class. Your helper, if complex, can be composed of a lot of source files, but
- the important thing is to include this macro in one at least one of them.
+ the important thing is to include this macro in at least one of them.
To build the helper, KDE macros provide a function named
kauth_install_helper_files(). Use it in your cmake file like this:
@@ -236,7 +200,7 @@
It usually is root, but some actions could require less strict permissions, so
you should use the right user where possible (for example the user apache if
you have to mess with apache settings). Note that the target created by this
- macro already links to libkauth and QtCore
+ macro already links to libkauth and QtCore.
@section kauth_actions Action registration
@@ -277,62 +241,28 @@
@section kauth_app Calling the helper from the application
- Once the helper is ready, we need to call it from the main application. In the
- example's mainwindow.cpp you can see how this is done. To create a reference to
+ Once the helper is ready, we need to call it from the main application.
+ In examples/client.cpp you can see how this is done. To create a reference to
an action, an object of type Action has to be created. Every Action object
refers to an action by its action id. Two objects with the same action id will
act on the same action. With an Action object, you can authorize and execute
- the action. To execute an action you have a couple of choices:
- - A synchronous call, using the Action::execute() method, will start the
- helper, execute the action and return the reply.
- - An asynchronous call, by setting Action::setExecutesAsync(true) and calling
- Action::execute(), will start the helper and return immediately.
-
- The asynchronous call is the most flexible alternative, but you need a way to
- obtain the reply. This is done by connecting to a signal, but the Action class
- is not a QObject subclass. Instead, you connect to signals exposed by the
- ActionWatcher class. For every action id you use, there is one ActionWatcher
- object. You can retrieve it using the Action::watcher() method. If you execute
- an action using Action::executeAsync(), you can connect to the
- actionPerformed(ActionReply) signal to be notified when the action has been
- completed (or failed). As a parameter, you'll get a reply object containing all
- the data you need. As a convenience, you can also pass an object and a slot to
- the executeAsync() method to directly connect them to the signal, if you don't
- want to mess with watchers.
-
- The piece of code that calls the action of the previous example is located in
- example/mainwindow.cpp in the on_readAction_triggered() slot. It looks like
- this:
- @code
- QVariantMap args;
- args["filename"] = filename;
- Action readAction = "org.kde.kf5auth.example.read";
- readAction.setHelperID("org.kde.kf5auth.example");
- readAction.setArguments(args);
-
- ActionReply reply = readAction.execute();
- if (reply.failed())
- QMessageBox::information(this, "Error", QString("KAuth returned an error code: %1").arg(reply.errorCode()));
- else
- contents = reply.data()["contents"].toString();
- @endcode
+ the action. To execute an action you need to retrieve an ExecuteJob, which is
+ a standard KJob that you can run synchronously or asynchronously.
+ See the KJob documentation (from KCoreAddons) for more details.
+
+ The piece of code that calls the action of the previous example is:
+
+ @snippet client.cpp client_how_to_call_helper
First of all, it creates the action object specifying the action id. Then it
loads the filename (we want to read a forbidden file) into the arguments()
QVariantMap, which will be directly passed to the helper in the read() slot's
parameter. This example code uses a synchronous call to execute the action and
retrieve the reply. If the reply succeeded, the reply data is retrieved from
- the returned QVariantMap object. Please note that, although the execute()
- method will return only when the action is completed, the GUI will remain
- responsive because an internal event loop is entered. This means you should be
- prepared to receive other events in the meanwhile. Also, notice that you have
+ the returned QVariantMap object. Please note that you have
to explicitly set the helper ID to the action: this is done for added safety,
to prevent the caller from accidentally invoking a helper, and also because
- KAuth actions may be used without a helper attached (the default). In this
- case, action.execute() will return ActionSuccess if the authentication went
- well. This is quite useful if you want your user to authenticate before doing
- something, which however needs no privileged permissions implementation-wise.
-
+ KAuth actions may be used without a helper attached (the default).
@section kauth_async Asynchronous calls, data reporting, and action termination
@@ -344,23 +274,13 @@
- The application needs to be able to stop the action execution if the user
stops it or close the application.
The example code follows:
- @code
- ActionReply MyHelper::longaction(QVariantMap args)
- {
- for (int i = 1; i <= 100; i++) {
- if (HelperSupport::isStopped())
- break;
- HelperSupport::progressStep(i);
- usleep(250000);
- }
- return ActionReply::SuccessReply;
- }
- @endcode
+
+ @snippet helper.cpp helper_longaction
In this example, the action is only waiting a "long" time using a loop, but we
can see some interesting line. The progress status is sent to the application
using the HelperSupport::progressStep() method. When this method is called,
- the ActionWatcher associated with this action will emit the progressStep()
+ the HelperProxy associated with this action will emit the progressStep()
signal, reporting back the data to the application. There are two overloads of
these methods and corresponding signals. The one used here takes an integer.
Its meaning is application dependent, so you can use it as a sort of
@@ -369,76 +289,14 @@
custom data you want.
In this example code, the loop exits when the HelperSupport::isStopped()
- returns true. This happens when the application calls the stop() method on the
- correponding action object. The stop() method, this way, asks the helper to
+ returns true. This happens when the application calls the HelperProxy::stopAction()
+ method on the correponding action object.
+ The stopAction() method, this way, asks the helper to
stop the action execution. It's up to the helper to obbey to this request, and
if it does so, it should return from the slot, _not_ exit.
- The code that calls the action in the application connects a slot to the
- actionPerformed() signal and then call executeAsync(). The progressStep()
- signal is directly connected to a QProgressBar, and the Stop button in the UI
- is connected to a slot that calls the Action::stop() method.
-
- @code
- void MainWindow::on_longAction_triggered()
- {
- Action longAction = "org.kde.kf5auth.example.longaction";
- connect(longAction.watcher(), SIGNAL(progressStep(int)),
- progressBar, SLOT(setValue(int)));
- connect(longAction.watcher(), SIGNAL(actionPerformed(ActionReply)),
- this, SLOT(longActionPerformed(ActionReply)));
-
- longAction.setExecutesAsync(true);
- if (longAction.execute() != Action::Authorized)
- this->statusBar()->showMessage("Could not execute the long action");
-
- //...
- }
-
- void MainWindow::stopLongAction()
- {
- Action("org.kde.kf5auth.example.longaction").stop();
- }
-
- void MainWindow::longActionPerformed(ActionReply reply)
- {
- //...
-
- if (reply.succeeded())
- this->statusBar()->showMessage("Action succeeded", 10000);
- else
- this->statusBar()->showMessage(QString("Could not execute the long action: %1").arg(reply.errorCode()), 10000);
- }
- @endcode
-
- Please pay attention that when you call an action, the helper will be busy
- executing that action. Therefore, you can't call two execute() methods in
- sequence like that:
-
- @code
- action1.execute();
- action2.execute();
- @endcode
-
- If you do, you'll get a HelperBusy reply from the second action. A solution
- would be to launch the second action from the slot connected to the first's
- actionPerformed signal, but this would be very ugly. Read further to know how
- to solve this problem.
-
@section kauth_other Other features
- To allow to easily execute several actions in sequence, you can execute them in
- a group. This means using the Action::executeActions() static method, which
- takes a list of actions and asks the helper to execute them with a single
- request. The helper will execute the actions in the specified order. All the
- signals will be emitted from the watchers associated with each action.
-
- Sometimes the application needs to know when a particular action has started to
- execute. For this purpose, you can connect to the actionStarted() signal. It is
- emitted immediately before the helper's slot is called. This isn't very useful
- if you call execute(), but if you use executeActions() it lets you know when
- individual actions in the group are started.
-
It doesn't happen very frequently that you code something that doesn't require
some debugging, and you'll need some tool, even a basic one, to debug your
helper code as well. For this reason, the KDE Authorization library provides a
@@ -517,7 +375,8 @@
};
static const ActionReply SuccessReply(); ///< An empty successful reply. Same as using the default constructor
- static const ActionReply HelperErrorReply(); ///< An empty reply with type() == HelperError.
+ static const ActionReply HelperErrorReply(); ///< An empty reply with type() == HelperError and errorCode() == -1
+ static const ActionReply HelperErrorReply(int error); ///< An empty reply with type() == HelperError and error is set to the passed value
static const ActionReply NoResponderReply(); ///< errorCode() == NoResponder
static const ActionReply NoSuchActionReply(); ///< errorCode() == NoSuchAction
@@ -647,6 +506,17 @@
*
* @return The reply error code
*/
+ int error() const;
+
+ /**
+ * @brief Returns the error code of an error reply
+ *
+ * The error code returned is one of the values in the ActionReply::Error
+ * enumeration if type() == KAuthError.
+ * Result is only valid if the type() == HelperError
+ *
+ * @return The reply error code
+ */
Error errorCode() const;
/**
@@ -659,6 +529,18 @@
*
* If the type is Success when you call this method, it will become KAuthError
*
+ * @param error The new reply error code
+ */
+ void setError(int error);
+
+ /**
+ * @brief Sets the error code of an error reply
+ *
+ * @see
+ * If you're setting the error code in the helper, use setError(int)
+ *
+ * If the type is Success when you call this method, it will become KAuthError
+ *
* @param errorCode The new reply error code
*/
void setErrorCode(Error errorCode);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kauth-5.30.0/src/kauthhelpersupport.cpp new/kauth-5.31.0/src/kauthhelpersupport.cpp
--- old/kauth-5.30.0/src/kauthhelpersupport.cpp 2017-01-08 21:45:38.000000000 +0100
+++ new/kauth-5.31.0/src/kauthhelpersupport.cpp 2017-02-05 11:47:11.000000000 +0100
@@ -61,11 +61,11 @@
{
//try correct HOME
const char *home = "HOME";
- if (getenv(home) == NULL) {
+ if (getenv(home) == nullptr) {
struct passwd *pw = getpwuid(getuid());
int overwrite = 0;
- if (pw != NULL) {
+ if (pw != nullptr) {
setenv(home, pw->pw_dir, overwrite);
}
}
@@ -96,7 +96,7 @@
BackendsManager::helperProxy()->setHelperResponder(responder);
// Attach the timer
- QTimer *timer = new QTimer(0);
+ QTimer *timer = new QTimer(nullptr);
responder->setProperty("__KAuth_Helper_Shutdown_Timer", QVariant::fromValue(timer));
timer->setInterval(10000);
timer->start();