Merge lp:~3v1n0/unity/drop-show-menu-dbus into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 4017
Proposed branch: lp:~3v1n0/unity/drop-show-menu-dbus
Merge into: lp:unity
Diff against target: 173 lines (+1/-79)
4 files modified
UnityCore/DBusIndicators.cpp (+0/-15)
UnityCore/Indicators.cpp (+1/-4)
services/panel-main.c (+0/-29)
services/panel-service.c (+0/-31)
To merge this branch: bzr merge lp:~3v1n0/unity/drop-show-menu-dbus
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
Review via email: mp+273110@code.launchpad.net

Commit message

PanelService, DBusIndicators: drop support for EntryShowNowChanged signal

We do handle this internally inside unity since long time now, so there's no need
bother the bus for such thing.

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

Nice diff :D

Revision history for this message
Andrea Azzarone (azzar1) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'UnityCore/DBusIndicators.cpp'
2--- UnityCore/DBusIndicators.cpp 2015-02-09 19:36:04 +0000
3+++ UnityCore/DBusIndicators.cpp 2015-10-01 17:18:55 +0000
4@@ -74,7 +74,6 @@
5 void OnIconsPathChanged(GVariant* parameters);
6 void OnEntryActivated(GVariant* parameters);
7 void OnEntryActivatedRequest(GVariant* parameters);
8- void OnEntryShowNowChanged(GVariant* parameters);
9
10 void OnEntryScroll(std::string const& entry_id, int delta);
11 void OnEntryShowMenu(std::string const& entry_id, unsigned int xid, int x, int y, unsigned int button);
12@@ -102,7 +101,6 @@
13 gproxy_.Connect("IconPathsChanged", sigc::mem_fun(this, &DBusIndicators::Impl::OnIconsPathChanged));
14 gproxy_.Connect("EntryActivated", sigc::mem_fun(this, &DBusIndicators::Impl::OnEntryActivated));
15 gproxy_.Connect("EntryActivateRequest", sigc::mem_fun(this, &DBusIndicators::Impl::OnEntryActivatedRequest));
16- gproxy_.Connect("EntryShowNowChanged", sigc::mem_fun(this, &DBusIndicators::Impl::OnEntryShowNowChanged));
17
18 gproxy_.connected.connect(sigc::mem_fun(this, &DBusIndicators::Impl::OnConnected));
19 gproxy_.disconnected.connect(sigc::mem_fun(this, &DBusIndicators::Impl::OnDisconnected));
20@@ -242,19 +240,6 @@
21 owner_->on_entry_activate_request.emit(entry_name);
22 }
23
24-void DBusIndicators::Impl::OnEntryShowNowChanged(GVariant* parameters)
25-{
26- if (!verify_variant_type(parameters, "(sb)"))
27- return;
28-
29- glib::String entry_name;
30- gboolean show_now;
31- g_variant_get(parameters, "(sb)", &entry_name, &show_now);
32-
33- if (entry_name)
34- owner_->SetEntryShowNow(entry_name, show_now);
35-}
36-
37 void DBusIndicators::Impl::RequestSyncAll()
38 {
39 gproxy_.CallBegin("Sync", nullptr, sigc::mem_fun(this, &DBusIndicators::Impl::Sync));
40
41=== modified file 'UnityCore/Indicators.cpp'
42--- UnityCore/Indicators.cpp 2015-06-05 14:27:09 +0000
43+++ UnityCore/Indicators.cpp 2015-10-01 17:18:55 +0000
44@@ -121,11 +121,8 @@
45 void Indicators::Impl::SetEntryShowNow(std::string const& entry_id,
46 bool show_now)
47 {
48- Entry::Ptr entry = GetEntry(entry_id);
49- if (entry)
50- {
51+ if (Entry::Ptr const& entry = GetEntry(entry_id))
52 entry->set_show_now(show_now);
53- }
54 }
55
56 Indicators::IndicatorsList Indicators::Impl::GetIndicators() const
57
58=== modified file 'services/panel-main.c'
59--- services/panel-main.c 2015-01-29 15:39:13 +0000
60+++ services/panel-main.c 2015-10-01 17:18:55 +0000
61@@ -101,11 +101,6 @@
62 " <arg type='s' name='entry_id' />"
63 " </signal>"
64 ""
65- " <signal name='EntryShowNowChanged'>"
66- " <arg type='s' name='entry_id' />"
67- " <arg type='b' name='show_now_state' />"
68- " </signal>"
69- ""
70 " <signal name='IconPathsChanged' />"
71 ""
72 " </interface>"
73@@ -330,28 +325,6 @@
74 }
75
76 static void
77-on_service_entry_show_now_changed (PanelService *service,
78- const gchar *entry_id,
79- gboolean show_now_state,
80- GDBusConnection *connection)
81-{
82- GError *error = NULL;
83- g_dbus_connection_emit_signal (connection,
84- NULL,
85- UPS_PATH,
86- UPS_IFACE,
87- "EntryShowNowChanged",
88- g_variant_new ("(sb)", entry_id, show_now_state),
89- &error);
90-
91- if (error)
92- {
93- g_warning ("Unable to emit EntryShowNowChanged signal: %s", error->message);
94- g_error_free (error);
95- }
96-}
97-
98-static void
99 on_icon_theme_changed (GtkIconTheme* theme, GDBusConnection *connection)
100 {
101 GError *error = NULL;
102@@ -391,8 +364,6 @@
103 G_CALLBACK (on_service_entry_activated), connection);
104 g_signal_connect (service, "entry-activate-request",
105 G_CALLBACK (on_service_entry_activate_request), connection);
106- g_signal_connect (service, "entry-show-now-changed",
107- G_CALLBACK (on_service_entry_show_now_changed), connection);
108
109 g_signal_connect (gtk_icon_theme_get_default(), "changed",
110 G_CALLBACK (on_icon_theme_changed), connection);
111
112=== modified file 'services/panel-service.c'
113--- services/panel-service.c 2015-01-30 10:50:32 +0000
114+++ services/panel-service.c 2015-10-01 17:18:55 +0000
115@@ -98,7 +98,6 @@
116 ENTRY_ACTIVATED = 0,
117 RE_SYNC,
118 ENTRY_ACTIVATE_REQUEST,
119- ENTRY_SHOW_NOW_CHANGED,
120 GEOMETRIES_CHANGED,
121 INDICATORS_CLEARED,
122
123@@ -250,14 +249,6 @@
124 G_TYPE_OBJECT, G_TYPE_POINTER,
125 G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
126
127- _service_signals[ENTRY_SHOW_NOW_CHANGED] =
128- g_signal_new ("entry-show-now-changed",
129- G_OBJECT_CLASS_TYPE (obj_class),
130- G_SIGNAL_RUN_LAST,
131- 0,
132- NULL, NULL, NULL,
133- G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_BOOLEAN);
134-
135 _service_signals[INDICATORS_CLEARED] =
136 g_signal_new ("indicators-cleared",
137 G_OBJECT_CLASS_TYPE (obj_class),
138@@ -1371,26 +1362,6 @@
139 g_free (entry_id);
140 }
141
142-static void
143-on_indicator_menu_show_now_changed (IndicatorObject *object,
144- IndicatorObjectEntry *entry,
145- gboolean show_now_changed,
146- PanelService *self)
147-{
148- gchar *entry_id;
149- g_return_if_fail (PANEL_IS_SERVICE (self));
150-
151- if (!entry)
152- {
153- g_warning ("%s called with a NULL entry", G_STRFUNC);
154- return;
155- }
156-
157- entry_id = get_indicator_entry_id_by_entry (entry);
158- g_signal_emit (self, _service_signals[ENTRY_SHOW_NOW_CHANGED], 0, entry_id, show_now_changed);
159- g_free (entry_id);
160-}
161-
162 static const gchar * indicator_environment[] = {
163 "unity",
164 "unity-3d",
165@@ -1428,8 +1399,6 @@
166 G_CALLBACK (on_entry_moved), self);
167 g_signal_connect (object, INDICATOR_OBJECT_SIGNAL_MENU_SHOW,
168 G_CALLBACK (on_indicator_menu_show), self);
169- g_signal_connect (object, INDICATOR_OBJECT_SIGNAL_SHOW_NOW_CHANGED,
170- G_CALLBACK (on_indicator_menu_show_now_changed), self);
171
172 entries = indicator_object_get_entries (object);
173 for (entry = entries; entry != NULL; entry = entry->next)