Merge lp:~nick-dedekind/unity/7.x-unity-no-preview into lp:unity

Proposed by Nick Dedekind
Status: Merged
Approved by: Michal Hruby
Approved revision: no longer in the source branch.
Merged at revision: 3369
Proposed branch: lp:~nick-dedekind/unity/7.x-unity-no-preview
Merge into: lp:unity
Diff against target: 101 lines (+15/-12)
1 file modified
dash/ScopeView.cpp (+15/-12)
To merge this branch: bzr merge lp:~nick-dedekind/unity/7.x-unity-no-preview
Reviewer Review Type Date Requested Status
Michal Hruby (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+168736@code.launchpad.net

Commit message

Added check for x-unity-no-preview. Do not preview; send direct activation to scope.

Description of the change

Added check for x-unity-no-preview. Do not preview; send direct activation to scope.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michal Hruby (mhr3) wrote :

Kind of a hack, but according to design the command lens is far from working as designed. Once it does, we should remove this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dash/ScopeView.cpp'
2--- dash/ScopeView.cpp 2013-05-22 14:31:53 +0000
3+++ dash/ScopeView.cpp 2013-06-11 16:51:27 +0000
4@@ -122,7 +122,7 @@
5
6 void EnableScrolling(bool enable_scrolling)
7 {
8- _vscrollbar->SetInputEventSensitivity(enable_scrolling);
9+ _vscrollbar->SetInputEventSensitivity(enable_scrolling);
10 }
11
12 protected:
13@@ -232,7 +232,7 @@
14 results_updated.disconnect();
15 result_added_connection.disconnect();
16 result_removed_connection.disconnect();
17-
18+
19 categories_updated.disconnect();
20 category_added_connection.disconnect();
21 category_changed_connection.disconnect();
22@@ -351,7 +351,7 @@
23 if (category_views_.size() <= desired_category_index)
24 continue;
25
26- scroll_layout_->AddView(category_views_[desired_category_index].GetPointer(), 0);
27+ scroll_layout_->AddView(category_views_[desired_category_index].GetPointer(), 0);
28 }
29 }
30
31@@ -486,9 +486,12 @@
32 results_view->unique_id = unique_id;
33 results_view->expanded = false;
34
35- results_view->ResultActivated.connect([this, unique_id] (LocalResult const& local_result, ResultView::ActivateType type, GVariant* data)
36+ results_view->ResultActivated.connect([this, unique_id] (LocalResult const& local_result, ResultView::ActivateType type, GVariant* data)
37 {
38- result_activated.emit(type, local_result, data, unique_id);
39+ if (g_str_has_prefix(local_result.uri.c_str(), "x-unity-no-preview"))
40+ type = ResultView::ActivateType::DIRECT;
41+
42+ result_activated.emit(type, local_result, data, unique_id);
43 switch (type)
44 {
45 case ResultView::ActivateType::DIRECT:
46@@ -582,7 +585,7 @@
47 auto order_pos = std::find(category_order_.begin(), category_order_.end(), index);
48 if (order_pos != category_order_.end())
49 category_order_.erase(order_pos);
50-
51+
52 scroll_layout_->RemoveChildObject(group.GetPointer());
53 RemoveChild(group.GetPointer());
54
55@@ -672,7 +675,7 @@
56 }
57
58 ResultView* ScopeView::GetResultViewForCategory(unsigned int category_index)
59-{
60+{
61 if (category_views_.size() <= category_index)
62 return nullptr;
63
64@@ -702,7 +705,7 @@
65 // category not added yet.
66 if (category_views_.size() <= result.category_index)
67 return;
68-
69+
70 std::string uri = result.uri;
71 LOG_TRACE(logger) << "Result removed '" << (scope_ ? scope_->name() : "unknown") << "': " << uri;
72
73@@ -1026,7 +1029,7 @@
74 {
75 PlacesGroup::Ptr group = *iter;
76 if (group->GetChildView()->unique_id == view_id)
77- {
78+ {
79 if (expand)
80 {
81 group->PushExpanded();
82@@ -1058,8 +1061,8 @@
83 if (result_view)
84 {
85 result_view->enable_texture_render = enable_result_textures;
86- }
87- }
88+ }
89+ }
90 }
91
92 std::vector<ResultViewTexture::Ptr> ScopeView::GetResultTextureContainers()
93@@ -1185,7 +1188,7 @@
94 }
95
96 void ScopeView::PushResultFocus(const char* reason)
97-{
98+{
99 int current_category_position = 0;
100 for (auto iter = category_order_.begin(); iter != category_order_.end(); ++iter)
101 {