From 838bc4c757c91dcd50b3efeb18812e6ae3f3e8d8 Mon Sep 17 00:00:00 2001 From: Yuri Kozyrev Date: Wed, 13 Jul 2022 20:07:19 +0400 Subject: [PATCH] now for real --- CMakeLists.txt.user | 6 +++--- alterator/alteratorlibConfig.h.in | 5 +++++ alterator/src/dbus_connector.cpp | 11 ++++++++--- 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 alterator/alteratorlibConfig.h.in diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user index 7a74f8d..b45e7ef 100644 --- a/CMakeLists.txt.user +++ b/CMakeLists.txt.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -92,7 +92,7 @@ Desktop Desktop {0d1d96e7-0317-4f7a-a513-68284676b112} - 1 + 0 0 0 @@ -218,7 +218,7 @@ true false true - /home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/release + /home/SMB.BASEALT.RU/kozyrevid/work/new_alterator/build 1 diff --git a/alterator/alteratorlibConfig.h.in b/alterator/alteratorlibConfig.h.in new file mode 100644 index 0000000..dac9f3e --- /dev/null +++ b/alterator/alteratorlibConfig.h.in @@ -0,0 +1,5 @@ +#ifndef ALTERATORLIB_VERSION_H_ +#define ALTERATORLIB_VERSION_H_ +#define ALTERATORLIB_VERSION "${PROJECT_VERSION}" +#endif /*LIBNSS_ROLE_VERSION_H_*/ + diff --git a/alterator/src/dbus_connector.cpp b/alterator/src/dbus_connector.cpp index ec78e01..fad6a7c 100644 --- a/alterator/src/dbus_connector.cpp +++ b/alterator/src/dbus_connector.cpp @@ -12,8 +12,12 @@ DBusConnector::DBusConnector(QObject *parent): QObject(parent) "org.freedesktop.hostname1", false, "hostname"); } -void DBusConnector::addInterface(QString service, QString path, QString interface, bool isSessionBus, QString shortName){ - QDBusInterface *iface = new QDBusInterface(service, path, interface, isSessionBus ? QDBusConnection::sessionBus() : QDBusConnection::systemBus(), this); +void DBusConnector::addInterface(QString service, QString path, QString interface + , bool isSessionBus, QString shortName){ + QDBusInterface *iface = + new QDBusInterface(service, path, interface, isSessionBus + ? QDBusConnection::sessionBus() + : QDBusConnection::systemBus(), this); interfaces.insert(shortName, iface); } @@ -32,7 +36,8 @@ QVariant DBusConnector::getProperty(QString interfaceName, QString propertyName) } } -bool DBusConnector::setProperty(QString interfaceName, QString propertyName, QVariant value){ +bool DBusConnector::setProperty(QString interfaceName, QString propertyName + , QVariant value){ try{ if (interfaces.contains(interfaceName)){ return interfaces[interfaceName]->setProperty(propertyName.toLocal8Bit().constData(), value);