on xenial help sign in
remove debug prints, add a comment
81cfa93Michael Zanetti
plugins/Unity/Launcher/backend/launcherbackend.cpp+1−1
@@ -224,6 +224,7 @@ void LauncherBackend::syncFromAccounts()
224 Q_FOREACH(const QString &entry, gSettings.get("favorites").toStringList()) {
224 Q_FOREACH(const QString &entry, gSettings.get("favorites").toStringList()) {
225 if (entry.startsWith("application://")) {
225 if (entry.startsWith("application://")) {
226 QString appId = entry;
226 QString appId = entry;
227+ // Transform "application://foobar.desktop" to "foobar"
227 appId.remove("application://");
228 appId.remove("application://");
228 if (appId.endsWith(".desktop")) {
229 if (appId.endsWith(".desktop")) {
229 appId.chop(8);
230 appId.chop(8);
@@ -278,7 +279,6 @@ QString LauncherBackend::findDesktopFile(const QString &appId) const
278 }
279 }
279
280
280 Q_FOREACH(const QString &searchDir, searchDirs) {
281 Q_FOREACH(const QString &searchDir, searchDirs) {
281− qDebug() << "searching for desktop file:" << searchDir << helper + ".desktop";
282 QFileInfo fileInfo(QDir(searchDir), helper + ".desktop");
282 QFileInfo fileInfo(QDir(searchDir), helper + ".desktop");
283 if (fileInfo.exists()) {
283 if (fileInfo.exists()) {
284 return fileInfo.absoluteFilePath();
284 return fileInfo.absoluteFilePath();
plugins/Unity/Launcher/launchermodel.cpp−6
@@ -21,8 +21,6 @@
21#include "launcheritem.h"
21#include "launcheritem.h"
22#include "backend/launcherbackend.h"
22#include "backend/launcherbackend.h"
23
23
24−#include <QDebug>
25−
26LauncherModel::LauncherModel(QObject *parent):
24LauncherModel::LauncherModel(QObject *parent):
27 LauncherModelInterface(parent),
25 LauncherModelInterface(parent),
28 m_backend(new LauncherBackend(true, this))
26 m_backend(new LauncherBackend(true, this))
@@ -217,11 +215,8 @@ void LauncherModel::applicationFocused(const QString &appId)
217 }
215 }
218
216
219 int index = findApplication(helper);
217 int index = findApplication(helper);
220− qDebug() << "################## found focused app index" << index << helper;
221−
222 if (index >= 0) {
218 if (index >= 0) {
223 m_list.at(index)->setFocused(true);
219 m_list.at(index)->setFocused(true);
224− qDebug() << "set focused to true on" << m_list.at(index)->name();
225 Q_EMIT dataChanged(this->index(index), this->index(index), QVector<int>() << RoleFocused);
220 Q_EMIT dataChanged(this->index(index), this->index(index), QVector<int>() << RoleFocused);
226 } else {
221 } else {
227 // Add app to recent apps
222 // Add app to recent apps
@@ -270,7 +265,6 @@ int LauncherModel::findApplication(const QString &appId)
270{
265{
271 for (int i = 0; i < m_list.count(); ++i) {
266 for (int i = 0; i < m_list.count(); ++i) {
272 LauncherItem *item = m_list.at(i);
267 LauncherItem *item = m_list.at(i);
273− qDebug() << "checking app" << item->appId();
274 if (item->appId() == appId) {
268 if (item->appId() == appId) {
275 return i;
269 return i;
276 }
270 }