2 * Copyright (C) 2013 Canonical, Ltd.
5 * Michal Hruby <michal.hruby@canonical.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 3.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21#include "categoryresults.h"
24// TODO: use something from libunity once it's public
37CategoryResults::CategoryResults(QObject* parent)
38 : DeeListModel(parent)
41 m_roles[CategoryResults::RoleUri] = "uri";
42 m_roles[CategoryResults::RoleIconHint] = "icon";
43 m_roles[CategoryResults::RoleCategory] = "category";
44 m_roles[CategoryResults::RoleMimetype] = "mimetype";
45 m_roles[CategoryResults::RoleTitle] = "title";
46 m_roles[CategoryResults::RoleComment] = "comment";
47 m_roles[CategoryResults::RoleDndUri] = "dndUri";
48 m_roles[CategoryResults::RoleMetadata] = "metadata";
51int CategoryResults::categoryIndex() const
53 return m_categoryIndex;
56void CategoryResults::setCategoryIndex(int index)
58 if (m_categoryIndex != index) {
59 m_categoryIndex = index;
60 Q_EMIT categoryIndexChanged(m_categoryIndex);
65CategoryResults::roleNames() const
71CategoryResults::data(const QModelIndex& index, int role) const
73 if (!index.isValid()) {
79 return DeeListModel::data(index, ResultsColumn::URI);
81 QString giconString(DeeListModel::data(index, ResultsColumn::ICON_HINT).toString());
82 return QVariant::fromValue(gIconToDeclarativeImageProviderString(giconString));
85 return DeeListModel::data(index, ResultsColumn::CATEGORY);
87 return DeeListModel::data(index, ResultsColumn::MIMETYPE);
89 return DeeListModel::data(index, ResultsColumn::TITLE);
91 return DeeListModel::data(index, ResultsColumn::COMMENT);
93 return DeeListModel::data(index, ResultsColumn::DND_URI);
95 return DeeListModel::data(index, ResultsColumn::METADATA);
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