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

SpellCheck: Fix dictionary directories for macOS

Also show directories in preferences.
This commit is contained in:
David Rosca 2016-10-26 11:36:58 +02:00
parent 81b8adfe95
commit ac160506f6
2 changed files with 69 additions and 51 deletions

View File

@ -409,8 +409,13 @@ Preferences::Preferences(BrowserWindow* window)
settings.endGroup();
const QStringList dictionariesDirs = {
QCoreApplication::applicationDirPath() + QL1S("/qtwebengine_dictionaries"),
QLibraryInfo::location(QLibraryInfo::DataPath) + QL1S("/qtwebengine_dictionaries")
#if Q_OS_OSX
QDir::cleanPath(QCoreApplication::applicationDirPath() + QL1S("/../Contents/Resources/qtwebengine_dictionaries")),
QDir::cleanPath(QCoreApplication::applicationDirPath() + QL1S("/../Contents/Frameworks/QtWebEngineCore.framework/Resources/qtwebengine_dictionaries"))
#else
QDir::cleanPath(QCoreApplication::applicationDirPath() + QL1S("/qtwebengine_dictionaries")),
QDir::cleanPath(QLibraryInfo::location(QLibraryInfo::DataPath) + QL1S("/qtwebengine_dictionaries"))
#endif
};
ui->spellcheckDirectories->setText(dictionariesDirs.join(QL1C('\n')));

View File

@ -2282,6 +2282,19 @@
</widget>
<widget class="QWidget" name="spellcheckPage">
<layout class="QGridLayout" name="gridLayout_20">
<item row="2" column="1">
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Language:</string>
</property>
</widget>
</item>
<item row="2" column="4">
<spacer name="horizontalSpacer_16">
<property name="orientation">
@ -2302,6 +2315,32 @@
</property>
</widget>
</item>
<item row="6" column="1" colspan="4">
<widget class="QLabel" name="label_40">
<property name="text">
<string>For more informations about Spell Check, please see &lt;a href=&quot;https://github.com/QupZilla/qupzilla/wiki/Spell-Check&quot;&gt;wiki&lt;/a&gt;.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="1">
<spacer name="verticalSpacer_17">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="QComboBox" name="spellcheckLanguage"/>
</item>
@ -2321,34 +2360,6 @@
</property>
</spacer>
</item>
<item row="5" column="1" colspan="4">
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="spellcheckDirectories"/>
</item>
</layout>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Language:</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="5">
<widget class="QLabel" name="label_10">
<property name="text">
@ -2370,32 +2381,34 @@
</property>
</widget>
</item>
<item row="6" column="1" colspan="4">
<widget class="QLabel" name="label_40">
<property name="text">
<string>For more informations about Spell Check, please see &lt;a href=&quot;https://github.com/QupZilla/qupzilla/wiki/Spell-Check&quot;&gt;wiki&lt;/a&gt;.</string>
<item row="5" column="1" colspan="4">
<widget class="QScrollArea" name="spellcheckDirectoriesScrollArea">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="openExternalLinks">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>560</width>
<height>70</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<widget class="QLabel" name="spellcheckDirectories"/>
</item>
</layout>
</widget>
</widget>
</item>
<item row="7" column="1">
<spacer name="verticalSpacer_17">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="otherPage">