Merge lp://staging/~3v1n0/unity/launcher-draggable-icons into lp://staging/unity
Status: | Merged |
---|---|
Approved by: | Marco Trevisan (Treviño) |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2713 |
Proposed branch: | lp://staging/~3v1n0/unity/launcher-draggable-icons |
Merge into: | lp://staging/unity |
Diff against target: |
7548 lines (+3855/-1096) 72 files modified
UnityCore/DesktopUtilities.cpp (+29/-9) UnityCore/DesktopUtilities.h (+1/-0) UnityCore/GLibDBusProxy.cpp (+0/-4) com.canonical.Unity.gschema.xml (+3/-3) launcher/AbstractLauncherIcon.h (+16/-2) launcher/BFBLauncherIcon.cpp (+1/-0) launcher/BamfLauncherIcon.cpp (+31/-48) launcher/BamfLauncherIcon.h (+0/-1) launcher/CMakeLists.txt (+1/-0) launcher/DesktopLauncherIcon.cpp (+19/-6) launcher/DesktopLauncherIcon.h (+4/-12) launcher/DeviceLauncherSection.cpp (+14/-7) launcher/DeviceLauncherSection.h (+3/-5) launcher/DndData.cpp (+5/-5) launcher/DndData.h (+1/-1) launcher/ExpoLauncherIcon.cpp (+64/-0) launcher/ExpoLauncherIcon.h (+45/-0) launcher/FavoriteStore.cpp (+93/-4) launcher/FavoriteStore.h (+21/-8) launcher/FavoriteStoreGSettings.cpp (+67/-68) launcher/FavoriteStoreGSettings.h (+7/-4) launcher/FavoriteStorePrivate.cpp (+14/-0) launcher/FavoriteStorePrivate.h (+3/-1) launcher/HudLauncherIcon.cpp (+2/-1) launcher/Launcher.cpp (+82/-108) launcher/Launcher.h (+5/-8) launcher/LauncherController.cpp (+526/-341) launcher/LauncherController.h (+1/-3) launcher/LauncherControllerPrivate.h (+28/-41) launcher/LauncherIcon.cpp (+31/-4) launcher/LauncherIcon.h (+5/-9) launcher/LauncherModel.cpp (+34/-32) launcher/MockLauncherIcon.h (+11/-15) launcher/SoftwareCenterLauncherIcon.cpp (+27/-38) launcher/SoftwareCenterLauncherIcon.h (+1/-1) launcher/SpacerLauncherIcon.cpp (+1/-1) launcher/SpacerLauncherIcon.h (+0/-4) launcher/StandaloneLauncher.cpp (+1/-1) launcher/TrashLauncherIcon.cpp (+1/-0) launcher/VolumeLauncherIcon.cpp (+34/-4) launcher/VolumeLauncherIcon.h (+3/-0) manual-tests/Launcher.txt (+15/-0) panel/PanelMenuView.h (+0/-1) plugins/unityshell/src/unityshell.cpp (+5/-7) plugins/unityshell/unityshell.xml.in (+0/-6) tests/CMakeLists.txt (+19/-11) tests/gmockvolume.c (+3/-2) tests/test_bamf_launcher_icon.cpp (+70/-2) tests/test_bfb_launcher_icon.cpp (+11/-8) tests/test_desktop_launcher_icon.cpp (+80/-0) tests/test_desktop_utilities.cpp (+52/-22) tests/test_device_launcher_section.cpp (+19/-54) tests/test_expo_launcher_icon.cpp (+58/-0) tests/test_favorite_store.cpp (+111/-0) tests/test_favorite_store_gsettings.cpp (+52/-29) tests/test_hud_launcher_icon.cpp (+53/-0) tests/test_launcher.cpp (+226/-15) tests/test_launcher_controller.cpp (+1246/-44) tests/test_launcher_icon.cpp (+113/-0) tests/test_launcher_model.cpp (+182/-40) tests/test_main.cpp (+1/-0) tests/test_main_xless.cpp (+1/-1) tests/test_mock_devices.h (+93/-0) tests/test_software_center_launcher_icon.cpp (+74/-0) tests/test_trash_launcher_icon.cpp (+39/-0) tests/test_volume_launcher_icon.cpp (+67/-46) unity-shared/PluginAdapter.h (+2/-0) unity-shared/PluginAdapterCompiz.cpp (+5/-0) unity-shared/PluginAdapterStandalone.cpp (+15/-7) unity-shared/WindowManager.cpp (+5/-0) unity-shared/WindowManager.h (+1/-0) unity-standalone/StandaloneUnity.cpp (+2/-2) |
To merge this branch: | bzr merge lp://staging/~3v1n0/unity/launcher-draggable-icons |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrea Azzarone (community) | Approve | ||
Brandon Schaefer (community) | Approve | ||
Review via email:
|
Commit message
LauncherController, FavoriteStore, Launcher, Icons: always use sort priority based on favorites to get positioned on launcher
Description of the change
This is the continuum of the work started in lp:~3v1n0/unity/keep-priority-launcher-model, here we use the launcher icons priority to correctly order the icons in the launcher, based on the position that they have in the favorite store.
The unity launcher favorite store now handles not only desktop paths or id but also (mostly) icons uris (such as application:
To do this, I had to change AbstractLaunche
The icons ordering has changed a lot: now the favorites control everything (except BFB and trash) and we add the icons based on their defined position. Added two special places: "unity:
When a new Device or Application icon is added to the launcher, we append it to the list of the non-sticky devices or applications.
Favorites reordering, removal or additions have been refactored to fit to our new system; when we save the favorites, the position of the "running-apps" or "attached-devices" is computed based on where the first icon of this type is placed.
The expo icon is handled differently, since it is not added if we have no workspaces available; it also updates its visibility based on the workspaces settings.
SoftwareCenterL
See other commit messages for more info, they should be quite comprehensive.
----
Testing: updated and added a lot of new unit tests to cover (hopefully) all the changes I've done (that's mostly why this diff is so big, since the real changes are less than the half of the changed code) and to test the areas that we never tested before, just few stats:
test-gtest: added 13 new test cases (+5%)
test-gtest-xless: added 94 new test cases (+56%)
340 +std::string DesktopLauncher Icon::GetRemote Uri() //desktop- icon";
341 +{
342 + return "unity:
343 +}
+bool DesktopLauncher Icon::ShowInSwi tcher(bool current)
351 +{
352 + return show_in_switcher_;
353 +}
Can we make these methods const?
---
+#ifndef EXPO_LAUNCHER_ ICON_H
I'd prefer UNITYSHELL_EXPO... But it's not blocking :)
...
+FavoriteStore* favoritestore_ instance = nullptr;
FavoriteStore should not be a singleton. You can use DI in launcher: :Controller.
---
621 +bool FavoriteStore: :IsValidFavorit eUri(std: :string const& uri) URI_PREFIX_ APP) == 0 || uri.find( URI_PREFIX_ FILE) == 0) :impl:: IsDesktopFilePa th(uri) ;
622 +{
623 + if (uri.empty())
624 + return false;
625 +
626 + if (uri.find(
627 + {
628 + return internal:
629 + }
Can this method be const? Also you know we prefer to use operator ! :)
+ const std::string prefix_separator = "://";
+ const std::string proto_separator = "://";
813 + const std::string desktop_ext = ".desktop";
I'd make it static or I'd move it out of the function.
//auto const& system_dirs = DesktopUtilitie s::GetDataDirec tories( );
Remove it if you don't need it.
+bool FavoriteStoreGS ettings: :IsFavorite( std::string const& icon_uri)
const :)
+ const std::string desktop_ext = ".desktop";
Make it static.
1199 - if (max > 0.0f)
1200 - {
1201 - color = color * (1.0f / max);
1202 - }
1203 + color = color * (1.0f / max);
Why have you done this?
* I'll continue the review later *