Bug 482376 - QStringList Settings::defaultIgnoreList() in src/core/settings.cpp contains old entries that are hardcoded
Summary: QStringList Settings::defaultIgnoreList() in src/core/settings.cpp contains o...
Status: REPORTED
Alias: None
Product: frameworks-sonnet
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 6.0.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Martin Sandsmark
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-04 12:38 UTC by Marie Loise Nolden
Modified: 2024-03-04 13:33 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
this is how it should look like when the list is only filled with own entries (87.89 KB, image/png)
2024-03-04 12:40 UTC, Marie Loise Nolden
Details

Note You need to log in before you can comment on or make changes to this bug.
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