Merge lp:~thomir/unity/remove-constcharstar into lp:unity
Proposed by
Thomi Richards
on 2012-03-26
| Status: | Merged |
|---|---|
| Approved by: | Sam Spilsbury on 2012-03-27 |
| Approved revision: | 2175 |
| Merged at revision: | 2172 |
| Proposed branch: | lp:~thomir/unity/remove-constcharstar |
| Merge into: | lp:unity |
| Diff against target: |
726 lines (+104/-154) 14 files modified
plugins/unityshell/src/HudIcon.cpp (+7/-7) plugins/unityshell/src/HudIcon.h (+1/-1) plugins/unityshell/src/IconTexture.cpp (+21/-30) plugins/unityshell/src/IconTexture.h (+6/-9) plugins/unityshell/src/LauncherIcon.cpp (+21/-29) plugins/unityshell/src/LauncherIcon.h (+10/-10) plugins/unityshell/src/LensBarIcon.cpp (+1/-1) plugins/unityshell/src/PlacesSimpleTile.cpp (+23/-52) plugins/unityshell/src/PlacesSimpleTile.h (+8/-9) plugins/unityshell/src/PreviewApplications.cpp (+2/-2) plugins/unityshell/src/PreviewGeneric.cpp (+1/-1) plugins/unityshell/src/PreviewMusic.cpp (+1/-1) plugins/unityshell/src/PreviewMusicTrack.cpp (+1/-1) plugins/unityshell/src/unity-places-simple-tile-accessible.cpp (+1/-1) |
| To merge this branch: | bzr merge lp:~thomir/unity/remove-constcharstar |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Brandon Schaefer (community) | 2012-03-26 | Approve on 2012-03-27 | |
|
Review via email:
|
|||
Commit Message
Converted several classes to use std::string instead of const char* or const gchar*.
Description of the Change
Converted IconSource and LauncherIcon methods to use std::string rather than char* or gchar*. This cleans up several bits of code.
To post a comment you must log in.
| Sam Spilsbury (smspillaz) wrote : | # |
| Thomi Richards (thomir) wrote : | # |
> Can you use the initializer directly ?
Yes! Thanks for pointing that out. Fixed now.
Cheers
lp:~thomir/unity/remove-constcharstar
updated
on 2012-03-27
- 2175. By Thomi Richards on 2012-03-27
-
Use initialiser list.
| Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Oh, I was doing the same for TextureIcon in the hud tests/cleanup branch... I figure I've to remerge trunk now ;)


79 +IconTexture: :IconTexture( std::string const& icon_name, unsigned int size, bool defer_icon_loading) NUX_TRACKER_ LOCATION) , key_nav_ focus(false) , _icon_name, "") != 0 && !defer_ icon_loading) icon_loading)
80 : TextureArea(
81 _accept_
82 - _icon_name(NULL),
83 _size(size),
84 _texture_width(0),
85 _texture_height(0),
86 _loading(false),
87 _opacity(1.0f)
88 {
89 - _icon_name = g_strdup(icon_name ? icon_name : DEFAULT_ICON);
90 + _icon_name = icon_name.empty() ? DEFAULT_ICON : icon_name;
91
92 - if (g_strcmp0(
93 + if (_icon_name != "" && !defer_
Can you use the initializer directly ?