17 #include "launcheritem.h" 18 #include "quicklistmodel.h" 22 LauncherItem::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);
44 QString LauncherItem::appId()
const 49 QString LauncherItem::name()
const 54 void 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);
66 QString LauncherItem::icon()
const 71 void LauncherItem::setIcon(
const QString &icon)
75 Q_EMIT iconChanged(icon);
79 QStringList LauncherItem::keywords()
const 84 void LauncherItem::setKeywords(
const QStringList &keywords)
86 if (m_keywords != keywords) {
87 m_keywords = keywords;
88 Q_EMIT keywordsChanged(keywords);
92 uint LauncherItem::popularity()
const 98 bool LauncherItem::pinned()
const 103 void LauncherItem::setPinned(
bool pinned)
105 if (m_pinned != pinned) {
107 Q_EMIT pinnedChanged(pinned);
111 bool LauncherItem::running()
const 116 void LauncherItem::setRunning(
bool running)
118 if (m_running != running) {
120 Q_EMIT runningChanged(running);
124 bool LauncherItem::recent()
const 129 void LauncherItem::setRecent(
bool recent)
131 if (m_recent != recent) {
133 Q_EMIT recentChanged(recent);
137 int LauncherItem::progress()
const 142 void LauncherItem::setProgress(
int progress)
144 if (m_progress != progress) {
145 m_progress = progress;
146 Q_EMIT progressChanged(progress);
150 int LauncherItem::count()
const 155 void LauncherItem::setCount(
int count)
157 if (m_count != count) {
159 Q_EMIT countChanged(count);
163 bool LauncherItem::countVisible()
const 165 return m_countVisible;
168 void LauncherItem::setCountVisible(
bool countVisible)
170 if (m_countVisible != countVisible) {
171 m_countVisible = countVisible;
172 Q_EMIT countVisibleChanged(countVisible);
176 bool LauncherItem::focused()
const 181 void LauncherItem::setFocused(
bool focused)
183 if (m_focused != focused) {
185 Q_EMIT focusedChanged(focused);
189 bool LauncherItem::alerting()
const 194 void LauncherItem::setAlerting(
bool alerting)
196 if (m_alerting != alerting) {
197 m_alerting = alerting;
198 Q_EMIT alertingChanged(alerting);
202 int LauncherItem::surfaceCount()
const 204 return m_surfaceCount;
207 void LauncherItem::setSurfaceCount(
int surfaceCount)
209 if (m_surfaceCount != surfaceCount) {
210 m_surfaceCount = surfaceCount;
211 Q_EMIT surfaceCountChanged(surfaceCount);
215 unity::shell::launcher::QuickListModelInterface *LauncherItem::quickList()
const