Merge lp://staging/~azzar1/unity/fix-doubled-device-launcher-icons into lp://staging/unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 2511
Proposed branch: lp://staging/~azzar1/unity/fix-doubled-device-launcher-icons
Merge into: lp://staging/unity
Diff against target: 791 lines (+562/-45)
12 files modified
launcher/AbstractVolumeMonitorWrapper.h (+61/-0)
launcher/CMakeLists.txt (+1/-0)
launcher/DeviceLauncherIcon.h (+2/-1)
launcher/DeviceLauncherSection.cpp (+23/-27)
launcher/DeviceLauncherSection.h (+8/-17)
launcher/LauncherController.cpp (+4/-0)
launcher/VolumeMonitorWrapper.cpp (+67/-0)
launcher/VolumeMonitorWrapper.h (+51/-0)
tests/CMakeLists.txt (+5/-0)
tests/gmockvolume.c (+176/-0)
tests/gmockvolume.h (+53/-0)
tests/test_device_launcher_section.cpp (+111/-0)
To merge this branch: bzr merge lp://staging/~azzar1/unity/fix-doubled-device-launcher-icons
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
jenkins (community) continuous-integration Needs Fixing
Review via email: mp+115601@code.staging.launchpad.net

This proposal supersedes a proposal from 2012-07-17.

Commit message

Fix duplicated device launcher icons.

Description of the change

== Problem ==
Mounted volume icons doubled up in launcher.

== Fix ==
Add a check to avid duplicated.

== Test ==
Unit test added.

To post a comment you must log in.
Revision history for this message
jenkins (martin-mrazik+qa) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote : Posted in a previous version of this proposal

See if it's convenient to change the map_ to use AbstractLauncherIcon::Ptr so that you can do

map_[volume] = std::make_shared<DeviceLauncherIcon>(volume); :P

299 +class VolumeMonitorWrapper : public sigc::trackable

I would make it uncopyable as well.

225 + GList* volumes = g_volume_monitor_get_volumes(monitor_);
238 + g_list_free(volumes);

You can be smarter doing:

auto volumes = std::shared_ptr<GList>(g_volume_monitor_get_volumes(monitor_), g_list_free))
then for (GList* v = volumes.get() ....)

306 + std::list<glib::Object<GVolume>> GetVolumes();

Since it's public a typedef can help here (even if I'm not a fan of them generally).

See if you can test the wrapper using a fake GVolume or an object implementing GVolumeIface

Revision history for this message
Andrea Azzarone (azzar1) wrote : Posted in a previous version of this proposal

> See if it's convenient to change the map_ to use AbstractLauncherIcon::Ptr so
> that you can do
>
> map_[volume] = std::make_shared<DeviceLauncherIcon>(volume); :P

Done :)

>
> 299 +class VolumeMonitorWrapper : public sigc::trackable
>
> I would make it uncopyable as well.

Not essential, but done.

>
> 225 + GList* volumes = g_volume_monitor_get_volumes(monitor_);
> 238 + g_list_free(volumes);
>
> You can be smarter doing:
>
> auto volumes = std::shared_ptr<GList>(g_volume_monitor_get_volumes(monitor_),
> g_list_free))
> then for (GList* v = volumes.get() ....)
>

Done.

>
> 306 + std::list<glib::Object<GVolume>> GetVolumes();
>
> Since it's public a typedef can help here (even if I'm not a fan of them
> generally).
>

Done.

>
> See if you can test the wrapper using a fake GVolume or an object implementing
> GVolumeIface

Done.

Revision history for this message
jenkins (martin-mrazik+qa) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Thanks for the changes, I like this more now :)

Waiting for the default destructor fix that doesn't seem to work in precise ;)

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
The diff is not available at this time. You can reload the page or download it.