From 6257ac3713b482a7deef3cf306d6c8a50076961a Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Jun 11 2013 14:22:53 +0000 Subject: kcm_useraccount: support accountsservice (#950635) --- diff --git a/kde-baseapps-kcm_useraccount-accountsservice.patch b/kde-baseapps-kcm_useraccount-accountsservice.patch new file mode 100644 index 0000000..12e9170 --- /dev/null +++ b/kde-baseapps-kcm_useraccount-accountsservice.patch @@ -0,0 +1,119 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 00de0f92b56599c68bdb2be54d0f01b04b0dda6c..ea0aa0942d3bb88a8d7334cc198149f13b810be0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + project(KDEBASE_APPS) + + # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked +-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ) ++set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH} ) + + include(CTest) + include(CTestConfig.cmake) +@@ -55,4 +55,4 @@ macro_optional_add_subdirectory( doc ) + + if(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + macro_display_feature_log() +-endif(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") ++endif(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") +\ No newline at end of file +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +new file mode 100644 +index 0000000000000000000000000000000000000000..a607a2acf051d54687916112676a3e7b824e3c96 +--- /dev/null ++++ b/cmake/CMakeLists.txt +@@ -0,0 +1,2 @@ ++ ++add_subdirectory(modules) +\ No newline at end of file +diff --git a/cmake/modules/PkgConfigGetVar.cmake b/cmake/modules/PkgConfigGetVar.cmake +new file mode 100644 +index 0000000000000000000000000000000000000000..a024fdcbfbac46b91687654de0be65e503dea6df +--- /dev/null ++++ b/cmake/modules/PkgConfigGetVar.cmake +@@ -0,0 +1,20 @@ ++include(UsePkgConfig) ++ ++MACRO(PKGCONFIG_GETVAR _package _var _output_variable) ++ SET(${_output_variable}) ++ ++ # if pkg-config has been found ++ IF(PKGCONFIG_EXECUTABLE) ++ ++ EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --exists RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull ) ++ ++ # and if the package of interest also exists for pkg-config, then get the information ++ IF(NOT _return_VALUE) ++ ++ EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable ${_var} OUTPUT_VARIABLE ${_output_variable} ) ++ ++ ENDIF(NOT _return_VALUE) ++ ++ ENDIF(PKGCONFIG_EXECUTABLE) ++ ++ENDMACRO(PKGCONFIG_GETVAR _package _var _output_variable) +\ No newline at end of file +diff --git a/kdepasswd/kcm/CMakeLists.txt b/kdepasswd/kcm/CMakeLists.txt +index b0600aae0aa8ee33d698cc63a4d3270bf24619e1..8da3b14745ef691c3016a992827d696813e6ce65 100644 +--- a/kdepasswd/kcm/CMakeLists.txt ++++ b/kdepasswd/kcm/CMakeLists.txt +@@ -5,6 +5,13 @@ set(kcm_useraccount_PART_SRCS + main.cpp + chfacedlg.cpp) + ++include(PkgConfigGetVar) ++PKGCONFIG_GETVAR(dbus-1 interfaces_dir DBUS_INTERFACES) ++set(accountsservice_xml ${DBUS_INTERFACES}/org.freedesktop.Accounts.xml ++ ${DBUS_INTERFACES}/org.freedesktop.Accounts.User.xml) ++set_source_files_properties(${accountsservice_xml} PROPERTIES NO_NAMESPACE TRUE) ++qt4_add_dbus_interfaces(kcm_useraccount_PART_SRCS ${accountsservice_xml}) ++ + kde4_add_ui_files(kcm_useraccount_PART_SRCS + main_widget.ui + faceDlg.ui) +diff --git a/kdepasswd/kcm/main.cpp b/kdepasswd/kcm/main.cpp +index 5a5248e545cc75433024ae0464ac9f3e05b71900..e3290069f204ffae83fd7901479d38b3183d1b3c 100644 +--- a/kdepasswd/kcm/main.cpp ++++ b/kdepasswd/kcm/main.cpp +@@ -47,10 +47,13 @@ + + #include "settings.h" + #include "pass.h" ++#include "accountsinterface.h" ++#include "userinterface.h" + #include "chfnprocess.h" + #include + #include + ++ + K_PLUGIN_FACTORY(Factory, + registerPlugin(); + ) +@@ -219,6 +222,26 @@ void KCMUserAccount::save() + KMessageBox::error( this, i18n("There was an error saving the image: %1" , + KCFGUserAccount::faceFile()) ); + } ++ // save icon file also with accountsservice ++ OrgFreedesktopAccountsInterface ainterface ("org.freedesktop.Accounts", ++ "/org/freedesktop/Accounts", ++ QDBusConnection::systemBus(), ++ this); ++ QDBusPendingReply reply = ainterface.FindUserById(_ku->uid()); ++ reply.waitForFinished(); ++ if (reply.isValid() && reply.count() == 1) { ++ OrgFreedesktopAccountsUserInterface uinterface ("org.freedesktop.Accounts", ++ reply.argumentAt<0>().path(), ++ QDBusConnection::systemBus(), ++ this); ++ QDBusPendingReply ureply = uinterface.SetIconFile(KCFGUserAccount::faceFile()); ++ ureply.waitForFinished(); ++ if (ureply.isError()) { ++ kDebug() << ureply.error().message(); ++ KMessageBox::error( this, i18n("There was an error setting the image: %1" , ++ KCFGUserAccount::faceFile()) ); ++ } ++ } + } + else { // delete existing image + if ( !KIO::NetAccess::del(KCFGUserAccount::faceFile(), this) ) { diff --git a/kde-baseapps.spec b/kde-baseapps.spec index 90011f8..4916ec0 100644 --- a/kde-baseapps.spec +++ b/kde-baseapps.spec @@ -1,7 +1,7 @@ Name: kde-baseapps Summary: KDE Core Applications Version: 4.10.4 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 URL: https://projects.kde.org/projects/kde/kde-baseapps @@ -30,6 +30,11 @@ Patch4: kdebase-4.3.4-bz#609039-chfn-parse.patch # as default browser in GNOME Patch5: kde-baseapps-4.9.2-konqueror-mimetyp.patch +# kcm_useraccount: support accountsservice +# https://bugzilla.redhat.com/show_bug.cgi?id=950635 +# https://git.reviewboard.kde.org/r/110875 +Patch6: kde-baseapps-kcm_useraccount-accountsservice.patch + ## upstream patches %ifnarch s390 s390x @@ -123,6 +128,7 @@ Requires: kdelibs4-devel %patch3 -p2 -b .kde#228593 %patch4 -p2 -b .bz#631481 %patch5 -p1 -b .mimetyp.patch +%patch6 -p1 -b .kcm_useraccount-accountsservice %build @@ -281,6 +287,9 @@ fi %changelog +* Tue Jun 11 2013 Rex Dieter 4.10.4-2 +- kcm_useraccount: support accountsservice (#950635) + * Sat Jun 01 2013 Rex Dieter - 4.10.4-1 - 4.10.4