diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2015-04-23 01:39:52 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2015-04-23 01:39:52 +0200 |
| commit | 76ed7cc3100007939d0b3ebd0ae193ec39388846 (patch) | |
| tree | c87a69770c7f19c3685e90f07ae47c45349a3105 /dash | |
| parent | eb5ba3864f2d932f4fa3dbb0463023864693f474 (diff) | |
ResultView: add GetLocalResultActivateType that returns how a result should be activated
(bzr r3952.7.6)
Diffstat (limited to 'dash')
| -rw-r--r-- | dash/ResultView.cpp | 9 | ||||
| -rw-r--r-- | dash/ResultView.h | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/dash/ResultView.cpp b/dash/ResultView.cpp index 2981b0666..a21bc3f86 100644 --- a/dash/ResultView.cpp +++ b/dash/ResultView.cpp @@ -23,6 +23,7 @@ #include "ResultView.h" +#include <boost/algorithm/string.hpp> #include <Nux/Layout.h> #include "unity-shared/IntrospectableWrappers.h" @@ -224,6 +225,14 @@ LocalResult ResultView::GetLocalResultForIndex(unsigned int index) return LocalResult(*GetIteratorAtRow(index)); } +ResultView::ActivateType ResultView::GetLocalResultActivateType(LocalResult const& result) const +{ + if (boost::starts_with(result.uri, "x-unity-no-preview")) + return ActivateType::DIRECT; + + return ActivateType::PREVIEW; +} + void ResultView::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) {} diff --git a/dash/ResultView.h b/dash/ResultView.h index 09c3ee4ff..2a5cb07a3 100644 --- a/dash/ResultView.h +++ b/dash/ResultView.h @@ -72,8 +72,9 @@ public: void SetModelRenderer(ResultRenderer* renderer); void SetResultsModel(Results::Ptr const& results); - unsigned int GetIndexForLocalResult(LocalResult const& local_result); + unsigned int GetIndexForLocalResult(LocalResult const&); LocalResult GetLocalResultForIndex(unsigned int); + ActivateType GetLocalResultActivateType(LocalResult const&) const; nux::Property<bool> expanded; nux::Property<int> results_per_row; |
