@@ -167,16 +167,18 @@ void LauncherBackend::triggerQuickListAction(const QString &appId, const QString
167167void LauncherBackend::syncFromAccounts()
168168{
169169 QList<QVariantMap> apps;
170+ bool defaults = true;
170171
171172 clearItems();
172173
173174 if (m_user != "" && m_accounts != nullptr) {
174175 auto variant = m_accounts->getUserProperty(m_user, "launcher-items");
175− variant.value<QDBusArgument>() >> apps;
176+ apps = qdbus_cast<QList<QVariantMap>>(variant.value<QDBusArgument>());
177+ defaults = isDefaultsItem(apps);
176178 }
177179
178180 // TODO: load default pinned ones from default config, instead of hardcoding here...
179− if (apps.isEmpty()) {
181+ if (defaults) {
180182 apps <<
181183 makeAppDetails("phone-app.desktop", true) <<
182184 makeAppDetails("camera-app.desktop", true) <<
@@ -237,6 +239,14 @@ QVariantMap LauncherBackend::makeAppDetails(const QString &appId, bool pinned) c
237239 return details;
238240}
239241
242+bool LauncherBackend::isDefaultsItem(const QList<QVariantMap> &apps) const
243+{
244+ // To differentiate between an empty list and a list that hasn't been set
245+ // yet (and should thus be populated with the defaults), we use a special
246+ // list of one item with the 'defaults' field set to true.
247+ return (apps.size() == 1 && apps[0].value("defaults").toBool());
248+}
249+
240250int LauncherBackend::findItem(const QString &appId) const
241251{
242252 auto fullAppId = desktopFile(appId);