Merge lp:~mandel/ubuntu-download-manager/remove-dbusconn-pimpl into lp:ubuntu-download-manager

Proposed by Manuel de la Peña
Status: Merged
Approved by: Manuel de la Peña
Approved revision: 172
Merged at revision: 175
Proposed branch: lp:~mandel/ubuntu-download-manager/remove-dbusconn-pimpl
Merge into: lp:ubuntu-download-manager
Diff against target: 116 lines (+10/-59)
2 files modified
libubuntudownloadmanager/system/dbus_connection.cpp (+9/-56)
libubuntudownloadmanager/system/dbus_connection.h (+1/-3)
To merge this branch: bzr merge lp:~mandel/ubuntu-download-manager/remove-dbusconn-pimpl
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Diego Sarmentero (community) Approve
Review via email: mp+195135@code.launchpad.net

Commit message

Remove the not needed pimpl pattern from the DBusConnection class.

Description of the change

Remove the not needed pimpl pattern from the DBusConnection class.

To post a comment you must log in.
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libubuntudownloadmanager/system/dbus_connection.cpp'
2--- libubuntudownloadmanager/system/dbus_connection.cpp 2013-10-29 13:42:44 +0000
3+++ libubuntudownloadmanager/system/dbus_connection.cpp 2013-11-13 20:44:29 +0000
4@@ -24,79 +24,32 @@
5
6 namespace System {
7
8-/*
9- * PRIVATE IMPLEMENTATION
10- */
11-
12-
13-class DBusConnectionPrivate {
14- Q_DECLARE_PUBLIC(DBusConnection)
15- public:
16- DBusConnectionPrivate(DBusConnection* parent)
17- : _conn(QDBusConnection::connectToBus(QDBusConnection::ActivationBus, "DBUS")),
18- q_ptr(parent) {
19- }
20-
21- bool registerService(const QString& serviceName) {
22- return _conn.registerService(serviceName);
23- }
24-
25- bool registerObject(const QString& path,
26- QObject* object,
27- QDBusConnection::RegisterOptions options =
28- QDBusConnection::ExportAdaptors) {
29- return _conn.registerObject(path, object, options);
30- }
31-
32- void unregisterObject(const QString& path,
33- QDBusConnection::UnregisterMode mode =
34- QDBusConnection::UnregisterNode) {
35- return _conn.unregisterObject(path, mode);
36- }
37-
38- QDBusConnection connection() {
39- return _conn;
40- }
41-
42- private:
43- QDBusConnection _conn;
44- DBusConnection* q_ptr;
45-};
46-
47-/*
48- * PUBLIC IMPLEMENTATION
49- */
50-
51-DBusConnection::DBusConnection(QObject *parent)
52+DBusConnection::DBusConnection(QObject* parent)
53 : QObject(parent),
54- d_ptr(new DBusConnectionPrivate(this)) {
55+ _conn(QDBusConnection::connectToBus(QDBusConnection::ActivationBus, "DBUS")) {
56 }
57
58 bool
59 DBusConnection::registerService(const QString& serviceName) {
60- Q_D(DBusConnection);
61- return d->registerService(serviceName);
62+ return _conn.registerService(serviceName);
63 }
64
65 bool
66 DBusConnection::registerObject(const QString& path,
67- QObject* object,
68- QDBusConnection::RegisterOptions options) {
69- Q_D(DBusConnection);
70- return d->registerObject(path, object, options);
71+ QObject* object,
72+ QDBusConnection::RegisterOptions options) {
73+ return _conn.registerObject(path, object, options);
74 }
75
76 void
77 DBusConnection::unregisterObject(const QString& path,
78- QDBusConnection::UnregisterMode mode) {
79- Q_D(DBusConnection);
80- d->unregisterObject(path, mode);
81+ QDBusConnection::UnregisterMode mode) {
82+ return _conn.unregisterObject(path, mode);
83 }
84
85 QDBusConnection
86 DBusConnection::connection() {
87- Q_D(DBusConnection);
88- return d->connection();
89+ return _conn;
90 }
91
92 } // System
93
94=== modified file 'libubuntudownloadmanager/system/dbus_connection.h'
95--- libubuntudownloadmanager/system/dbus_connection.h 2013-10-29 13:42:44 +0000
96+++ libubuntudownloadmanager/system/dbus_connection.h 2013-11-13 20:44:29 +0000
97@@ -28,10 +28,8 @@
98
99 namespace System {
100
101-class DBusConnectionPrivate;
102 class DBusConnection : public QObject {
103 Q_OBJECT
104- Q_DECLARE_PRIVATE(DBusConnection)
105 public:
106 explicit DBusConnection(QObject *parent = 0);
107
108@@ -43,7 +41,7 @@
109 virtual QDBusConnection connection();
110
111 private:
112- DBusConnectionPrivate* d_ptr;
113+ QDBusConnection _conn;
114 };
115
116 } // System

Subscribers

People subscribed via source and target branches