Commit 646bd3ee authored by Ahmad Samir's avatar Ahmad Samir

[SpellChecking KCM] Fix the build

Summary:
QList/QSet iterator-based ctors are available since Qt 5.14, so we
could make the code conditional based on that to keep it building
against older Qt versions. However I think the reason behind converting
from QStringList to QSet was to remove duplicates, so use
QStringList::removeDuplicates() and sort() instead.

Bump KF5 min. required version to 5.69.0 because of Sonnet/ConfigView
which first appeared in that version.

Test Plan: make && ctest

Reviewers: #plasma, bport, meven, crossi, ervin, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, bcooksley, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28232
parent 1bc203d7
......@@ -6,7 +6,7 @@ set(PROJECT_VERSION "5.18.80")
set(PROJECT_VERSION_MAJOR 5)
set(QT_MIN_VERSION "5.12.0")
set(KF5_MIN_VERSION "5.66.0")
set(KF5_MIN_VERSION "5.69.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
......
......@@ -53,22 +53,34 @@ void SonnetSpellCheckingModule::stateChanged()
bool unmanagedDefaultState = true;
QStringList refIgnoreList(m_skeleton->ignoreList());
refIgnoreList.removeDuplicates();
refIgnoreList.sort();
QStringList currentIgnoreList(m_configWidget->ignoreList());
currentIgnoreList.removeDuplicates();
currentIgnoreList.sort();
QStringList defaultIgnoreList(Sonnet::Settings::defaultIgnoreList());
QSet<QString> refIgnoreSet(refIgnoreList.begin(), refIgnoreList.end());
QSet<QString> currentIgnoreSet(currentIgnoreList.begin(), currentIgnoreList.end());
QSet<QString> defaultIgnoreSet(defaultIgnoreList.begin(), defaultIgnoreList.end());
unmanagedChangeState |= currentIgnoreSet != refIgnoreSet;
unmanagedDefaultState &= currentIgnoreSet == defaultIgnoreSet;
defaultIgnoreList.removeDuplicates();
defaultIgnoreList.sort();
unmanagedChangeState |= currentIgnoreList != refIgnoreList;
unmanagedDefaultState &= currentIgnoreList == defaultIgnoreList;
QStringList refPreferredLanguagesList(m_skeleton->preferredLanguages());
refPreferredLanguagesList.removeDuplicates();
refPreferredLanguagesList.sort();
QStringList currentPreferredLanguagesList(m_configWidget->preferredLanguages());
currentPreferredLanguagesList.removeDuplicates();
currentPreferredLanguagesList.sort();
QStringList defaultPreferredLanguagesList(Sonnet::Settings::defaultPreferredLanguages());
QSet<QString> refPreferredLanguages(refPreferredLanguagesList.begin(), refPreferredLanguagesList.end());
QSet<QString> currentPreferredLanguages(currentPreferredLanguagesList.begin(), currentPreferredLanguagesList.end());
QSet<QString> defaultPreferredLanguages(defaultPreferredLanguagesList.begin(), defaultPreferredLanguagesList.end());
unmanagedChangeState |= currentPreferredLanguages != refPreferredLanguages;
unmanagedDefaultState &= currentPreferredLanguages == defaultPreferredLanguages;
defaultPreferredLanguagesList.removeDuplicates();
defaultPreferredLanguagesList.sort();
unmanagedChangeState |= currentPreferredLanguagesList != refPreferredLanguagesList;
unmanagedDefaultState &= currentPreferredLanguagesList == defaultPreferredLanguagesList;
unmanagedChangeState |= m_skeleton->defaultLanguage() != m_configWidget->language();
unmanagedDefaultState &= m_configWidget->language() == Sonnet::Settings::defaultDefaultLanguage();
......
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