Merge lp:~aacid/unity/fix_panek_title_escaping_1067357 into lp:unity
Proposed by
Albert Astals Cid
Status: | Merged |
---|---|
Approved by: | Marco Trevisan (Treviño) |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2865 |
Proposed branch: | lp:~aacid/unity/fix_panek_title_escaping_1067357 |
Merge into: | lp:unity |
Diff against target: |
332 lines (+170/-47) 6 files modified
panel/PanelMenuView.cpp (+48/-42) panel/PanelMenuView.h (+4/-2) tests/CMakeLists.txt (+2/-1) tests/test_panel_menu_view.cpp (+96/-0) unity-shared/StandaloneWindowManager.cpp (+14/-2) unity-shared/StandaloneWindowManager.h (+6/-0) |
To merge this branch: | bzr merge lp:~aacid/unity/fix_panek_title_escaping_1067357 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Marco Trevisan (Treviño) | Approve | ||
Review via email: mp+130111@code.launchpad.net |
Commit message
Fix escaping of _panel_title
It only has to be escpaed if comes from new_title
if coming from UBUS_LAUNCHER_
Fixes bug #1067357
Description of the change
Fix escaping of _panel_title
It only has to be escpaed if comes from new_title
if coming from UBUS_LAUNCHER_
Fixes bug #1067357
To post a comment you must log in.
89 + const std::string prevTitle = _panel_title;
90 + RefreshTitle();
91 + if (prevTitle == _panel_title && !force && _last_geo == geo && _title_texture)
92 + {
93 + // No need to redraw the title, let's save some CPU time!
94 + return;
95 }
Mh, at this point I think it's better to make RefreshTitle to return a string... Channging it to GetCurrentTitle() so we can:
std::string const& new_title = GetCurrentTitle() // always use not-capital chars on variables
if (new_title == prev_title_) ....
130 + std::string _panel_title;
Please don't make it public, put it back as private.
If you need to access it on testing, just add a: friend class TestPanelMenuView;
Doing so in your struct TestPanelMenuView you can access to this member (see LauncherController or Launcher tests for reference).
+ EXPECT_ EQ(panelMenuVie w._panel_ title, "");
Better EXPECT_TRUE( ... .empty()).
264 + EXPECT_TRUE(wm != nullptr);
Use an assert here, so that there won't be crashes:
ASSERT_NE(wm, nullptr);