2 * Copyright 2014-2015 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/>.
17#include "launcheritem.h"
18#include "quicklistmodel.h"
22LauncherItem::LauncherItem(const QString &appId, const QString &name, const QString &icon, QObject *parent) :
23 LauncherItemInterface(parent),
32 m_countVisible(false),
36 m_quickList(new QuickListModel(this))
38 QuickListEntry nameAction;
39 nameAction.setActionId(QStringLiteral("launch_item"));
40 nameAction.setText(m_name);
41 m_quickList->appendAction(nameAction);
44QString LauncherItem::appId() const
49QString LauncherItem::name() const
54void LauncherItem::setName(const QString &name)
59 entry.setActionId(QStringLiteral("launch_item"));
60 entry.setText(m_name);
61 m_quickList->updateAction(entry);
62 Q_EMIT nameChanged(name);
66QString LauncherItem::icon() const
71void LauncherItem::setIcon(const QString &icon)
75 Q_EMIT iconChanged(icon);
79QStringList LauncherItem::keywords() const
84void LauncherItem::setKeywords(const QStringList &keywords)
86 if (m_keywords != keywords) {
87 m_keywords = keywords;
88 Q_EMIT keywordsChanged(keywords);
92bool LauncherItem::pinned() const
97void LauncherItem::setPinned(bool pinned)
99 if (m_pinned != pinned) {
101 Q_EMIT pinnedChanged(pinned);
105bool LauncherItem::running() const
110void LauncherItem::setRunning(bool running)
112 if (m_running != running) {
114 Q_EMIT runningChanged(running);
118bool LauncherItem::recent() const
123void LauncherItem::setRecent(bool recent)
125 if (m_recent != recent) {
127 Q_EMIT recentChanged(recent);
131int LauncherItem::progress() const
136void LauncherItem::setProgress(int progress)
138 if (m_progress != progress) {
139 m_progress = progress;
140 Q_EMIT progressChanged(progress);
144int LauncherItem::count() const
149void LauncherItem::setCount(int count)
151 if (m_count != count) {
153 Q_EMIT countChanged(count);
157bool LauncherItem::countVisible() const
159 return m_countVisible;
162void LauncherItem::setCountVisible(bool countVisible)
164 if (m_countVisible != countVisible) {
165 m_countVisible = countVisible;
166 Q_EMIT countVisibleChanged(countVisible);
170bool LauncherItem::focused() const
175void LauncherItem::setFocused(bool focused)
177 if (m_focused != focused) {
179 Q_EMIT focusedChanged(focused);
183bool LauncherItem::alerting() const
188void LauncherItem::setAlerting(bool alerting)
190 if (m_alerting != alerting) {
191 m_alerting = alerting;
192 Q_EMIT alertingChanged(alerting);
196int LauncherItem::surfaceCount() const
198 return m_surfaceCount;
201void LauncherItem::setSurfaceCount(int surfaceCount)
203 if (m_surfaceCount != surfaceCount) {
204 m_surfaceCount = surfaceCount;
205 Q_EMIT surfaceCountChanged(surfaceCount);
209unity::shell::launcher::QuickListModelInterface *LauncherItem::quickList() const
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