Bug 482376

Summary: QStringList Settings::defaultIgnoreList() in src/core/settings.cpp contains old entries that are hardcoded
Product: [Frameworks and Libraries] frameworks-sonnet Reporter: Marie Loise Nolden <loise>
Component: generalAssignee: Martin Sandsmark <martin.sandsmark>
Status: REPORTED ---    
Severity: normal CC: kdelibs-bugs-null, loise
Priority: NOR Keywords: qt6
Version First Reported In: 6.0.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: this is how it should look like when the list is only filled with own entries

Description Marie Loise Nolden 2024-03-04 12:38:33 UTC
SUMMARY

QStringList Settings::defaultIgnoreList() in src/core/settings.cpp contains old entries that are hardcoded:

// default values
// A static list of KDE specific words that we want to recognize
QStringList Settings::defaultIgnoreList()
{
    QStringList l;
    l.append(QStringLiteral("KMail"));
    l.append(QStringLiteral("KOrganizer"));
    l.append(QStringLiteral("KAddressBook"));
    l.append(QStringLiteral("KHTML"));
    l.append(QStringLiteral("KIO"));
    l.append(QStringLiteral("KJS"));
    l.append(QStringLiteral("Konqueror"));
    l.append(QStringLiteral("Sonnet"));
    l.append(QStringLiteral("Kontact"));
    l.append(QStringLiteral("Qt"));
    l.append(QStringLiteral("Okular"));
    l.append(QStringLiteral("KMix"));
    l.append(QStringLiteral("Amarok"));
    l.append(QStringLiteral("KDevelop"));
    l.append(QStringLiteral("Nepomuk"));
    return l;
}

Those are visible in the systemsetting module and can be removed but are instantly there when the systemsettings is re-opened.

The function is only used in
QStringList Settings::defaultIgnoreList() in src/core/settings.cpp contains old entries that are hardcoded

// default values
// A static list of KDE specific words that we want to recognize
QStringList Settings::defaultIgnoreList()
{
    QStringList l;
    l.append(QStringLiteral("KMail"));
    l.append(QStringLiteral("KOrganizer"));
    l.append(QStringLiteral("KAddressBook"));
    l.append(QStringLiteral("KHTML"));
    l.append(QStringLiteral("KIO"));
    l.append(QStringLiteral("KJS"));
    l.append(QStringLiteral("Konqueror"));
    l.append(QStringLiteral("Sonnet"));
    l.append(QStringLiteral("Kontact"));
    l.append(QStringLiteral("Qt"));
    l.append(QStringLiteral("Okular"));
    l.append(QStringLiteral("KMix"));
    l.append(QStringLiteral("Amarok"));
    l.append(QStringLiteral("KDevelop"));
    l.append(QStringLiteral("Nepomuk"));
    return l;
}

Those are visible in the systemsetting module and can be removed but are instantly there when the systemsettings is re-opened.

The function is only used in
src/core/settingsimpl.cpp:    const QStringList ignores = settings.value(ignoreEntry, Settings::defaultIgnoreList()).toStringList();

so only returning an empty default (initial) list is the desired behavior.

STEPS TO REPRODUCE
1. Open Systemsettings, spellchecking
2. see the list hardcoded above, remove items
3. re-open systemsettings, entries are back


OBSERVED RESULT
Filled list with constant values

EXPECTED RESULT
Empty list

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 6.0.0
(available in About System)
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION

The error is also visible in all versions back to kf5, so it (should) be removed there, too.
Comment 1 Marie Loise Nolden 2024-03-04 12:40:55 UTC
Created attachment 166394 [details]
this is how it should look like when the list is only filled with own entries