ALT Linux Bugzilla
– Attachment 17769 Details for
Bug 53137
Миграция waked на sdbus-2.0
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
патч
waked_sdbus2.patch (text/plain), 2.33 KB, created by
Egor Shestakov
on 2025-02-18 15:01:03 MSK
(
hide
)
Description:
патч
Filename:
MIME Type:
Creator:
Egor Shestakov
Created:
2025-02-18 15:01:03 MSK
Size:
2.33 KB
patch
obsolete
>diff --git a/src/main.cpp b/src/main.cpp >index f781fff..5a70680 100644 >--- a/src/main.cpp >+++ b/src/main.cpp >@@ -26,8 +26,8 @@ with this program; if not, write to the Free Software Foundation, Inc., > > #include "alarm.h" > >-const char* inhibitorDestinationName = "org.freedesktop.login1"; >-const char* inhibitorObjectPath = "/org/freedesktop/login1"; >+auto inhibitorDestinationName = sdbus::ServiceName{"org.freedesktop.login1"}; >+auto inhibitorObjectPath = sdbus::ObjectPath{"/org/freedesktop/login1"}; > const char* inhibitorInterfaceName = "org.freedesktop.login1.Manager"; > std::unique_ptr inhibitorProxy = sdbus::createProxy(inhibitorDestinationName, inhibitorObjectPath); > std::list<Alarm> alarmList; >@@ -136,21 +136,19 @@ void handleSuspend(const bool active) { > int main(int argc, char *argv[]) > { > // Create D-Bus connection to the system bus and requests name on it. >- const char* serviceName = "de.seath.Waked"; >+ auto serviceName = sdbus::ServiceName{"de.seath.Waked"}; > auto connection = sdbus::createSystemBusConnection(serviceName); > >- const char* wakedObjectPath = "/de/seath/Waked/Alarm"; >+ auto wakedObjectPath = sdbus::ObjectPath{"/de/seath/Waked/Alarm"}; > auto wakedDbusObject = sdbus::createObject(*connection, wakedObjectPath); > > > const char* wakedInterfaceName = "de.seath.Waked"; >- wakedDbusObject->registerMethod("Add").onInterface(wakedInterfaceName).implementedAs(®isterAlarm); >- wakedDbusObject->registerMethod("Update").onInterface(wakedInterfaceName).implementedAs(&updateAlarm); >- wakedDbusObject->registerMethod("Remove").onInterface(wakedInterfaceName).implementedAs(&removeAlarm); >- wakedDbusObject->finishRegistration(); >- >+ wakedDbusObject->addVTable( >+ sdbus::registerMethod("Add").implementedAs(®isterAlarm), >+ sdbus::registerMethod("Update").implementedAs(&updateAlarm), >+ sdbus::registerMethod("Remove").implementedAs(&removeAlarm)).forInterface(wakedInterfaceName); > inhibitorProxy->uponSignal("PrepareForSleep").onInterface(inhibitorInterfaceName).call(&handleSuspend); //[](const std::string& str){ onConcatenated(str); }); >- inhibitorProxy->finishRegistration(); > > inhibitorProxy->callMethod("Inhibit").onInterface(inhibitorInterfaceName).withArguments("sleep", "Waked", "Manage system wake-ups", "delay").storeResultsTo(suspendDelayLockFd); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 53137
: 17769