Commit 08e1e3a4 authored by Jonah Brüchert's avatar Jonah Brüchert 🌳 Committed by Bhushan Shah

Port away from deprecated features of QSet

parent 40ece808
......@@ -51,7 +51,12 @@ ApplicationListModel::~ApplicationListModel()
void ApplicationListModel::loadSettings()
{
m_favorites = m_homeScreen->config().readEntry("Favorites", QStringList());
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
m_desktopItems = QSet<QString>(m_homeScreen->config().readEntry("DesktopItems", QStringList()).begin(),
m_homeScreen->config().readEntry("DesktopItems", QStringList()).end());
#else
m_desktopItems = m_homeScreen->config().readEntry("DesktopItems", QStringList()).toSet();
#endif
m_appOrder = m_homeScreen->config().readEntry("AppOrder", QStringList());
m_maxFavoriteCount = m_homeScreen->config().readEntry("MaxFavoriteCount", 5);
......@@ -264,12 +269,12 @@ void ApplicationListModel::setLocation(int row, LauncherLocation location)
// In Desktop
if (location == Desktop) {
m_desktopItems.insert(data.storageId);
m_homeScreen->config().writeEntry("DesktopItems", m_desktopItems.toList());
m_homeScreen->config().writeEntry("DesktopItems", m_desktopItems.values());
// Out of Desktop
} else if (data.location == Desktop) {
m_desktopItems.remove(data.storageId);
m_homeScreen->config().writeEntry("DesktopItems", m_desktopItems.toList());
m_homeScreen->config().writeEntry("DesktopItems", m_desktopItems.values());
}
data.location = location;
......
......@@ -24,6 +24,7 @@
#include <QObject>
#include <QAbstractListModel>
#include <QList>
#include <QSet>
#include "homescreen.h"
......
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