Merge lp:~thumper/unity/no-lambda-for-bug-964897 into lp:unity

Proposed by Tim Penhey
Status: Merged
Approved by: Omer Akram
Approved revision: no longer in the source branch.
Merged at revision: 2614
Proposed branch: lp:~thumper/unity/no-lambda-for-bug-964897
Merge into: lp:unity
Diff against target: 77 lines (+25/-20)
2 files modified
launcher/HudLauncherIcon.cpp (+24/-20)
launcher/HudLauncherIcon.h (+1/-0)
To merge this branch: bzr merge lp:~thumper/unity/no-lambda-for-bug-964897
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
Review via email: mp+120895@code.launchpad.net

Commit message

Changed code to get a better, readable stack trace for bug 964897

Description of the change

I'm at a bit of a loss as to how this bug is raising itself.

The lambda doesn't help in tracking this down, so I've extracted the method in the hope that should this happen again, we'll get a better stack trace.

That is all.

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

LGTM.

review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

No commit message specified.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/HudLauncherIcon.cpp'
2--- launcher/HudLauncherIcon.cpp 2012-08-15 02:51:33 +0000
3+++ launcher/HudLauncherIcon.cpp 2012-08-23 01:08:21 +0000
4@@ -20,6 +20,7 @@
5 #include "HudLauncherIcon.h"
6 #include "Launcher.h"
7 #include "UnityCore/GLibWrapper.h"
8+#include "UnityCore/Variant.h"
9 #include <NuxCore/Logger.h>
10
11 #include "unity-shared/UBusMessages.h"
12@@ -50,30 +51,33 @@
13
14 background_color_ = nux::color::White;
15
16- ubus_manager_.RegisterInterest(UBUS_HUD_ICON_CHANGED, [&](GVariant *data)
17- {
18- std::string hud_icon_name;
19- const gchar* data_string = g_variant_get_string(data, NULL);
20- if (data_string)
21- hud_icon_name = data_string;
22- LOG_DEBUG(logger) << "Hud icon change: " << hud_icon_name;
23- if (hud_icon_name != icon_name)
24- {
25- if (hud_icon_name.empty())
26- icon_name = PKGDATADIR"/launcher_bfb.png";
27- else
28- icon_name = hud_icon_name;
29-
30- EmitNeedsRedraw();
31- }
32- });
33-
34- ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::bind(sigc::mem_fun(this, &HudLauncherIcon::OnOverlayShown), true));
35- ubus_manager_.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::bind(sigc::mem_fun(this, &HudLauncherIcon::OnOverlayShown), false));
36+ ubus_manager_.RegisterInterest(UBUS_HUD_ICON_CHANGED,
37+ sigc::mem_fun(this, &HudLauncherIcon::OnHudIconChanged));
38+ ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN,
39+ sigc::bind(sigc::mem_fun(this, &HudLauncherIcon::OnOverlayShown),
40+ true));
41+ ubus_manager_.RegisterInterest(UBUS_OVERLAY_HIDDEN,
42+ sigc::bind(sigc::mem_fun(this, &HudLauncherIcon::OnOverlayShown),
43+ false));
44
45 mouse_enter.connect([&](int m) { ubus_manager_.SendMessage(UBUS_DASH_ABOUT_TO_SHOW); });
46 }
47
48+void HudLauncherIcon::OnHudIconChanged(GVariant *data)
49+{
50+ std::string hud_icon_name = glib::Variant(data).GetString();
51+ LOG_DEBUG(logger) << "Hud icon change: " << hud_icon_name;
52+ if (hud_icon_name != icon_name)
53+ {
54+ if (hud_icon_name.empty())
55+ icon_name = PKGDATADIR"/launcher_bfb.png";
56+ else
57+ icon_name = hud_icon_name;
58+
59+ EmitNeedsRedraw();
60+ }
61+}
62+
63 void HudLauncherIcon::SetHideMode(LauncherHideMode hide_mode)
64 {
65 if (launcher_hide_mode_ != hide_mode)
66
67=== modified file 'launcher/HudLauncherIcon.h'
68--- launcher/HudLauncherIcon.h 2012-08-15 02:51:33 +0000
69+++ launcher/HudLauncherIcon.h 2012-08-23 01:08:21 +0000
70@@ -47,6 +47,7 @@
71
72 private:
73 void OnOverlayShown(GVariant *data, bool visible);
74+ void OnHudIconChanged(GVariant *data);
75
76 static unity::UBusManager ubus_manager_;
77 nux::Color background_color_;