2 * Copyright (C) 2015 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17#include "fake_optionselectoroptions.h"
19#include "fake_optionselectorfilter.h"
21FakeOptionSelectorOptions::FakeOptionSelectorOptions(const QStringList &optionLabels, FakeOptionSelectorFilter* parent)
22 : unity::shell::scopes::OptionSelectorOptionsInterface(parent),
23 m_optionLabels(optionLabels)
27int FakeOptionSelectorOptions::rowCount(const QModelIndex &parent) const
32 return m_optionLabels.count();
35QVariant FakeOptionSelectorOptions::data(const QModelIndex &index, int role) const
37 const int row = index.row();
38 if (row < 0 || row >= m_optionLabels.count())
43 return static_cast<FakeOptionSelectorFilter*>(parent())->filterId() + QString::number(row);
45 return m_optionLabels[row];
46 case RoleOptionChecked:
47 return m_checkedIndexes.contains(row);
54void FakeOptionSelectorOptions::setChecked(int row, bool checked)
57 m_checkedIndexes << row;
59 m_checkedIndexes.remove(row);
61 const QModelIndex idx = index(row, 0);
62 Q_EMIT dataChanged(idx, idx, QVector<int>() << RoleOptionChecked);
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