2 * Copyright 2014 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "sharedunitymenumodel.h"
19#include "unitymenumodelcache.h"
21SharedUnityMenuModel::SharedUnityMenuModel(QObject* parent)
26QByteArray SharedUnityMenuModel::busName() const
31void SharedUnityMenuModel::setBusName(const QByteArray& busName)
33 if (m_busName != busName) {
35 Q_EMIT busNameChanged();
40QByteArray SharedUnityMenuModel::menuObjectPath() const
42 return m_menuObjectPath;
45void SharedUnityMenuModel::setMenuObjectPath(const QByteArray& menuObjectPath)
47 if (m_menuObjectPath != menuObjectPath) {
48 m_menuObjectPath = menuObjectPath;
49 Q_EMIT menuObjectPathChanged();
54QVariantMap SharedUnityMenuModel::actions() const
59void SharedUnityMenuModel::setActions(const QVariantMap& actions)
61 if (m_actions != actions) {
63 Q_EMIT actionsChanged();
68UnityMenuModel* SharedUnityMenuModel::model() const
70 return m_model ? m_model.data() : nullptr;
73void SharedUnityMenuModel::initialize()
75 if (m_busName.isEmpty() || m_menuObjectPath.isEmpty() || m_actions.isEmpty()) {
76 if (!m_model.isNull()) {
78 Q_EMIT modelChanged();
81 QSharedPointer<UnityMenuModel> model = UnityMenuModelCache::singleton()->model(m_busName, m_menuObjectPath, m_actions);
82 if (model != m_model) {
84 Q_EMIT modelChanged();
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