Merge lp:~fboucault/unity-2d/remove_unused_dash_dbus_props into lp:~unity-2d-team/unity-2d/unity-2d-shell

Proposed by Florian Boucault
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 993
Merged at revision: 999
Proposed branch: lp:~fboucault/unity-2d/remove_unused_dash_dbus_props
Merge into: lp:~unity-2d-team/unity-2d/unity-2d-shell
Diff against target: 131 lines (+0/-69)
2 files modified
libunity-2d-private/src/dashclient.cpp (+0/-56)
libunity-2d-private/src/dashclient.h (+0/-13)
To merge this branch: bzr merge lp:~fboucault/unity-2d/remove_unused_dash_dbus_props
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
Review via email: mp+92189@code.launchpad.net

Description of the change

Removed DashClient.activePage() getter, setActivePage() setter and activePageChanged signal

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :

Isn't this a bit too much aggressive? The fact that we don't use them doesn't mean that they don't make sense. Having the possibility of setting the lens via dbus is nice if you want to do a script that does some stuff for example

Revision history for this message
Florian Boucault (fboucault) wrote :

You may be right. I am unsure.
For DashClient though, I'd rather get rid of it.

Revision history for this message
Albert Astals Cid (aacid) wrote :

I'm fine removing the stuff from DashClient, but the dbus API i'd like to keep.

I like to think of dbus api as public library API since basically it's there for all to use, removing or changing it without reason is just hurting people that might be using them.

993. By Florian Boucault

Reverted removal of dash's D-Bus properties, methods and signals.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Ok, remove dead code

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libunity-2d-private/src/dashclient.cpp'
--- libunity-2d-private/src/dashclient.cpp 2012-02-07 16:48:45 +0000
+++ libunity-2d-private/src/dashclient.cpp 2012-02-09 11:10:58 +0000
@@ -87,8 +87,6 @@
87 QDBusConnection::sessionBus(), this);87 QDBusConnection::sessionBus(), this);
88 connect(m_dashDbusIface, SIGNAL(activeChanged(bool)),88 connect(m_dashDbusIface, SIGNAL(activeChanged(bool)),
89 SLOT(slotDashActiveChanged(bool)));89 SLOT(slotDashActiveChanged(bool)));
90 connect(m_dashDbusIface, SIGNAL(activeLensChanged(const QString&)),
91 SLOT(slotDashActiveLensChanged(const QString&)));
9290
93 QVariant value = m_dashDbusIface->property("active");91 QVariant value = m_dashDbusIface->property("active");
94 if (value.isValid()) {92 if (value.isValid()) {
@@ -96,14 +94,6 @@
96 } else {94 } else {
97 UQ_WARNING << "Fetching Dash.active property failed";95 UQ_WARNING << "Fetching Dash.active property failed";
98 }96 }
99 value = m_dashDbusIface->property("activeLens");
100 if (value.isValid()) {
101 m_dashActiveLens = value.toString();
102 } else {
103 UQ_WARNING << "Fetching Dash.activeLens property failed";
104 }
105
106 updateActivePage();
107}97}
10898
109DashClient* DashClient::instance()99DashClient* DashClient::instance()
@@ -116,19 +106,10 @@
116{106{
117 if (m_dashActive != value) {107 if (m_dashActive != value) {
118 m_dashActive = value;108 m_dashActive = value;
119 updateActivePage();
120 }109 }
121 Q_EMIT activeChanged(value);110 Q_EMIT activeChanged(value);
122}111}
123112
124void DashClient::slotDashActiveLensChanged(const QString& lens)
125{
126 if (m_dashActiveLens != lens) {
127 m_dashActiveLens = lens;
128 updateActivePage();
129 }
130}
131
132bool DashClient::active() const113bool DashClient::active() const
133{114{
134 return m_dashActive;115 return m_dashActive;
@@ -147,43 +128,6 @@
147 }128 }
148}129}
149130
150QString DashClient::activePage() const
151{
152 return m_activePage;
153}
154
155void DashClient::setActivePage(const QString& page, const QString& lensId)
156{
157 if (m_activePage == page) {
158 return;
159 }
160 if (page.isEmpty()) {
161 setActive(false);
162 return;
163 }
164 // Use a separate QDBusInterface so that the dash is started if it is not
165 // already running
166 QDBusInterface iface(DASH_DBUS_SERVICE, DASH_DBUS_PATH, DASH_DBUS_INTERFACE);
167 if (page == "home") {
168 iface.asyncCall("activateHome");
169 } else {
170 iface.asyncCall("activateLens", lensId);
171 }
172}
173
174void DashClient::updateActivePage()
175{
176 QString activePage;
177 if (m_dashActive) {
178 activePage = m_dashActiveLens.isEmpty() ? "home" : m_dashActiveLens;
179 }
180
181 if (m_activePage != activePage) {
182 m_activePage = activePage;
183 activePageChanged(m_activePage);
184 }
185}
186
187QSize DashClient::minimumSizeForDesktop()131QSize DashClient::minimumSizeForDesktop()
188{132{
189 return QSize(DASH_MIN_SCREEN_WIDTH, DASH_MIN_SCREEN_HEIGHT);133 return QSize(DASH_MIN_SCREEN_WIDTH, DASH_MIN_SCREEN_HEIGHT);
190134
=== modified file 'libunity-2d-private/src/dashclient.h'
--- libunity-2d-private/src/dashclient.h 2012-02-07 16:48:45 +0000
+++ libunity-2d-private/src/dashclient.h 2012-02-09 11:10:58 +0000
@@ -44,36 +44,23 @@
44 bool active() const;44 bool active() const;
45 void setActive(bool active);45 void setActive(bool active);
4646
47 /**
48 * Returns the active page. This is either:
49 * - The lens id of the active lens
50 * - "home" if the home is visible
51 * - "" if the dash is not visible
52 */
53 QString activePage() const;
54 bool alwaysFullScreen() const;47 bool alwaysFullScreen() const;
55 void setActivePage(const QString& page, const QString& lensId=QString());
56 static QSize minimumSizeForDesktop();48 static QSize minimumSizeForDesktop();
5749
58Q_SIGNALS:50Q_SIGNALS:
59 void activeChanged(bool);51 void activeChanged(bool);
60 void activePageChanged(const QString&);
61 void alwaysFullScreenChanged();52 void alwaysFullScreenChanged();
6253
63private Q_SLOTS:54private Q_SLOTS:
64 void connectToDash();55 void connectToDash();
65 void slotDashActiveChanged(bool);56 void slotDashActiveChanged(bool);
66 void slotDashActiveLensChanged(const QString&);
67 void updateAlwaysFullScreen();57 void updateAlwaysFullScreen();
6858
69private:59private:
70 DashClient(QObject* parent = 0);60 DashClient(QObject* parent = 0);
71 void updateActivePage();
7261
73 QDBusInterface* m_dashDbusIface;62 QDBusInterface* m_dashDbusIface;
74 bool m_dashActive;63 bool m_dashActive;
75 QString m_dashActiveLens;
76 QString m_activePage;
77 bool m_alwaysFullScreen;64 bool m_alwaysFullScreen;
78};65};
7966

Subscribers

People subscribed via source and target branches