on xenial help sign in
drop dbusinterface changes
d5c26b5Lukáš Tinkl
plugins/Unity/Launcher/dbusinterface.cpp−9
@@ -164,8 +164,6 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
164 retval.append(QVariant::fromValue(QDBusVariant(item->count())));
164 retval.append(QVariant::fromValue(QDBusVariant(item->count())));
165 } else if (message.arguments()[1].toString() == "countVisible") {
165 } else if (message.arguments()[1].toString() == "countVisible") {
166 retval.append(QVariant::fromValue(QDBusVariant(item->countVisible())));
166 retval.append(QVariant::fromValue(QDBusVariant(item->countVisible())));
167− } else if (message.arguments()[1].toString() == "running") {
168− retval.append(QVariant::fromValue(QDBusVariant(item->running())));
169 }
167 }
170 } else if (message.member() == "Set") {
168 } else if (message.member() == "Set") {
171 if (message.arguments()[1].toString() == "count") {
169 if (message.arguments()[1].toString() == "count") {
@@ -180,19 +178,12 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
180 Q_EMIT countVisibleChanged(appid, newVisible);
178 Q_EMIT countVisibleChanged(appid, newVisible);
181 notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "countVisible", newVisible);
179 notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "countVisible", newVisible);
182 }
180 }
183− } else if (message.arguments()[1].toString() == "running") {
184− bool newRunning = message.arguments()[2].value<QDBusVariant>().variant().toBool();
185− if (!item || newRunning != item->running()) {
186− Q_EMIT runningChanged(appid, newRunning);
187− notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "running", newRunning);
188− }
189 }
181 }
190 } else if (message.member() == "GetAll") {
182 } else if (message.member() == "GetAll") {
191 if (item) {
183 if (item) {
192 QVariantMap all;
184 QVariantMap all;
193 all.insert("count", item->count());
185 all.insert("count", item->count());
194 all.insert("countVisible", item->countVisible());
186 all.insert("countVisible", item->countVisible());
195− all.insert("running", item->running());
196 retval.append(all);
187 retval.append(all);
197 }
188 }
198 } else {
189 } else {
plugins/Unity/Launcher/dbusinterface.h−1
@@ -36,7 +36,6 @@ public:
36Q_SIGNALS:
36Q_SIGNALS:
37 void countChanged(const QString &appId, int count);
37 void countChanged(const QString &appId, int count);
38 void countVisibleChanged(const QString &appId, bool countVisible);
38 void countVisibleChanged(const QString &appId, bool countVisible);
39− void runningChanged(const QString &appId, bool running);
40 void refreshCalled();
39 void refreshCalled();
41
40
42private:
41private:
plugins/Unity/Launcher/launchermodel.cpp+3−13
@@ -40,7 +40,6 @@ LauncherModel::LauncherModel(QObject *parent):
40{
40{
41 connect(m_dbusIface, &DBusInterface::countChanged, this, &LauncherModel::countChanged);
41 connect(m_dbusIface, &DBusInterface::countChanged, this, &LauncherModel::countChanged);
42 connect(m_dbusIface, &DBusInterface::countVisibleChanged, this, &LauncherModel::countVisibleChanged);
42 connect(m_dbusIface, &DBusInterface::countVisibleChanged, this, &LauncherModel::countVisibleChanged);
43− connect(m_dbusIface, &DBusInterface::runningChanged, this, &LauncherModel::runningChanged);
44 connect(m_dbusIface, &DBusInterface::refreshCalled, this, &LauncherModel::refresh);
43 connect(m_dbusIface, &DBusInterface::refreshCalled, this, &LauncherModel::refresh);
45
44
46 connect(m_settings, &GSettings::changed, this, &LauncherModel::refresh);
45 connect(m_settings, &GSettings::changed, this, &LauncherModel::refresh);
@@ -198,7 +197,9 @@ void LauncherModel::quickListActionInvoked(const QString &appId, int actionIndex
198 } else if (actionId == "launch_item") {
197 } else if (actionId == "launch_item") {
199 QDesktopServices::openUrl(getUrlForAppId(appId));
198 QDesktopServices::openUrl(getUrlForAppId(appId));
200 } else if (actionId == "stop_item") { // Quit
199 } else if (actionId == "stop_item") { // Quit
200+ if (m_appManager) {
201− m_appManager->stopApplication(appId);
201+ m_appManager->stopApplication(appId);
202+ }
202 // Nope, we don't know this action, let the backend forward it to the application
203 // Nope, we don't know this action, let the backend forward it to the application
203 } else {
204 } else {
204 // TODO: forward quicklist action to app, possibly via m_dbusIface
205 // TODO: forward quicklist action to app, possibly via m_dbusIface
@@ -335,17 +336,6 @@ void LauncherModel::progressChanged(const QString &appId, int progress)
335 }
336 }
336}
337}
337
338
338−void LauncherModel::runningChanged(const QString &appId, bool running)
339−{
340− const int idx = findApplication(appId);
341− if (idx >= 0) {
342− LauncherItem *item = m_list.at(idx);
343− item->setRunning(running);
344− m_asAdapter->syncItems(m_list);
345− Q_EMIT dataChanged(index(idx), index(idx), {RoleRunning});
346− }
347−}
348−
349void LauncherModel::countChanged(const QString &appId, int count)
339void LauncherModel::countChanged(const QString &appId, int count)
350{
340{
351 const int idx = findApplication(appId);
341 const int idx = findApplication(appId);
plugins/Unity/Launcher/launchermodel.h−1
@@ -73,7 +73,6 @@ private Q_SLOTS:
73 void countChanged(const QString &appId, int count);
73 void countChanged(const QString &appId, int count);
74 void countVisibleChanged(const QString &appId, int count);
74 void countVisibleChanged(const QString &appId, int count);
75 void progressChanged(const QString &appId, int progress);
75 void progressChanged(const QString &appId, int progress);
76− void runningChanged(const QString &appId, bool running);
77
76
78 void applicationAdded(const QModelIndex &parent, int row);
77 void applicationAdded(const QModelIndex &parent, int row);
79 void applicationRemoved(const QModelIndex &parent, int row);
78 void applicationRemoved(const QModelIndex &parent, int row);