on xenial help sign in
Always save stored apps list to storage, rather than just when a pinned app is turned off -- apps may have just changed order
b700d05Michael Terry
plugins/Unity/Launcher/backend/launcherbackend.cpp+2−17
@@ -58,36 +58,21 @@ QStringList LauncherBackend::storedApplications() const
58
58
59void LauncherBackend::setStoredApplications(const QStringList &appIds)
59void LauncherBackend::setStoredApplications(const QStringList &appIds)
60{
60{
61− // Are we dropping any pinned apps?
61+ // Record all existing pinned apps, so we can notice them in new list
62− auto needToSync = false;
63 auto pinnedItems = QStringList();
62 auto pinnedItems = QStringList();
64 for (LauncherBackendItem &app: m_storedApps) {
63 for (LauncherBackendItem &app: m_storedApps) {
65 if (app.pinned) {
64 if (app.pinned) {
66− auto found = false;
67− for (const QString &appId: appIds) {
68− auto fullAppId = desktopFile(appId);
69− if (app.settings->fileName() == fullAppId) {
70− found = true;
71− break;
72− }
73− }
74− if (!found) {
75− needToSync = true;
76− }
77 pinnedItems.append(app.settings->fileName());
65 pinnedItems.append(app.settings->fileName());
78 }
66 }
79 }
67 }
80
68
81 clearItems();
69 clearItems();
82
70
83−
84 for (const QString &appId: appIds) {
71 for (const QString &appId: appIds) {
85 loadDesktopFile(appId, pinnedItems.contains(desktopFile(appId)));
72 loadDesktopFile(appId, pinnedItems.contains(desktopFile(appId)));
86 }
73 }
87
74
88− if (needToSync) {
89− syncToAccounts();
75+ syncToAccounts();
90− }
91}
76}
92
77
93QString LauncherBackend::desktopFile(const QString &appId) const
78QString LauncherBackend::desktopFile(const QString &appId) const