20 #include "launcheritem.h"
21 #include "quicklistmodel.h"
25 LauncherItem::LauncherItem(
const QString &appId,
const QString &name,
const QString &icon, QObject *parent) :
26 LauncherItemInterface(parent),
36 m_quickList(new QuickListModel(this))
38 QuickListEntry nameAction;
39 nameAction.setActionId(
"launch_item");
40 nameAction.setText(m_name);
41 m_quickList->appendAction(nameAction);
42 QuickListEntry pinningAction;
43 pinningAction.setActionId(
"pin_item");
44 pinningAction.setText(gettext(
"Pin shortcut"));
45 m_quickList->appendAction(pinningAction);
48 QString LauncherItem::appId()
const
53 QString LauncherItem::name()
const
58 QString LauncherItem::icon()
const
63 bool LauncherItem::pinned()
const
68 void LauncherItem::setPinned(
bool pinned)
70 if (m_pinned != pinned) {
73 entry.setActionId(
"pin_item");
74 entry.setText(pinned ? gettext(
"Unpin shortcut") : gettext(
"Pin shortcut"));
75 m_quickList->updateAction(entry);
76 Q_EMIT pinnedChanged(pinned);
80 bool LauncherItem::running()
const
85 void LauncherItem::setRunning(
bool running)
87 if (m_running != running) {
89 Q_EMIT runningChanged(running);
93 bool LauncherItem::recent()
const
98 void LauncherItem::setRecent(
bool recent)
100 if (m_recent != recent) {
102 Q_EMIT recentChanged(recent);
106 int LauncherItem::progress()
const
111 void LauncherItem::setProgress(
int progress)
113 if (m_progress != progress) {
114 m_progress = progress;
115 Q_EMIT progressChanged(progress);
119 int LauncherItem::count()
const
124 void LauncherItem::setCount(
int count)
126 if (m_count != count) {
128 Q_EMIT countChanged(count);
132 bool LauncherItem::focused()
const
137 void LauncherItem::setFocused(
bool focused)
139 if (m_focused != focused) {
141 Q_EMIT focusedChanged(focused);
145 unity::shell::launcher::QuickListModelInterface *LauncherItem::quickList()
const