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
=== modified file 'launcher/HudLauncherIcon.cpp'
--- launcher/HudLauncherIcon.cpp 2012-08-15 02:51:33 +0000
+++ launcher/HudLauncherIcon.cpp 2012-08-23 01:08:21 +0000
@@ -20,6 +20,7 @@
20#include "HudLauncherIcon.h"20#include "HudLauncherIcon.h"
21#include "Launcher.h"21#include "Launcher.h"
22#include "UnityCore/GLibWrapper.h"22#include "UnityCore/GLibWrapper.h"
23#include "UnityCore/Variant.h"
23#include <NuxCore/Logger.h>24#include <NuxCore/Logger.h>
2425
25#include "unity-shared/UBusMessages.h"26#include "unity-shared/UBusMessages.h"
@@ -50,30 +51,33 @@
5051
51 background_color_ = nux::color::White;52 background_color_ = nux::color::White;
5253
53 ubus_manager_.RegisterInterest(UBUS_HUD_ICON_CHANGED, [&](GVariant *data)54 ubus_manager_.RegisterInterest(UBUS_HUD_ICON_CHANGED,
54 {55 sigc::mem_fun(this, &HudLauncherIcon::OnHudIconChanged));
55 std::string hud_icon_name;56 ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN,
56 const gchar* data_string = g_variant_get_string(data, NULL);57 sigc::bind(sigc::mem_fun(this, &HudLauncherIcon::OnOverlayShown),
57 if (data_string)58 true));
58 hud_icon_name = data_string;59 ubus_manager_.RegisterInterest(UBUS_OVERLAY_HIDDEN,
59 LOG_DEBUG(logger) << "Hud icon change: " << hud_icon_name;60 sigc::bind(sigc::mem_fun(this, &HudLauncherIcon::OnOverlayShown),
60 if (hud_icon_name != icon_name)61 false));
61 {
62 if (hud_icon_name.empty())
63 icon_name = PKGDATADIR"/launcher_bfb.png";
64 else
65 icon_name = hud_icon_name;
66
67 EmitNeedsRedraw();
68 }
69 });
70
71 ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::bind(sigc::mem_fun(this, &HudLauncherIcon::OnOverlayShown), true));
72 ubus_manager_.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::bind(sigc::mem_fun(this, &HudLauncherIcon::OnOverlayShown), false));
7362
74 mouse_enter.connect([&](int m) { ubus_manager_.SendMessage(UBUS_DASH_ABOUT_TO_SHOW); });63 mouse_enter.connect([&](int m) { ubus_manager_.SendMessage(UBUS_DASH_ABOUT_TO_SHOW); });
75}64}
7665
66void HudLauncherIcon::OnHudIconChanged(GVariant *data)
67{
68 std::string hud_icon_name = glib::Variant(data).GetString();
69 LOG_DEBUG(logger) << "Hud icon change: " << hud_icon_name;
70 if (hud_icon_name != icon_name)
71 {
72 if (hud_icon_name.empty())
73 icon_name = PKGDATADIR"/launcher_bfb.png";
74 else
75 icon_name = hud_icon_name;
76
77 EmitNeedsRedraw();
78 }
79}
80
77void HudLauncherIcon::SetHideMode(LauncherHideMode hide_mode)81void HudLauncherIcon::SetHideMode(LauncherHideMode hide_mode)
78{82{
79 if (launcher_hide_mode_ != hide_mode)83 if (launcher_hide_mode_ != hide_mode)
8084
=== modified file 'launcher/HudLauncherIcon.h'
--- launcher/HudLauncherIcon.h 2012-08-15 02:51:33 +0000
+++ launcher/HudLauncherIcon.h 2012-08-23 01:08:21 +0000
@@ -47,6 +47,7 @@
4747
48private:48private:
49 void OnOverlayShown(GVariant *data, bool visible);49 void OnOverlayShown(GVariant *data, bool visible);
50 void OnHudIconChanged(GVariant *data);
5051
51 static unity::UBusManager ubus_manager_;52 static unity::UBusManager ubus_manager_;
52 nux::Color background_color_;53 nux::Color background_color_;