Skip to content

Commit

Permalink
FancyMenu: fix favorites in config file
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgit committed Feb 1, 2024
1 parent 7f11c80 commit 15c2e31
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugin-fancymenu/lxqtfancymenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,18 @@ void LXQtFancyMenu::saveFavorites()
const QStringList fileList = mWindow->favorites();

QList<QMap<QString, QVariant> > list;
list.reserve(fileList.size());

for(const QString& file : fileList)
{
QMap<QString, QVariant> item;
item.insert(QStringLiteral("desktopFile"), file);
list.append(item);
}

// HACK: force Qt to clear old array and rewrite it
// Otherwise it would leave garbage values inside it.
settings()->remove(QStringLiteral("favorites"));
settings()->setArray(QStringLiteral("favorites"), list);
}

Expand Down

0 comments on commit 15c2e31

Please sign in to comment.