mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdecore: drop KAuth backend plugin support
D-Bus backend already builtin into kdecore and the headers for the backend are private Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3be89ba858
commit
6287f9c468
7 changed files with 26 additions and 155 deletions
|
@ -29,5 +29,3 @@ set(KDE4_SYSCONF_INSTALL_DIR "@KDE4_SYSCONF_INSTALL_DIR@")
|
|||
set(KDE4_DBUS_INTERFACES_INSTALL_DIR "@KDE4_DBUS_INTERFACES_INSTALL_DIR@")
|
||||
set(KDE4_DBUS_SERVICES_INSTALL_DIR "@KDE4_DBUS_SERVICES_INSTALL_DIR@")
|
||||
set(KDE4_DBUS_SYSTEM_SERVICES_INSTALL_DIR "@KDE4_DBUS_SYSTEM_SERVICES_INSTALL_DIR@")
|
||||
set(KDE4_KAUTH_HELPER_PLUGIN_DIR "@KDE4_KAUTH_HELPER_PLUGIN_DIR@")
|
||||
set(KDE4_KAUTH_BACKEND_PLUGIN_DIR "@KDE4_KAUTH_BACKEND_PLUGIN_DIR@")
|
||||
|
|
|
@ -362,9 +362,6 @@ if(_kdeBootStrapping)
|
|||
set(KDE4_DBUS_INTERFACES_INSTALL_DIR "${KDE4_SHARE_INSTALL_PREFIX}/dbus-1/interfaces" CACHE PATH "KDE D-Bus interfaces installation directory")
|
||||
set(KDE4_DBUS_SERVICES_INSTALL_DIR "${KDE4_SHARE_INSTALL_PREFIX}/dbus-1/services" CACHE PATH "KDE D-Bus services installation directory")
|
||||
set(KDE4_DBUS_SYSTEM_SERVICES_INSTALL_DIR "${KDE4_SHARE_INSTALL_PREFIX}/dbus-1/system-services" CACHE PATH "KDE D-Bus system services installation directory")
|
||||
|
||||
set(KDE4_KAUTH_HELPER_PLUGIN_DIR "${KDE4_PLUGIN_INSTALL_DIR}/kde4/plugins/kauth/helper" CACHE PATH "KDE authorization helper installation directory")
|
||||
set(KDE4_KAUTH_BACKEND_PLUGIN_DIR "${KDE4_PLUGIN_INSTALL_DIR}/kde4/plugins/kauth/backend" CACHE PATH "KDE authorization backend installation directory")
|
||||
endif()
|
||||
|
||||
# For more documentation see above.
|
||||
|
|
|
@ -28,15 +28,6 @@ configure_file(
|
|||
)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/compression)
|
||||
|
||||
# This file handles all the logic for compiling KAuth's backends
|
||||
include(auth/ConfigureChecks.cmake)
|
||||
|
||||
# Configure a small file to tell BackendsManager what to use
|
||||
configure_file(
|
||||
auth/BackendsConfig.h.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/BackendsConfig.h
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${KDE4_KDECORE_INCLUDES}
|
||||
${KDE4_KDEUI_INCLUDES}
|
||||
|
@ -95,6 +86,12 @@ if(ENABLE_TESTING)
|
|||
add_subdirectory(sonnet/tests)
|
||||
endif()
|
||||
|
||||
qt4_add_dbus_adaptor(kauth_dbus_adaptor_SRCS
|
||||
auth/backends/dbus/org.kde.auth.xml
|
||||
auth/backends/dbus/DBusHelperProxy.h
|
||||
KAuth::DBusHelperProxy
|
||||
)
|
||||
|
||||
########### next target ###############
|
||||
|
||||
set(kdecore_LIB_SRCS
|
||||
|
@ -235,8 +232,10 @@ set(kdecore_LIB_SRCS
|
|||
util/kmacroexpander_unix.cpp
|
||||
|
||||
${kdecore_OPTIONAL_SRCS}
|
||||
${KAUTH_BACKEND_SRCS}
|
||||
${KAUTH_HELPER_BACKEND_SRCS}
|
||||
auth/backends/dbus/DBusBackend.cpp
|
||||
auth/backends/dbus/DBusBackend.h
|
||||
auth/backends/dbus/DBusHelperProxy.cpp
|
||||
${kauth_dbus_adaptor_SRCS}
|
||||
)
|
||||
|
||||
if(NOT Q_WS_X11 AND NOT Q_WS_QWS)
|
||||
|
@ -271,33 +270,6 @@ install(
|
|||
|
||||
########### next target ###############
|
||||
|
||||
# KAuth backend plugin
|
||||
|
||||
set(KAUTH_BACKEND_SRCS ${KAUTH_BACKEND_SRCS} auth/AuthBackend.cpp)
|
||||
kde4_add_plugin(kauth_backend_plugin ${KAUTH_BACKEND_SRCS})
|
||||
target_link_libraries(kauth_backend_plugin ${KAUTH_BACKEND_LIBS})
|
||||
install(
|
||||
TARGETS kauth_backend_plugin
|
||||
LIBRARY DESTINATION ${KDE4_KAUTH_BACKEND_PLUGIN_DIR}
|
||||
ARCHIVE DESTINATION ${KDE4_KAUTH_BACKEND_PLUGIN_DIR}
|
||||
RUNTIME DESTINATION ${KDE4_KAUTH_BACKEND_PLUGIN_DIR}
|
||||
)
|
||||
|
||||
########### next target ###############
|
||||
|
||||
# KAuth helper plugin
|
||||
|
||||
kde4_add_plugin(kauth_helper_plugin ${KAUTH_HELPER_BACKEND_SRCS} auth/HelperProxy.cpp)
|
||||
target_link_libraries(kauth_helper_plugin ${KAUTH_HELPER_BACKEND_LIBS})
|
||||
install(
|
||||
TARGETS kauth_helper_plugin
|
||||
LIBRARY DESTINATION ${KDE4_KAUTH_HELPER_PLUGIN_DIR}
|
||||
ARCHIVE DESTINATION ${KDE4_KAUTH_HELPER_PLUGIN_DIR}
|
||||
RUNTIME DESTINATION ${KDE4_KAUTH_HELPER_PLUGIN_DIR}
|
||||
)
|
||||
|
||||
########### next target ###############
|
||||
|
||||
configure_file(
|
||||
localization/all_languages.desktop
|
||||
${CMAKE_CURRENT_BINARY_DIR}/all_languages
|
||||
|
@ -441,3 +413,17 @@ install(
|
|||
kde4_usb.ids
|
||||
DESTINATION ${KDE4_DATA_INSTALL_DIR}/kdevicedatabase
|
||||
)
|
||||
|
||||
install(
|
||||
FILES
|
||||
auth/backends/dbus/org.kde.auth.conf
|
||||
DESTINATION ${KDE4_SYSCONF_INSTALL_DIR}/dbus-1/system.d
|
||||
)
|
||||
|
||||
install(
|
||||
FILES
|
||||
auth/backends/dbus/dbus_policy.stub
|
||||
auth/backends/dbus/dbus_service.stub
|
||||
DESTINATION ${KDE4_DATA_INSTALL_DIR}/kauth
|
||||
COMPONENT Devel
|
||||
)
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
#cmakedefine KAUTH_COMPILING_DBUS_BACKEND 1
|
||||
#cmakedefine KAUTH_COMPILING_DBUS_HELPER_BACKEND 1
|
||||
#define KAUTH_BACKEND_PLUGIN_DIR "${KDE4_KAUTH_BACKEND_PLUGIN_DIR}"
|
||||
#define KAUTH_HELPER_PLUGIN_DIR "${KDE4_KAUTH_HELPER_PLUGIN_DIR}"
|
||||
#define KAUTH_OTHER_PLUGIN_DIR "${KAUTH_OTHER_PLUGIN_DIR}"
|
|
@ -19,15 +19,10 @@
|
|||
|
||||
#include "BackendsManager.h"
|
||||
|
||||
#include "BackendsConfig.h"
|
||||
|
||||
// Include dbus backends
|
||||
#include "backends/dbus/DBusBackend.h"
|
||||
#include "backends/dbus/DBusHelperProxy.h"
|
||||
|
||||
#include <QPluginLoader>
|
||||
#include <QDir>
|
||||
|
||||
#include <kdebug.h>
|
||||
|
||||
namespace KAuth
|
||||
|
@ -40,69 +35,14 @@ BackendsManager::BackendsManager()
|
|||
{
|
||||
}
|
||||
|
||||
QList< QObject* > BackendsManager::retrieveInstancesIn(const QString& path)
|
||||
{
|
||||
QDir pluginPath(path);
|
||||
|
||||
if (!pluginPath.exists()) {
|
||||
return QList< QObject* >();
|
||||
}
|
||||
|
||||
const QFileInfoList entryList = pluginPath.entryInfoList(QDir::NoDotAndDotDot | QDir::Files);
|
||||
|
||||
if (entryList.isEmpty()) {
|
||||
return QList< QObject* >();
|
||||
}
|
||||
|
||||
QList< QObject* > retlist;
|
||||
|
||||
foreach(const QFileInfo &fi, entryList) {
|
||||
QString filePath = fi.filePath(); // file name with path
|
||||
QString fileName = fi.fileName(); // just file name
|
||||
|
||||
if(!QLibrary::isLibrary(filePath)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
QString errstr;
|
||||
QPluginLoader loader(filePath);
|
||||
QObject *instance = loader.instance();
|
||||
if (instance) {
|
||||
retlist.append(instance);
|
||||
}
|
||||
}
|
||||
|
||||
return retlist;
|
||||
}
|
||||
|
||||
void BackendsManager::init()
|
||||
{
|
||||
// Backend plugin
|
||||
const QList< QObject* > backends = retrieveInstancesIn(QFile::decodeName(KAUTH_BACKEND_PLUGIN_DIR));
|
||||
|
||||
foreach (QObject *instance, backends) {
|
||||
auth = qobject_cast< KAuth::AuthBackend* >(instance);
|
||||
if (auth) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Helper plugin
|
||||
const QList< QObject* > helpers = retrieveInstancesIn(QFile::decodeName(KAUTH_HELPER_PLUGIN_DIR));
|
||||
|
||||
foreach (QObject *instance, helpers) {
|
||||
helper = qobject_cast< KAuth::HelperProxy* >(instance);
|
||||
if (helper) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!auth) {
|
||||
auth = new DBusBackend;
|
||||
auth = new DBusBackend();
|
||||
}
|
||||
|
||||
if (!helper) {
|
||||
helper = new DBusHelperProxy;
|
||||
helper = new DBusHelperProxy();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ public:
|
|||
|
||||
private:
|
||||
static void init();
|
||||
static QList<QObject*> retrieveInstancesIn(const QString &path);
|
||||
};
|
||||
|
||||
} // namespace Auth
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
########################
|
||||
# Helper backend probing
|
||||
|
||||
# not much of a choice really
|
||||
set(KAUTH_BACKEND "DBus")
|
||||
|
||||
# Add the correct libraries/files depending on the backend
|
||||
if(KAUTH_BACKEND STREQUAL "DBus")
|
||||
set(KAUTH_COMPILING_DBUS_HELPER_BACKEND TRUE)
|
||||
set(KDE4_AUTH_HELPER_BACKEND_NAME "DBUS")
|
||||
set(KDE4_AUTH_BACKEND_NAME "DBUS")
|
||||
set(KAUTH_BACKEND_SRCS
|
||||
auth/backends/dbus/DBusBackend.cpp
|
||||
auth/backends/dbus/DBusBackend.h
|
||||
)
|
||||
set(KAUTH_BACKEND_LIBS ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY})
|
||||
|
||||
qt4_add_dbus_adaptor(kauth_dbus_adaptor_SRCS
|
||||
auth/backends/dbus/org.kde.auth.xml
|
||||
auth/backends/dbus/DBusHelperProxy.h
|
||||
KAuth::DBusHelperProxy
|
||||
)
|
||||
|
||||
set(KAUTH_HELPER_BACKEND_SRCS
|
||||
auth/backends/dbus/DBusHelperProxy.cpp
|
||||
${kauth_dbus_adaptor_SRCS}
|
||||
)
|
||||
set(KAUTH_HELPER_BACKEND_LIBS kdecore)
|
||||
|
||||
# Install some files as well
|
||||
install(
|
||||
FILES
|
||||
auth/backends/dbus/org.kde.auth.conf
|
||||
DESTINATION ${KDE4_SYSCONF_INSTALL_DIR}/dbus-1/system.d
|
||||
)
|
||||
|
||||
install(
|
||||
FILES
|
||||
auth/backends/dbus/dbus_policy.stub
|
||||
auth/backends/dbus/dbus_service.stub
|
||||
DESTINATION ${KDE4_DATA_INSTALL_DIR}/kauth
|
||||
COMPONENT Devel
|
||||
)
|
||||
endif()
|
Loading…
Add table
Reference in a new issue