hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From 294ce786cba67f23ddc90c8aec9f928fb15655fc Mon Sep 17 00:00:00 2001
From: Jinkun Hong <jinkun.hong@rock-chips.com>
Date: Fri, 19 Jun 2020 14:30:34 +0800
Subject: [PATCH] ObjectProxy add api
 
Signed-off-by: Jinkun Hong <jinkun.hong@rock-chips.com>
---
 include/dbus-c++/object.h |  2 ++
 src/object.cpp            | 12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 include/dbus-c++/object.h
 mode change 100644 => 100755 src/object.cpp
 
diff --git a/include/dbus-c++/object.h b/include/dbus-c++/object.h
old mode 100644
new mode 100755
index 3c68876..186b904
--- a/include/dbus-c++/object.h
+++ b/include/dbus-c++/object.h
@@ -204,6 +204,7 @@ class DXXAPI ObjectProxy : public Object, public virtual ProxyBase
 public:
 
   ObjectProxy(Connection &conn, const Path &path, const char *service = "");
+  ObjectProxy(int signal_en, Connection &conn, const Path &path, const char *service = "");
 
   ~ObjectProxy();
 
@@ -222,6 +223,7 @@ private:
 
 private:
 
+  int _signal_en;
   MessageSlot _filtered;
 };
 
diff --git a/src/object.cpp b/src/object.cpp
old mode 100644
new mode 100755
index 96e20ba..1c75674
--- a/src/object.cpp
+++ b/src/object.cpp
@@ -293,9 +293,19 @@ ObjectProxy::ObjectProxy(Connection &conn, const Path &path, const char *service
   register_obj();
 }
 
+ObjectProxy::ObjectProxy(int signal_en, Connection &conn, const Path &path, const char *service)
+  : Object(conn, path, service)
+{
+  _signal_en = signal_en;
+  if (_signal_en)
+      register_obj();
+}
+
+
 ObjectProxy::~ObjectProxy()
 {
-  unregister_obj(false);
+  if (_signal_en)
+    unregister_obj(false);
 }
 
 void ObjectProxy::register_obj()
-- 
2.7.4