on 1a63151 help sign in
unity8/plugins/Unity/Launcher/launcheritem.cpp
120 lines 2.4 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"
22LauncherItem::LauncherItem(const QString &appId, const QString &desktopFile, const QString &name, const QString &icon, QObject *parent) :
23 LauncherItemInterface(parent),
24 m_appId(appId),
25 m_desktopFile(desktopFile),
26 m_name(name),
27 m_icon(icon),
28 m_favorite(false),
29 m_running(false),
30 m_recent(false),
31 m_progress(-1),
32 m_count(0)
37QString LauncherItem::appId()
39 return m_appId;
42QString LauncherItem::desktopFile() const
44 return m_desktopFile;
47QString LauncherItem::name() const
49 return m_name;
52QString LauncherItem::icon() const
54 return m_icon;
57bool LauncherItem::favorite() const
59 return m_favorite;
62void LauncherItem::setFavorite(bool favorite)
64 if (m_favorite != favorite) {
65 m_favorite = favorite;
66 Q_EMIT favoriteChanged(favorite);
67 }
70bool LauncherItem::running() const
72 return m_running;
75void LauncherItem::setRunning(bool running)
77 if (m_running != running) {
78 m_running = running;
79 Q_EMIT runningChanged(running);
80 }
83bool LauncherItem::recent() const
85 return m_recent;
88void LauncherItem::setRecent(bool recent)
90 if (m_recent != recent) {
91 m_recent = recent;
92 Q_EMIT recentChanged(recent);
93 }
96int LauncherItem::progress() const
98 return m_progress;
101void LauncherItem::setProgress(int progress)
103 if (m_progress != progress) {
104 m_progress = progress;
105 Q_EMIT progressChanged(progress);
106 }
109int LauncherItem::count() const
111 return m_count;
114void LauncherItem::setCount(int count)
116 if (m_count != count) {
117 m_count = count;
118 Q_EMIT countChanged(count);
119 }