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"
21#include <unitymenumodel.h>
23SharedUnityMenuModel::SharedUnityMenuModel(QObject* parent)
28QByteArray SharedUnityMenuModel::busName() const
33void SharedUnityMenuModel::setBusName(const QByteArray& busName)
35 if (m_busName != busName) {
37 Q_EMIT busNameChanged();
42QByteArray SharedUnityMenuModel::menuObjectPath() const
44 return m_menuObjectPath;
47void SharedUnityMenuModel::setMenuObjectPath(const QByteArray& menuObjectPath)
49 if (m_menuObjectPath != menuObjectPath) {
50 m_menuObjectPath = menuObjectPath;
51 Q_EMIT menuObjectPathChanged();
56QVariantMap SharedUnityMenuModel::actions() const
61void SharedUnityMenuModel::setActions(const QVariantMap& actions)
63 if (m_actions != actions) {
65 Q_EMIT actionsChanged();
70UnityMenuModel* SharedUnityMenuModel::model() const
72 return m_model ? m_model.data() : nullptr;
75void SharedUnityMenuModel::initialize()
77 if (m_busName.isEmpty() || m_menuObjectPath.isEmpty() || m_actions.isEmpty()) {
78 if (!m_model.isNull()) {
80 Q_EMIT modelChanged();
83 QSharedPointer<UnityMenuModel> model = UnityMenuModelCache::singleton()->model(m_menuObjectPath);
85 if (model != m_model) {
86 if (model->busName() != m_busName) model->setBusName(m_busName);
87 if (model->actions() != m_actions) model->setActions(m_actions);
90 Q_EMIT modelChanged();
92 if (m_model->busName() != m_busName) m_model->setBusName(m_busName);
93 if (m_model->actions() != m_actions) m_model->setActions(m_actions);
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