Merge lp://qastaging/~gordallott/unity/dash-legal-link into lp://qastaging/unity

Proposed by Gord Allott
Status: Merged
Merged at revision: 2965
Proposed branch: lp://qastaging/~gordallott/unity/dash-legal-link
Merge into: lp://qastaging/unity
Diff against target: 304 lines (+138/-8)
6 files modified
dash/LensBar.cpp (+94/-5)
dash/LensBar.h (+19/-2)
plugins/unityshell/resources/information_icon.svg (+14/-0)
plugins/unityshell/resources/searchingthedashlegalnotice.html (+1/-0)
unity-shared/DashStyle.cpp (+7/-0)
unity-shared/DashStyle.h (+3/-1)
To merge this branch: bzr merge lp://qastaging/~gordallott/unity/dash-legal-link
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Timo Jyrinki Approve
Review via email: mp+129235@code.qastaging.launchpad.net

Commit message

adds a legal link to the dash, also a new resource

Description of the change

adds a legal link to the dash

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Looks good and works well...

29 + glib::String cachedir(g_strdup(g_get_user_cache_dir()));

No need to strdup it, just assign that to std::string... It should be never NULL, in case just check for that.

30 + legal_seen_file_path_ = cachedir.Str() + "/unitydashlegalseen";

Since we have an unity .cache dir, I'd just add there... i.e. cachedir/unity/dashlegalseen

68 + QueueRelayout();
69 + QueueDraw();

The first is enough, as does also redraw.

64 + info_icon_->SetVisible(info_previously_shown_);
65 + legal_->SetVisible(!info_previously_shown_);
67 + DoOpenLegalise();

Wouldn't be better to open the legalise (and close the dash) and then switch the icon visibility?

95 + std::string legal_file_path = "file://";
96 + legal_file_path.append(PKGDATADIR);
97 + legal_file_path.append("/searchingthedashlegalnotice.html");

Why not just doing:
std::string legal_file_path = "file://" PKGDATADIR "/searchingthedashlegalnotice.html";

221 + nux::LayeredLayout* layered_layout_;
222 + nux::HLayout *legal_layout_;

It seems you don't need to keep these in class.

Finally, both the icon and the text are always built, only their visibility is switched, couldn't avoid this (and then only allocate only the needed resources)?

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

143 + auto geo = GetAbsoluteGeometry();

Ah, use auto const& instead ;)

Revision history for this message
Gord Allott (gordallott) wrote :

> Looks good and works well...
>
> 29 + glib::String cachedir(g_strdup(g_get_user_cache_dir()));
>
> No need to strdup it, just assign that to std::string... It should be never
> NULL, in case just check for that.
>
> 30 + legal_seen_file_path_ = cachedir.Str() + "/unitydashlegalseen";
>
> Since we have an unity .cache dir, I'd just add there... i.e.
> cachedir/unity/dashlegalseen

we don't have a unity cache directory, not anymore.

>
> 68 + QueueRelayout();
> 69 + QueueDraw();
>
> The first is enough, as does also redraw.
>
> 64 + info_icon_->SetVisible(info_previously_shown_);
> 65 + legal_->SetVisible(!info_previously_shown_);
> 67 + DoOpenLegalise();
>
> Wouldn't be better to open the legalise (and close the dash) and then switch
> the icon visibility?
>
> 95 + std::string legal_file_path = "file://";
> 96 + legal_file_path.append(PKGDATADIR);
> 97 + legal_file_path.append("/searchingthedashlegalnotice.html");
>
> Why not just doing:
> std::string legal_file_path = "file://" PKGDATADIR
> "/searchingthedashlegalnotice.html";

personal preference

>
> 221 + nux::LayeredLayout* layered_layout_;
> 222 + nux::HLayout *legal_layout_;
>
> It seems you don't need to keep these in class.
>
> Finally, both the icon and the text are always built, only their visibility is
> switched, couldn't avoid this (and then only allocate only the needed
> resources)?

they could, but there is little reason to, its less than 2kb of memory.

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

This has been in 6.0 series already for some time (in this final form), would be good to have in lp:unity as well?

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Martin Mrazik (mrazik) wrote :

Gord, can you please merge with lp:unity and then re-upload your branch? The above is a jenkins error but it is a bit of corner case and left-over from the migration to inline packaging. Instead of creating some weird hack it would be easier to manually get the packaging into your branch (by merging with trunk). Many thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.