Commit 065a0fcf authored by Fabian Vogt's avatar Fabian Vogt
Browse files

Fix editing items in SimpleFavoritesModel

Summary:
tools.js is supposed to support both KaStatsFavoritesModel (used for
favorite applications) and SimpleFavoritesModel (used for system actions,
like poweroff/reboot/logout). The latter did not work though, as tools.js
unconditionally calls methods only present in KaStatsFavoritesModel.
This commit makes KaStatsFavoritesModel API compatible to SimpleFavoritesModel
and changes the relevant code in tools.js to support both.

Additionally, this syncs applets/kickoff/package/contents/code/tools.js again.

BUG: 385463

Test Plan:
Before this patch it wasn't possible to remove system actions from
the favorites bar.

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: hein, davidedmundson, rikmills, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D8178
parent c311339e
......@@ -570,13 +570,13 @@ void KAStatsFavoritesModel::portOldFavorites(const QStringList &ids)
void KAStatsFavoritesModel::addFavorite(const QString &id, int index)
{
DEBUG << "addFavorite" << id << index << " -->";
addFavoriteTo(id, Activity::current(), index);
addFavoriteTo(id, QStringLiteral(":global"));
}
void KAStatsFavoritesModel::removeFavorite(const QString &id)
{
DEBUG << "removeFavorite" << id << " -->";
removeFavoriteFrom(id, Activity::current());
removeFavoriteFrom(id, QStringLiteral(":any"));
}
void KAStatsFavoritesModel::addFavoriteTo(const QString &id, const QString &activityId, int index)
......
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