on dd024c8 help sign in
unity8/plugins/Unity/Launcher/launcheritem.cpp
127 lines 2.6 kB history raw
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * Authors:
5 * Michael Zanetti <michael.zanetti@canonical.com>
6 *
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.
10 *
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.
15 *
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/>.
18 */
20#include "launcheritem.h"
21#include "quicklistmodel.h"
23LauncherItem::LauncherItem(const QString &appId, const QString &desktopFile, const QString &name, const QString &icon, QObject *parent) :
24 LauncherItemInterface(parent),
25 m_appId(appId),
26 m_desktopFile(desktopFile),
27 m_name(name),
28 m_icon(icon),
29 m_pinned(false),
30 m_running(false),
31 m_recent(false),
32 m_progress(-1),
33 m_count(0),
34 m_quickList(new QuickListModel(this))
39QString LauncherItem::appId() const
41 return m_appId;
44QString LauncherItem::desktopFile() const
46 return m_desktopFile;
49QString LauncherItem::name() const
51 return m_name;
54QString LauncherItem::icon() const
56 return m_icon;
59bool LauncherItem::pinned() const
61 return m_pinned;
64void LauncherItem::setPinned(bool pinned)
66 if (m_pinned != pinned) {
67 m_pinned = pinned;
68 Q_EMIT pinnedChanged(pinned);
69 }
72bool LauncherItem::running() const
74 return m_running;
77void LauncherItem::setRunning(bool running)
79 if (m_running != running) {
80 m_running = running;
81 Q_EMIT runningChanged(running);
82 }
85bool LauncherItem::recent() const
87 return m_recent;
90void LauncherItem::setRecent(bool recent)
92 if (m_recent != recent) {
93 m_recent = recent;
94 Q_EMIT recentChanged(recent);
95 }
98int LauncherItem::progress() const
100 return m_progress;
103void LauncherItem::setProgress(int progress)
105 if (m_progress != progress) {
106 m_progress = progress;
107 Q_EMIT progressChanged(progress);
108 }
111int LauncherItem::count() const
113 return m_count;
116void LauncherItem::setCount(int count)
118 if (m_count != count) {
119 m_count = count;
120 Q_EMIT countChanged(count);
121 }
124unity::shell::launcher::QuickListModelInterface *LauncherItem::quickList() const
126 return m_quickList;