Merge lp:~gerboland/unity-2d/unity-core5-change-fix into lp:unity-2d

Proposed by Gerry Boland
Status: Superseded
Proposed branch: lp:~gerboland/unity-2d/unity-core5-change-fix
Merge into: lp:unity-2d
Diff against target: 67 lines (+15/-5)
2 files modified
libunity-2d-private/src/lens.cpp (+12/-3)
libunity-2d-private/src/lens.h (+3/-2)
To merge this branch: bzr merge lp:~gerboland/unity-2d/unity-core5-change-fix
Reviewer Review Type Date Requested Status
Michal Hruby (community) Needs Fixing
Lohith D Shivamurthy functional Pending
Mikkel Kamstrup Erlandsen Pending
Review via email: mp+85641@code.launchpad.net

This proposal has been superseded by a proposal from 2011-12-14.

Description of the change

[core] Update compatibility with UnityCore5 API.

Changes
- *SearchFinished signals passing Lens::Hints
- Lens active property changed to a ViewType enum of HIDDEN, HOME_VIEW, LENS_VIEW

As Home lens is a QML file, we only need only use HIDDEN/LENS_VIEW.

To post a comment you must log in.
Revision history for this message
Michal Hruby (mhr3) wrote :

1) Please don't ignore setting HOME_VIEW on lenses, they might not update properly if it's not set. (setting it on all lenses is fine as well).

2) It would also be nice to make sure the viewtype is set to HIDDEN when the dash is closed (optional as this point though).

3) The plain dbus call probably shouldn't be there :)

review: Needs Fixing
829. By Gerry Boland

placeentry deprecated, jumk removed

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

We could land this in order to unbreak trunk; as it'll work in most cases - under the promise that we have a quick follow up that gets things proper?

Revision history for this message
Gerry Boland (gerboland) wrote :

I've no objection to that idea. I will continue to work on this to satisfy Michal's objections.

Revision history for this message
Michal Hruby (mhr3) wrote :

The merger is still not working, so there's no hurry...

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

On 14 December 2011 14:52, Michal Hruby <email address hidden> wrote:
> The merger is still not working, so there's no hurry...

Is too! :-)

Unmerged revisions

829. By Gerry Boland

placeentry deprecated, jumk removed

828. By Gerry Boland

Add comment to explain use of HIDDEN and LENS_VIEW only

827. By Gerry Boland

Active property changed to a ViewType enum. In U2D the home lens is a QML file, so we only need to set Lens with either the HIDDEN or LENS_VIEW view type.

826. By Gerry Boland

*SearchFinished signals passing Lens::Hints

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libunity-2d-private/src/lens.cpp'
2--- libunity-2d-private/src/lens.cpp 2011-09-12 13:29:41 +0000
3+++ libunity-2d-private/src/lens.cpp 2011-12-14 12:09:25 +0000
4@@ -109,7 +109,7 @@
5
6 bool Lens::active() const
7 {
8- return m_unityLens->active();
9+ return m_unityLens->view_type() != unity::dash::HIDDEN;
10 }
11
12 Filters* Lens::filters() const
13@@ -129,7 +129,11 @@
14
15 void Lens::setActive(bool active)
16 {
17- m_unityLens->active = active;
18+ /* Note that in Unity-Core5, view_type is an enum of HIDDEN, HOME_VIEW and LENS_VIEW
19+ As home lens managed very differently in Unity2D, we simply maintain an active property
20+ for all lenses by just using HIDDEN and LENS_VIEW.
21+ */
22+ m_unityLens->view_type = active ? unity::dash::LENS_VIEW : unity::dash::HIDDEN;
23 }
24
25 void Lens::setSearchQuery(const QString& search_query)
26@@ -246,7 +250,7 @@
27 m_unityLens->global_results()->swarm_name.changed.connect(sigc::mem_fun(this, &Lens::onGlobalResultsSwarmNameChanged));
28 m_unityLens->categories.changed.connect(sigc::mem_fun(this, &Lens::onCategoriesChanged));
29 m_unityLens->categories()->swarm_name.changed.connect(sigc::mem_fun(this, &Lens::onCategoriesSwarmNameChanged));
30- m_unityLens->active.changed.connect(sigc::mem_fun(this, &Lens::activeChanged));
31+ m_unityLens->view_type.changed.connect(sigc::mem_fun(this, &Lens::onViewTypeChanged));
32
33 /* Signals forwarding */
34 m_unityLens->search_finished.connect(sigc::mem_fun(this, &Lens::searchFinished));
35@@ -305,4 +309,9 @@
36 m_categories->setName(QString::fromStdString(m_unityLens->categories()->swarm_name));
37 }
38
39+void Lens::onViewTypeChanged(unity::dash::ViewType viewType)
40+{
41+ Q_EMIT activeChanged( viewType != unity::dash::HIDDEN );
42+}
43+
44 #include "lens.moc"
45
46=== modified file 'libunity-2d-private/src/lens.h'
47--- libunity-2d-private/src/lens.h 2011-09-12 13:29:41 +0000
48+++ libunity-2d-private/src/lens.h 2011-12-14 12:09:25 +0000
49@@ -107,8 +107,8 @@
50 void categoriesChanged();
51 void activeChanged(bool);
52 void filtersChanged();
53- void searchFinished(std::string const&);
54- void globalSearchFinished(std::string const&);
55+ void searchFinished(unity::dash::Lens::Hints const&);
56+ void globalSearchFinished(unity::dash::Lens::Hints const&);
57 void searchQueryChanged();
58 void globalSearchQueryChanged();
59
60@@ -122,6 +122,7 @@
61 void onGlobalResultsChanged(unity::dash::Results::Ptr);
62 void onCategoriesSwarmNameChanged(std::string);
63 void onCategoriesChanged(unity::dash::Categories::Ptr);
64+ void onViewTypeChanged(unity::dash::ViewType);
65
66 void onActivated(std::string const& uri, unity::dash::HandledType type, unity::dash::Lens::Hints const&);
67 void fallbackActivate(const QString& uri);

Subscribers

People subscribed via source and target branches