From 08e1e3a44c0552c107b99e770e1ba3cfdc76ba28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonah=20Br=C3=BCchert?= Date: Fri, 6 Dec 2019 22:04:33 +0100 Subject: [PATCH] Port away from deprecated features of QSet --- containments/homescreen/applicationlistmodel.cpp | 9 +++++++-- containments/homescreen/applicationlistmodel.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/containments/homescreen/applicationlistmodel.cpp b/containments/homescreen/applicationlistmodel.cpp index 776f171d..9391fc1c 100644 --- a/containments/homescreen/applicationlistmodel.cpp +++ b/containments/homescreen/applicationlistmodel.cpp @@ -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(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; diff --git a/containments/homescreen/applicationlistmodel.h b/containments/homescreen/applicationlistmodel.h index af6edeab..c8e913a4 100644 --- a/containments/homescreen/applicationlistmodel.h +++ b/containments/homescreen/applicationlistmodel.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "homescreen.h"