Commit daebf5ae authored by Marco Martin's avatar Marco Martin

cleanup not found favorites

parent 13500ee9
......@@ -121,6 +121,7 @@ void ApplicationListModel::loadApplications()
QMap<int, ApplicationData> orderedList;
QList<ApplicationData> unorderedList;
QSet<QString> foundFavorites;
// Iterate over all entries in the group
while (!subGroupList.isEmpty()) {
......@@ -159,6 +160,7 @@ void ApplicationListModel::loadApplications()
if (m_favorites.contains(data.storageId)) {
data.location = Favorites;
foundFavorites.insert(data.storageId);
} else if (m_desktopItems.contains(data.storageId)) {
data.location = Desktop;
}
......@@ -186,6 +188,18 @@ void ApplicationListModel::loadApplications()
endResetModel();
emit countChanged();
bool favChanged = false;
for (const auto &item : m_favorites) {
if (!foundFavorites.contains(item)) {
favChanged = true;
m_favorites.removeAll(item);
}
}
if (favChanged) {
m_homeScreen->config().writeEntry("Favorites", m_favorites);
emit favoriteCountChanged();
}
}
QVariant ApplicationListModel::data(const QModelIndex &index, int role) const
......
applet.wallpaperPlugin = 'org.kde.image'
applet.writeConfig("AppOrder", ["org.kde.phone.dialer.desktop", "org.kde.mobile.angelfish.desktop", "org.kde.phone.calindori.desktop", "org.kde.mobile.camera.desktop"])
applet.writeConfig("Favorites", ["org.kde.phone.dialer.desktop", "org.kde.mobile.angelfish.desktop", "org.kde.phone.calindori.desktop", "org.kde.mobile.camera.desktop"])
applet.writeConfig("AppOrder", ["org.kde.phone.dialer.desktop", "org.kde.phonebook.desktop", "org.kde.mobile.angelfish.desktop", "org.kde.mobile.camera.desktop"])
applet.writeConfig("Favorites", ["org.kde.phone.dialer.desktop", "org.kde.phonebook.desktop", "org.kde.mobile.angelfish.desktop", "org.kde.mobile.camera.desktop"])
applet.reloadConfig()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment