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
1=== modified file 'libunity-2d-private/src/dashclient.cpp'
2--- libunity-2d-private/src/dashclient.cpp 2012-02-07 16:48:45 +0000
3+++ libunity-2d-private/src/dashclient.cpp 2012-02-09 11:10:58 +0000
4@@ -87,8 +87,6 @@
5 QDBusConnection::sessionBus(), this);
6 connect(m_dashDbusIface, SIGNAL(activeChanged(bool)),
7 SLOT(slotDashActiveChanged(bool)));
8- connect(m_dashDbusIface, SIGNAL(activeLensChanged(const QString&)),
9- SLOT(slotDashActiveLensChanged(const QString&)));
10
11 QVariant value = m_dashDbusIface->property("active");
12 if (value.isValid()) {
13@@ -96,14 +94,6 @@
14 } else {
15 UQ_WARNING << "Fetching Dash.active property failed";
16 }
17- value = m_dashDbusIface->property("activeLens");
18- if (value.isValid()) {
19- m_dashActiveLens = value.toString();
20- } else {
21- UQ_WARNING << "Fetching Dash.activeLens property failed";
22- }
23-
24- updateActivePage();
25 }
26
27 DashClient* DashClient::instance()
28@@ -116,19 +106,10 @@
29 {
30 if (m_dashActive != value) {
31 m_dashActive = value;
32- updateActivePage();
33 }
34 Q_EMIT activeChanged(value);
35 }
36
37-void DashClient::slotDashActiveLensChanged(const QString& lens)
38-{
39- if (m_dashActiveLens != lens) {
40- m_dashActiveLens = lens;
41- updateActivePage();
42- }
43-}
44-
45 bool DashClient::active() const
46 {
47 return m_dashActive;
48@@ -147,43 +128,6 @@
49 }
50 }
51
52-QString DashClient::activePage() const
53-{
54- return m_activePage;
55-}
56-
57-void DashClient::setActivePage(const QString& page, const QString& lensId)
58-{
59- if (m_activePage == page) {
60- return;
61- }
62- if (page.isEmpty()) {
63- setActive(false);
64- return;
65- }
66- // Use a separate QDBusInterface so that the dash is started if it is not
67- // already running
68- QDBusInterface iface(DASH_DBUS_SERVICE, DASH_DBUS_PATH, DASH_DBUS_INTERFACE);
69- if (page == "home") {
70- iface.asyncCall("activateHome");
71- } else {
72- iface.asyncCall("activateLens", lensId);
73- }
74-}
75-
76-void DashClient::updateActivePage()
77-{
78- QString activePage;
79- if (m_dashActive) {
80- activePage = m_dashActiveLens.isEmpty() ? "home" : m_dashActiveLens;
81- }
82-
83- if (m_activePage != activePage) {
84- m_activePage = activePage;
85- activePageChanged(m_activePage);
86- }
87-}
88-
89 QSize DashClient::minimumSizeForDesktop()
90 {
91 return QSize(DASH_MIN_SCREEN_WIDTH, DASH_MIN_SCREEN_HEIGHT);
92
93=== modified file 'libunity-2d-private/src/dashclient.h'
94--- libunity-2d-private/src/dashclient.h 2012-02-07 16:48:45 +0000
95+++ libunity-2d-private/src/dashclient.h 2012-02-09 11:10:58 +0000
96@@ -44,36 +44,23 @@
97 bool active() const;
98 void setActive(bool active);
99
100- /**
101- * Returns the active page. This is either:
102- * - The lens id of the active lens
103- * - "home" if the home is visible
104- * - "" if the dash is not visible
105- */
106- QString activePage() const;
107 bool alwaysFullScreen() const;
108- void setActivePage(const QString& page, const QString& lensId=QString());
109 static QSize minimumSizeForDesktop();
110
111 Q_SIGNALS:
112 void activeChanged(bool);
113- void activePageChanged(const QString&);
114 void alwaysFullScreenChanged();
115
116 private Q_SLOTS:
117 void connectToDash();
118 void slotDashActiveChanged(bool);
119- void slotDashActiveLensChanged(const QString&);
120 void updateAlwaysFullScreen();
121
122 private:
123 DashClient(QObject* parent = 0);
124- void updateActivePage();
125
126 QDBusInterface* m_dashDbusIface;
127 bool m_dashActive;
128- QString m_dashActiveLens;
129- QString m_activePage;
130 bool m_alwaysFullScreen;
131 };
132

Subscribers

People subscribed via source and target branches