1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Don't list duplicated dictionary directories in preferences

This commit is contained in:
David Rosca 2017-01-14 17:04:34 +01:00
parent 17a90a88e6
commit 4504d750c6

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - Qt web browser
* Copyright (C) 2010-2016 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -414,7 +414,7 @@ Preferences::Preferences(BrowserWindow* window)
const QStringList spellcheckLanguages = settings.value(QSL("Languages")).toStringList(); const QStringList spellcheckLanguages = settings.value(QSL("Languages")).toStringList();
settings.endGroup(); settings.endGroup();
const QStringList dictionariesDirs = { QStringList dictionariesDirs = {
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
QDir::cleanPath(QCoreApplication::applicationDirPath() + QL1S("/../Contents/Resources/qtwebengine_dictionaries")), QDir::cleanPath(QCoreApplication::applicationDirPath() + QL1S("/../Contents/Resources/qtwebengine_dictionaries")),
QDir::cleanPath(QCoreApplication::applicationDirPath() + QL1S("/../Contents/Frameworks/QtWebEngineCore.framework/Resources/qtwebengine_dictionaries")) QDir::cleanPath(QCoreApplication::applicationDirPath() + QL1S("/../Contents/Frameworks/QtWebEngineCore.framework/Resources/qtwebengine_dictionaries"))
@ -423,6 +423,7 @@ Preferences::Preferences(BrowserWindow* window)
QDir::cleanPath(QLibraryInfo::location(QLibraryInfo::DataPath) + QL1S("/qtwebengine_dictionaries")) QDir::cleanPath(QLibraryInfo::location(QLibraryInfo::DataPath) + QL1S("/qtwebengine_dictionaries"))
#endif #endif
}; };
dictionariesDirs.removeDuplicates();
ui->spellcheckDirectories->setText(dictionariesDirs.join(QL1C('\n'))); ui->spellcheckDirectories->setText(dictionariesDirs.join(QL1C('\n')));