~savilerow-team/savilerow/unity-scope-selfserviceplan

« back to all changes in this revision

Viewing changes to src/SelfServicePlanScope.cpp

  • Committer: Scott Sweeny
  • Date: 2014-06-27 19:34:30 UTC
  • mfrom: (16.1.1 api050)
  • Revision ID: scott.sweeny@canonical.com-20140627193430-4smeqvg5vhxg7c0x
Update for Scopes API version 0.5.0  

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
2
/*
3
 
 * Copyright (C) 2013 Canonical, Ltd.
 
3
 * Copyright (C) 2014 Canonical, Ltd.
4
4
 *
5
5
 * This program is free software: you can redistribute it and/or modify it
6
6
 * under the terms of the GNU General Public License version 3, as published
14
14
 * You should have received a copy of the GNU General Public License along
15
15
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
16
16
 *
17
 
 * Author: Pawel Stolowski <pawel.stolowski@canonical.com>
 
17
 * Author: Scott Sweeny <scott.sweeny@canonical.com>
18
18
 */
19
19
 
20
20
#include "SelfServicePlanScope.h"
67
67
    delete m_app;
68
68
}
69
69
 
70
 
int SelfServicePlanScope::start(string const&, unity::scopes::RegistryProxy const&)
 
70
void SelfServicePlanScope::start(string const&, unity::scopes::RegistryProxy const&)
71
71
{
72
 
    return VERSION;
73
72
}
74
73
 
75
 
SearchQueryBase::UPtr SelfServicePlanScope::search(const CannedQuery &query, SearchMetadata const&)
 
74
SearchQueryBase::UPtr SelfServicePlanScope::search(const CannedQuery &query, SearchMetadata const& metadata)
76
75
{
77
 
    QStringList scopes;
78
 
    SearchQueryBase::UPtr q(new SelfServicePlanQuery(query, scopes, m_locale));
 
76
    SearchQueryBase::UPtr q(new SelfServicePlanQuery(query, metadata));
79
77
    return q;
80
78
}
81
79
 
82
80
PreviewQueryBase::UPtr SelfServicePlanScope::preview(Result const& result,
83
81
                                              ActionMetadata const& hints)
84
82
{
85
 
    PreviewQueryBase::UPtr previewer(new SelfServicePlanPreview(*this, result));
 
83
    PreviewQueryBase::UPtr previewer(new SelfServicePlanPreview(result, hints));
86
84
    return previewer;
87
85
}
88
86
 
89
 
void SelfServicePlanScope::appendIfEnabled(QStringList &scopeToQuery, const QString &scopeId) const
90
 
{
91
 
    if (!m_disabledScopes.contains(scopeId)) {
92
 
        scopeToQuery << scopeId;
93
 
    }
94
 
}
95
 
 
96
 
void SelfServicePlanScope::updateDisabledScopes()
97
 
{
98
 
}
99
 
 
100
 
SelfServicePlanPreview::SelfServicePlanPreview(SelfServicePlanScope &scope, Result const &result)
101
 
    : scope(scope),
 
87
SelfServicePlanPreview::SelfServicePlanPreview(Result const &result, ActionMetadata const& metadata)
 
88
    : PreviewQueryBase(result, metadata),
102
89
    result(result)
103
90
{
104
91
}