Merge lp://qastaging/~azzar1/unity/launcher-devices-improvement into lp://qastaging/unity
Status: | Merged |
---|---|
Merged at revision: | 1313 |
Proposed branch: | lp://qastaging/~azzar1/unity/launcher-devices-improvement |
Merge into: | lp://qastaging/unity |
Diff against target: |
1452 lines (+575/-447) 11 files modified
UnityCore/GLibWrapper.cpp (+4/-1) com.canonical.Unity.gschema.xml (+4/-9) plugins/unityshell/src/DeviceLauncherIcon.cpp (+209/-240) plugins/unityshell/src/DeviceLauncherIcon.h (+12/-9) plugins/unityshell/src/DeviceLauncherSection.cpp (+98/-70) plugins/unityshell/src/DeviceLauncherSection.h (+34/-20) plugins/unityshell/src/DevicesSettings.cpp (+136/-62) plugins/unityshell/src/DevicesSettings.h (+50/-33) plugins/unityshell/src/LauncherController.h (+1/-1) plugins/unityshell/src/unityshell.cpp (+5/-2) plugins/unityshell/unityshell.xml.in (+22/-0) |
To merge this branch: | bzr merge lp://qastaging/~azzar1/unity/launcher-devices-improvement |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Neil J. Patel (community) | Approve | ||
Tim Penhey (community) | Approve | ||
Review via email:
|
Commit message
First of all let me show what changes I have done:
* I moved launcher devices options from GSettings to CompizConfig Settings Manager.
* I added a "Keep in launcher" item also for the devices. Since it have no sense having the quicklist item for "Never" and "Always" mode it is enabled only in "Only Mounted" one.
* I changed a bit the signals manager for GVolumeMonitor. Inter alia I moved all volume signals from DeviceLauncherIcon to DeviceLauncherS
* Use std::map instad of g_hash_table.
* Use GLibWrapper to avoid memory leaks.
* Porting to new code style.
I have tested this work on three different computers. Thanks to Alessandro Cutilli, Nicolò Turatello and Andrea Virgillito for testing. I hope there is not error (code style or weird behavior).
Please pardon me in this case.
Sorry for my poor English.
I notice that your editor is using tab stops. Can you configure it to use unityshell/ src/DeviceLaunc herSection. cpp to see what I see.
spaces instead of tabs? See the diff for
plugins/
If you are going to the trouble of adding an anonymous namespace, then you
should replace the #define:
plugins/ unityshell/ src/DeviceLaunc herIcon. cpp
namespace { removable- media";
const char* DEFAULT_ICON = "drive-
}
DeviceLaunche rIcon:: DeviceLauncherI con(Launcher *launcher, GVolume *volume) rIcon:: DeviceLauncherI con(Launcher* launcher, GVolume* volume)
should be:
DeviceLaunche
Keep the pointer with the type not the variable name.
> void DeviceLauncherI con::UpdateDevi ceIcon( )
The extra scoping you have in this method don't really help the readability,
nor are they required for early destruction of the objects. Can you remove
them please?
There is no point at all in adding the "inline" keyword to a function in the
source file. Inlining only works if the compiler knows at the time the other
source file is being compiled (at least I'm fairly sure about that).
> std::list< DbusmenuMenuite m *> DeviceLauncherI con::GetMenus( )
I'm not a fan of returning containers from methods. Normally there is a
better way to structure the program. You don't need to do anything about this
at this stage, just somethingn to consider for the future.
Although I just noticed that the list is containing things that you explicitly
create. This means that every time you call this method you need to remember
to explicitly free all of the objects. Hmm... I also see that you didn't
create this method. I'll chase this up elsewhere.
> void DeviceLauncherI con::ShowMount( GMount *mount)
Please keep the pointer with the type.
> g_mount_ unmount_ with_operation( mount.RawPtr( ),
This should work without the .RawPtr() call. The object implements an unmount_ with_operation expects
operator OBJECT* method, and since the g_mount_
a GMount, the method is used.
Same for g_drive_stop.
Also try for the g_signal_connect. It should work. Let me know if it
doesn't.
std::map<GVolume *, DeviceLauncherIcon *> is screaming for a typedef. The
whole using a map based on pointers makes me queezy. I don't feel comfortable
that the contained values are destroyed consistently. The are newed when
added to the map, but removal just calls erase. I don't see a corresponding
delete. Instead of storing raw pointers, could we key it off a consistent
name perhaps? And store smart pointers?