2 * Copyright (C) 2011, 2013 Canonical, Ltd.
5 * Florian Boucault <florian.boucault@canonical.com>
6 * Pawel Stolowski <pawel.stolowski@canonical.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 3.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25#include "ratingsfilter.h"
26#include "radiooptionfilter.h"
27#include "checkoptionfilter.h"
28#include "multirangefilter.h"
31#include <UnityCore/Filter.h>
32#include <UnityCore/RatingsFilter.h>
33#include <UnityCore/RadioOptionFilter.h>
34#include <UnityCore/CheckOptionFilter.h>
35#include <UnityCore/MultiRangeFilter.h>
40Filter::Filter(QObject *parent) :
45QString Filter::id() const
48 return QString::Null();
49 return QString::fromStdString(m_unityFilter->id());
52QString Filter::name() const
55 return QString::Null();
56 return QString::fromStdString(m_unityFilter->name());
59QString Filter::iconHint() const
62 return QString::Null();
63 return QString::fromStdString(m_unityFilter->icon_hint());
66QString Filter::rendererName() const
69 return QString::Null();
70 return QString::fromStdString(m_unityFilter->renderer_name());
73bool Filter::visible() const
77 return m_unityFilter->visible();
80bool Filter::collapsed() const
84 return m_unityFilter->collapsed();
87bool Filter::filtering() const
91 return m_unityFilter->filtering();
97 m_unityFilter->Clear();
100void Filter::setUnityFilter(unity::dash::Filter::Ptr unityFilter)
102 m_unityFilter = unityFilter;
105Filter* Filter::newFromUnityFilter(unity::dash::Filter::Ptr unityFilter)
109 if (typeid(*unityFilter) == typeid(unity::dash::RatingsFilter)) {
110 filter = new RatingsFilter;
111 } else if (typeid(*unityFilter) == typeid(unity::dash::CheckOptionFilter)) {
112 filter = new CheckOptionFilter;
113 } else if (typeid(*unityFilter) == typeid(unity::dash::RadioOptionFilter)) {
114 filter = new RadioOptionFilter;
115 } else if (typeid(*unityFilter) == typeid(unity::dash::MultiRangeFilter)) {
116 filter = new MultiRangeFilter;
118 qWarning() << "Filter of unknown type: " << typeid(*unityFilter).name();
122 filter->setUnityFilter(unityFilter);
126bool Filter::hasUnityFilter(unity::dash::Filter::Ptr unityFilter) const
128 return m_unityFilter == unityFilter;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list