Hello community,
here is the log from the commit of package sonnet for openSUSE:Factory checked in at 2018-04-19 15:20:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/sonnet (Old)
and /work/SRC/openSUSE:Factory/.sonnet.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sonnet"
Thu Apr 19 15:20:07 2018 rev:54 rq:596917 version:5.45.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/sonnet/sonnet.changes 2018-03-20 21:49:02.282142850 +0100
+++ /work/SRC/openSUSE:Factory/.sonnet.new/sonnet.changes 2018-04-19 15:20:08.937776549 +0200
@@ -1,0 +2,22 @@
+Sat Apr 14 13:19:09 CEST 2018 - lbeltrame@kde.org
+
+- Update to 5.45.0
+ * New feature release
+ * For more details please see:
+ * https://www.kde.org/announcements/kde-frameworks-5.45.0.php
+- Changes since 5.44.0:
+ * Don't impose using the default client
+ * Remove deprecated cmake code
+ * Remove not necessary QtCore and co
+ * NSSpellChecker plugin cleanup
+ * Include replacement strings in the suggestion list
+ * implement NSSpellCheckerDict::addPersonal()
+ * NSSpellCheckerDict::suggest() returns a list of suggestions
+ * initialise NSSpellChecker language in NSSpellCheckerDict ctor
+ * implement NSSpellChecker logging category
+ * NSSpellChecker requires AppKit
+ * Move NSSpellCheckerClient::reliability() out of line
+ * use the preferred Mac platform token
+ * Use correct directory to lookup trigrams in windows build dir
+
+-------------------------------------------------------------------
Old:
----
sonnet-5.44.0.tar.xz
New:
----
sonnet-5.45.0.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ sonnet.spec ++++++
--- /var/tmp/diff_new_pack.vtZUyL/_old 2018-04-19 15:20:09.645748139 +0200
+++ /var/tmp/diff_new_pack.vtZUyL/_new 2018-04-19 15:20:09.645748139 +0200
@@ -18,13 +18,13 @@
%bcond_without lang
%define sonum 5
-%define _tar_path 5.44
+%define _tar_path 5.45
# Full KF5 version (e.g. 5.33.0)
%{!?_kf5_version: %global _kf5_version %{version}}
# Last major and minor KF5 version (e.g. 5.33)
%{!?_kf5_bugfix_version: %global _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')}
Name: sonnet
-Version: 5.44.0
+Version: 5.45.0
Release: 0
#BuildRequires: aspell-devel
BuildRequires: cmake >= 3.0
++++++ sonnet-5.44.0.tar.xz -> sonnet-5.45.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/CMakeLists.txt new/sonnet-5.45.0/CMakeLists.txt
--- old/sonnet-5.44.0/CMakeLists.txt 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/CMakeLists.txt 2018-04-07 21:41:09.000000000 +0200
@@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 3.0)
-set(KF5_VERSION "5.44.0") # handled by release scripts
+set(KF5_VERSION "5.45.0") # handled by release scripts
project(Sonnet VERSION ${KF5_VERSION})
include(FeatureSummary)
-find_package(ECM 5.44.0 NO_MODULE)
+find_package(ECM 5.45.0 NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules")
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
@@ -17,7 +17,7 @@
include(KDECMakeSettings)
include(ECMQtDeclareLoggingCategory)
-set(REQUIRED_QT_VERSION 5.7.0)
+set(REQUIRED_QT_VERSION 5.8.0)
option(SONNET_USE_WIDGETS "Build components using Qt5Widgets" ON)
if(SONNET_USE_WIDGETS)
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/autotests/test_core.h new/sonnet-5.45.0/autotests/test_core.h
--- old/sonnet-5.44.0/autotests/test_core.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/autotests/test_core.h 2018-04-07 21:41:09.000000000 +0200
@@ -19,7 +19,7 @@
#ifndef TEST_CORE_H
#define TEST_CORE_H
-#include
+#include <QObject>
class SonnetCoreTest : public QObject
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/data/CMakeLists.txt new/sonnet-5.45.0/data/CMakeLists.txt
--- old/sonnet-5.44.0/data/CMakeLists.txt 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/data/CMakeLists.txt 2018-04-07 21:41:09.000000000 +0200
@@ -14,7 +14,6 @@
INSTALL(TARGETS parsetrigrams ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
INSTALL(TARGETS gentrigrams ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
-cmake_policy(SET CMP0026 OLD) # FIXME: make this work with CMP0026 set to NEW
if(CMAKE_CROSSCOMPILING AND PARSETRIGRAMS_EXECUTABLE)
add_executable(KF5::parsetrigrams IMPORTED GLOBAL)
set_target_properties(KF5::parsetrigrams PROPERTIES IMPORTED_LOCATION ${PARSETRIGRAMS_EXECUTABLE})
@@ -22,15 +21,14 @@
add_executable(KF5::parsetrigrams ALIAS parsetrigrams)
endif()
-macro(create_trigrams_map _target_name _in_DIR _out_FILE)
- get_target_property(PARSETRIGRAMS_EXECUTABLE parsetrigrams LOCATION)
+function(create_trigrams_map _target_name _in_DIR _out_FILE)
add_custom_target(trigrams_${_target_name} ALL)
add_custom_command(TARGET trigrams_${_target_name}
COMMAND $ "${_in_DIR}" > "${_out_FILE}"
)
add_dependencies(trigrams_${_target_name} parsetrigrams)
-endmacro(create_trigrams_map)
+endfunction(create_trigrams_map)
create_trigrams_map(sonnet
${CMAKE_SOURCE_DIR}/data/trigrams
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/data/gentrigrams.cpp new/sonnet-5.45.0/data/gentrigrams.cpp
--- old/sonnet-5.44.0/data/gentrigrams.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/data/gentrigrams.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -21,10 +21,10 @@
* 02110-1301 USA
*/
-#include
-#include
-#include
-#include
+#include <QFile>
+#include <QHash>
+#include <QString>
+#include <QDebug>
#include "guesslanguage.h"
int main(int argc, char *argv[])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/data/parsetrigrams.cpp new/sonnet-5.45.0/data/parsetrigrams.cpp
--- old/sonnet-5.44.0/data/parsetrigrams.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/data/parsetrigrams.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -21,15 +21,15 @@
* 02110-1301 USA
*/
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
+#include <QString>
+#include <QTextStream>
+#include <QDir>
+#include <QFile>
+#include <QHash>
+#include <QRegExp>
+#include <QStringList>
+#include <QDebug>
+#include <QDataStream>
int main(int argc, char **argv)
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/examples/dialogexample.h new/sonnet-5.45.0/examples/dialogexample.h
--- old/sonnet-5.44.0/examples/dialogexample.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/examples/dialogexample.h 2018-04-07 21:41:09.000000000 +0200
@@ -23,7 +23,7 @@
#include "dialog.h"
-#include
+#include <QObject>
class TestDialog : public QObject
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/po/ca@valencia/sonnet5_qt.po new/sonnet-5.45.0/po/ca@valencia/sonnet5_qt.po
--- old/sonnet-5.44.0/po/ca@valencia/sonnet5_qt.po 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/po/ca@valencia/sonnet5_qt.po 2018-04-07 21:41:09.000000000 +0200
@@ -263,8 +263,8 @@
"All</b>.</p>\n"
"</qt>"
msgstr ""
-"<qt><p>Esta paraula s'ha considerat una «paraula desconeguda» perquè no casa "
-"amb cap entrada del diccionari actualment en ús. També podria ser una "
+"<qt><p>Aquesta paraula s'ha considerat una «paraula desconeguda» perquè no "
+"casa amb cap entrada del diccionari actualment en ús. També podria ser una "
"paraula en un idioma estranger.</p>\n"
"<p>Si la paraula no està mal escrita, podeu afegir-la al diccionari clicant "
"a <b>Afig al diccionari</b>. Si no voleu afegir la paraula desconeguda al "
@@ -324,7 +324,7 @@
msgstr ""
"<qt>\n"
"<p>Ací podeu veure un extracte del text que mostra la paraula desconeguda en "
-"el seu context. Si esta informació no és suficient per a triar la millor "
+"el seu context. Si aquesta informació no és suficient per a triar la millor "
"substitució per a la paraula desconeguda, podeu clicar al document que esteu "
"revisant, llegir una part més gran del text i llavors tornar ací per a "
"continuar la verificació.</p>\n"
@@ -384,9 +384,9 @@
"està disponible la seua correcció, i si ho està, cliqueu-hi. Si cap de les "
"paraules de la llista és una substitució bona, podeu teclejar la paraula "
"correcta al quadre d'edició de sobre.</p>\n"
-"<p>Per a corregir esta paraula cliqueu <b>Substitueix</b> si voleu corregir "
-"només esta ocurrència o <b>Substitueix-ho tot</b> si voleu corregir totes "
-"les ocurrències.</p>\n"
+"<p>Per a corregir aquesta paraula cliqueu <b>Substitueix</b> si voleu "
+"corregir només aquesta ocurrència o <b>Substitueix-ho tot</b> si voleu "
+"corregir totes les ocurrències.</p>\n"
"</qt>"
#: ui/sonnetui.ui:151 ui/sonnetui.ui:167
@@ -403,7 +403,7 @@
"<qt>\n"
"<p>Si la paraula desconeguda està mal escrita, heu de teclejar la correcció "
"de l'error ortogràfic ací o seleccionar-la de la llista de sota.</p>\n"
-"<p>Llavors podeu clicar <b>Substitueix</b> si voleu corregir només esta "
+"<p>Llavors podeu clicar <b>Substitueix</b> si voleu corregir només aquesta "
"ocurrència de la paraula o <b>Substitueix-ho tot</b> si voleu corregir totes "
"les ocurrències.</p>\n"
"</qt>"
@@ -432,8 +432,8 @@
"</qt>"
msgstr ""
"<qt>\n"
-"<p>Cliqueu ací per a substituir esta ocurrència del text desconegut amb el "
-"text del quadre d'edició de sobre (a l'esquerra).</p>\n"
+"<p>Cliqueu ací per a substituir aquesta ocurrència del text desconegut amb "
+"el text del quadre d'edició de sobre (a l'esquerra).</p>\n"
"</qt>"
#: ui/sonnetui.ui:218
@@ -470,9 +470,9 @@
"</qt>"
msgstr ""
"<qt>\n"
-"<p>Cliqueu ací per a deixar esta ocurrència de la paraula desconeguda tal "
+"<p>Cliqueu ací per a deixar aquesta ocurrència de la paraula desconeguda tal "
"com està.</p>\n"
-"<p>Esta acció és útil quan una paraula és un nom, un acrònim, una paraula "
+"<p>Aquesta acció és útil quan una paraula és un nom, un acrònim, una paraula "
"estrangera o qualsevol altra paraula desconeguda que voleu usar però no "
"voleu afegir al diccionari.</p>\n"
"</qt>"
@@ -496,7 +496,7 @@
"<qt>\n"
"<p>Cliqueu ací per a deixar totes les ocurrències de la paraula desconeguda "
"tal com estan.</p>\n"
-"<p>Esta acció és útil quan una paraula és un nom, un acrònim, una paraula "
+"<p>Aquesta acció és útil quan una paraula és un nom, un acrònim, una paraula "
"estrangera o qualsevol altra paraula desconeguda que voleu usar però no "
"voleu afegir al diccionari.</p>\n"
"</qt>"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/po/id/sonnet5_qt.po new/sonnet-5.45.0/po/id/sonnet5_qt.po
--- old/sonnet-5.44.0/po/id/sonnet5_qt.po 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/po/id/sonnet5_qt.po 2018-04-07 21:41:09.000000000 +0200
@@ -9,7 +9,7 @@
"Project-Id-Version: kdelibs4\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2014-03-23 01:50+0000\n"
-"PO-Revision-Date: 2018-02-18 11:18+0700\n"
+"PO-Revision-Date: 2018-04-03 21:50+0700\n"
"Last-Translator: Wantoyo \n"
"Language-Team: Indonesian \n"
"Language: id\n"
@@ -17,6 +17,7 @@
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Generator: Lokalize 2.0\n"
"X-Qt-Contexts: true\n"
#: core/loader.cpp:172
@@ -375,7 +376,7 @@
"<p>Jika kata tak dikenal salah eja, anda harus memeriksa apakah koreksi "
"untuk hal itu tersedia dan jika ada, klik pada koreksinya. Jika tidak ada "
"kata dalam senarai ini yang cukup pantas sebagai pengganti anda dapat "
-"mengetikkan kata yang benar di kotak sunting di atas.</p>\n"
+"mengetikkan kata yang benar di kotak edit di atas.</p>\n"
"<p>Untuk mengoreksi kata ini klik <b>Ganti</b> jika anda ingin mengoreksi "
"hanya kecocokan kata ini atau <b>Ganti Semua</b> jika anda ingin mengoreksi "
"semua kecocokan kata.</p>\n"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/po/zh_CN/sonnet5_qt.po new/sonnet-5.45.0/po/zh_CN/sonnet5_qt.po
--- old/sonnet-5.44.0/po/zh_CN/sonnet5_qt.po 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/po/zh_CN/sonnet5_qt.po 2018-04-07 21:41:09.000000000 +0200
@@ -14,7 +14,7 @@
msgid ""
msgstr ""
"Project-Id-Version: kdeorg\n"
-"PO-Revision-Date: 2018-02-28 02:23-0500\n"
+"PO-Revision-Date: 2018-04-05 09:22-0400\n"
"Last-Translator: guoyunhebrave \n"
"Language-Team: Chinese Simplified\n"
"Language: zh_CN\n"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/backgroundchecker.h new/sonnet-5.45.0/src/core/backgroundchecker.h
--- old/sonnet-5.44.0/src/core/backgroundchecker.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/backgroundchecker.h 2018-04-07 21:41:09.000000000 +0200
@@ -25,7 +25,7 @@
#include "sonnetcore_export.h"
-#include
+#include <QObject>
class BackgroundCheckerPrivate;
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/client_p.h new/sonnet-5.45.0/src/core/client_p.h
--- old/sonnet-5.44.0/src/core/client_p.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/client_p.h 2018-04-07 21:41:09.000000000 +0200
@@ -20,9 +20,9 @@
#ifndef SONNET_CLIENT_P_H
#define SONNET_CLIENT_P_H
-#include
-#include
-#include
+#include <QObject>
+#include <QStringList>
+#include <QString>
#include "sonnetcore_export.h"
/*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/guesslanguage.cpp new/sonnet-5.45.0/src/core/guesslanguage.cpp
--- old/sonnet-5.44.0/src/core/guesslanguage.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/guesslanguage.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -19,12 +19,12 @@
Boston, MA 02110-1301, USA.
*/
-#include
-#include
-#include
-#include
-#include
-#include
+#include <QCoreApplication>
+#include <QFile>
+#include <QFileInfo>
+#include <QStandardPaths>
+#include <QTime>
+#include <QDataStream>
#include <QLocale>
#include "guesslanguage.h"
@@ -630,8 +630,13 @@
"kf5/sonnet/trigrams.map"));
if (triMapFile.isEmpty()) {
+#ifdef Q_OS_WIN
+ triMapFile = QStringLiteral("%1/data/kf5/sonnet/trigrams.map").arg(
+ QCoreApplication::applicationDirPath());
+#else
triMapFile = QStringLiteral("%1/../share/kf5/sonnet/trigrams.map").arg(
QCoreApplication::applicationDirPath());
+#endif
}
qCDebug(SONNET_LOG_CORE) << "Loading trigrams from" << triMapFile;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/guesslanguage.h new/sonnet-5.45.0/src/core/guesslanguage.h
--- old/sonnet-5.44.0/src/core/guesslanguage.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/guesslanguage.h 2018-04-07 21:41:09.000000000 +0200
@@ -20,8 +20,8 @@
#ifndef GUESSLANGUAGE_H
#define GUESSLANGUAGE_H
-#include
-#include
+#include <QString>
+#include <QLocale>
#include "sonnetcore_export.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/languagefilter.cpp new/sonnet-5.45.0/src/core/languagefilter.cpp
--- old/sonnet-5.44.0/src/core/languagefilter.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/languagefilter.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -18,7 +18,7 @@
Boston, MA 02110-1301, USA.
*/
-#include
+#include <QString>
#include "languagefilter_p.h"
#include "guesslanguage.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/languagefilter_p.h new/sonnet-5.45.0/src/core/languagefilter_p.h
--- old/sonnet-5.44.0/src/core/languagefilter_p.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/languagefilter_p.h 2018-04-07 21:41:09.000000000 +0200
@@ -21,7 +21,7 @@
#ifndef LANGUAGEFILTER_H
#define LANGUAGEFILTER_H
-#include
+#include <QString>
#include
#include "sonnetcore_export.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/loader.cpp new/sonnet-5.45.0/src/core/loader.cpp
--- old/sonnet-5.44.0/src/core/loader.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/loader.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -23,17 +23,19 @@
#include "client_p.h"
#include "spellerplugin_p.h"
-#include
-#include
-#include
-#include
-#include
+#include <QHash>
+#include <QMap>
+#include <QLocale>
+#include <QCoreApplication>
+#include <QPluginLoader>
#include "core_debug.h"
-#include
+#include <QDir>
+
+#include <algorithm>
#ifdef SONNET_STATIC
#include "../plugins/hunspell/hunspellclient.h"
-#ifdef Q_OS_MAC
+#ifdef Q_OS_MACOS
#include "../plugins/nsspellchecker/nsspellcheckerclient.h"
#endif
#endif
@@ -84,13 +86,9 @@
QString backend = clientName;
QString plang = language;
- if (backend.isEmpty()) {
- backend = d->settings->defaultClient();
- }
if (plang.isEmpty()) {
plang = d->settings->defaultLanguage();
}
-
const QVector lClients = d->languageClients[plang];
if (lClients.isEmpty()) {
@@ -98,22 +96,39 @@
return nullptr;
}
+ if (backend.isEmpty()) {
+ backend = d->settings->defaultClient();
+ if (!backend.isEmpty()) {
+ // check if the default client supports the requested language;
+ // if it does it will be an element of lClients.
+ bool unknown = !std::any_of(lClients.constBegin(), lClients.constEnd(), [backend] (const Client *client) {
+ return client->name() == backend; });
+ if (unknown) {
+ qCWarning(SONNET_LOG_CORE) << "Default client" << backend << "doesn't support language:" << plang;
+ backend = QString();
+ }
+ }
+ }
+
QVectorIterator itr(lClients);
while (itr.hasNext()) {
Client *item = itr.next();
if (!backend.isEmpty()) {
if (backend == item->name()) {
SpellerPlugin *dict = item->createSpeller(plang);
+ qCDebug(SONNET_LOG_CORE) << "Using the" << item->name() << "plugin for language" << plang;
return dict;
}
} else {
//the first one is the one with the highest
//reliability
SpellerPlugin *dict = item->createSpeller(plang);
+ qCDebug(SONNET_LOG_CORE) << "Using the" << item->name() << "plugin for language" << plang;
return dict;
}
}
+ qCWarning(SONNET_LOG_CORE) << "The default client" << backend << "has no language dictionaries for the language:" << plang;
return nullptr;
}
@@ -289,7 +304,7 @@
qCWarning(SONNET_LOG_CORE) << "Sonnet: No speller backends available!";
}
#else
-#ifdef Q_OS_MAC
+#ifdef Q_OS_MACOS
loadPlugin(QString());
#endif
loadPlugin(QStringLiteral("Hunspell"));
@@ -317,7 +332,7 @@
if (pluginPath == QLatin1String("Hunspell")) {
client = new HunspellClient(this);
}
-#ifdef Q_OS_MAC
+#ifdef Q_OS_MACOS
else {
client = new NSSpellCheckerClient(this);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/loader_p.h new/sonnet-5.45.0/src/core/loader_p.h
--- old/sonnet-5.44.0/src/core/loader_p.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/loader_p.h 2018-04-07 21:41:09.000000000 +0200
@@ -22,9 +22,9 @@
#include "sonnetcore_export.h"
-#include
-#include
-#include
+#include <QObject>
+#include <QStringList>
+#include <QString>
#include <QSharedPointer>
namespace Sonnet {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/settings.cpp new/sonnet-5.45.0/src/core/settings.cpp
--- old/sonnet-5.44.0/src/core/settings.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/settings.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -23,10 +23,10 @@
#include "loader_p.h"
-#include
-#include
-#include
-#include
+#include <QMap>
+#include <QMutableStringListIterator>
+#include <QLocale>
+#include <QSettings>
namespace Sonnet {
class SettingsPrivate
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/settings_p.h new/sonnet-5.45.0/src/core/settings_p.h
--- old/sonnet-5.44.0/src/core/settings_p.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/settings_p.h 2018-04-07 21:41:09.000000000 +0200
@@ -20,8 +20,8 @@
#ifndef SONNET_SETTINGS_P_H
#define SONNET_SETTINGS_P_H
-#include
-#include
+#include <QStringList>
+#include <QString>
#include "sonnetcore_export.h"
namespace Sonnet {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/speller.h new/sonnet-5.45.0/src/core/speller.h
--- old/sonnet-5.44.0/src/core/speller.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/speller.h 2018-04-07 21:41:09.000000000 +0200
@@ -20,9 +20,9 @@
#ifndef SONNET_SPELLER_H
#define SONNET_SPELLER_H
-#include
-#include
-#include
+#include <QStringList>
+#include <QString>
+#include <QMap>
#include "sonnetcore_export.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/spellerplugin_p.h new/sonnet-5.45.0/src/core/spellerplugin_p.h
--- old/sonnet-5.44.0/src/core/spellerplugin_p.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/spellerplugin_p.h 2018-04-07 21:41:09.000000000 +0200
@@ -20,8 +20,8 @@
#ifndef SONNET_SPELLERPLUGIN_P_H
#define SONNET_SPELLERPLUGIN_P_H
-#include
-#include
+#include <QStringList>
+#include <QString>
#include "sonnetcore_export.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/textbreaks.cpp new/sonnet-5.45.0/src/core/textbreaks.cpp
--- old/sonnet-5.44.0/src/core/textbreaks.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/textbreaks.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -18,8 +18,8 @@
Boston, MA 02110-1301, USA.
*/
-#include
-#include
+#include <QHash>
+#include <QString>
#include <QTextBoundaryFinder>
#include "textbreaks_p.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/tokenizer.cpp new/sonnet-5.45.0/src/core/tokenizer.cpp
--- old/sonnet-5.44.0/src/core/tokenizer.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/tokenizer.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -20,8 +20,8 @@
Boston, MA 02110-1301, USA.
*/
-#include
-#include
+#include <QList>
+#include <QString>
#include "tokenizer_p.h"
#include "textbreaks_p.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/core/tokenizer_p.h new/sonnet-5.45.0/src/core/tokenizer_p.h
--- old/sonnet-5.44.0/src/core/tokenizer_p.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/core/tokenizer_p.h 2018-04-07 21:41:09.000000000 +0200
@@ -21,7 +21,7 @@
#ifndef ABSTRACTTOKENIZER_H
#define ABSTRACTTOKENIZER_H
-#include
+#include <QString>
#include "sonnetcore_export.h"
namespace Sonnet {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/aspell/aspelldict.cpp new/sonnet-5.45.0/src/plugins/aspell/aspelldict.cpp
--- old/sonnet-5.44.0/src/plugins/aspell/aspelldict.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/aspell/aspelldict.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -22,7 +22,7 @@
#include "aspell_debug.h"
-#include
+#include <QTextCodec>
#ifdef Q_OS_WIN
#include <QCoreApplication>
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/enchant/enchantclient.cpp new/sonnet-5.45.0/src/plugins/enchant/enchantclient.cpp
--- old/sonnet-5.44.0/src/plugins/enchant/enchantclient.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/enchant/enchantclient.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -20,7 +20,7 @@
#include "enchantdict.h"
#include <QtPlugin>
-#include
+#include <QDebug>
using namespace Sonnet;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/enchant/enchantclient.h new/sonnet-5.45.0/src/plugins/enchant/enchantclient.h
--- old/sonnet-5.44.0/src/plugins/enchant/enchantclient.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/enchant/enchantclient.h 2018-04-07 21:41:09.000000000 +0200
@@ -22,8 +22,8 @@
#include "spellerplugin_p.h"
#include "client_p.h"
-#include
-#include
+#include <QSet>
+#include <QVariantList>
#include
namespace Sonnet {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/enchant/enchantdict.cpp new/sonnet-5.45.0/src/plugins/enchant/enchantdict.cpp
--- old/sonnet-5.44.0/src/plugins/enchant/enchantdict.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/enchant/enchantdict.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -19,8 +19,8 @@
#include "enchantdict.h"
#include "enchantclient.h"
-#include
-#include
+#include <QTextCodec>
+#include <QDebug>
using namespace Sonnet;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/hspell/hspelldict.cpp new/sonnet-5.45.0/src/plugins/hspell/hspelldict.cpp
--- old/sonnet-5.44.0/src/plugins/hspell/hspelldict.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/hspell/hspelldict.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -25,7 +25,7 @@
#include "hspell_debug.h"
-#include
+#include <QTextCodec>
#include <QSettings>
using namespace Sonnet;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/hspell/hspelldict.h new/sonnet-5.45.0/src/plugins/hspell/hspelldict.h
--- old/sonnet-5.44.0/src/plugins/hspell/hspelldict.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/hspell/hspelldict.h 2018-04-07 21:41:09.000000000 +0200
@@ -22,8 +22,8 @@
#ifndef KSPELL_HSPELLDICT_H
#define KSPELL_HSPELLDICT_H
-#include
-#include
+#include <QMap>
+#include <QSet>
#include "spellerplugin_p.h"
/* libhspell is a C library and it does not have #ifdef __cplusplus */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/hunspell/CMakeLists.txt new/sonnet-5.45.0/src/plugins/hunspell/CMakeLists.txt
--- old/sonnet-5.44.0/src/plugins/hunspell/CMakeLists.txt 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/hunspell/CMakeLists.txt 2018-04-07 21:41:09.000000000 +0200
@@ -1,12 +1,6 @@
########### next target ###############
-if (EXISTS "/usr/share/hunspell/")
-add_definitions(-DHUNSPELL_MAIN_DICT_PATH="/usr/share/hunspell")
-elseif (EXISTS "/usr/share/myspell/")
-add_definitions(-DHUNSPELL_MAIN_DICT_PATH="/usr/share/myspell")
-endif (EXISTS "/usr/share/hunspell/")
-
include_directories( ${HUNSPELL_INCLUDE_DIRS} )
set(sonnet_hunspell_PART_SRCS
hunspellclient.cpp
@@ -17,6 +11,7 @@
add_library(sonnet_hunspell MODULE ${sonnet_hunspell_PART_SRCS})
target_link_libraries(sonnet_hunspell PRIVATE KF5::SonnetCore ${HUNSPELL_LIBRARIES})
+target_compile_definitions(sonnet_hunspell PRIVATE DEFINITIONS SONNET_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
install(TARGETS sonnet_hunspell DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/sonnet/)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/hunspell/hunspellclient.cpp new/sonnet-5.45.0/src/plugins/hunspell/hunspellclient.cpp
--- old/sonnet-5.44.0/src/plugins/hunspell/hunspellclient.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/hunspell/hunspellclient.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -35,36 +35,29 @@
qCDebug(SONNET_HUNSPELL) << " HunspellClient::HunspellClient";
QStringList dirList;
- const QString AFF_MASK = QStringLiteral("*.aff");
-
-#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
-#ifdef Q_OS_MAC
- QDir lodir(QStringLiteral("/Applications/LibreOffice.app/Contents/Resources/extensions"));
-#endif
-#ifdef Q_OS_WIN
- QDir lodir(QStringLiteral("C:/Program Files (x86)/LibreOffice 5/share/extensions"));
-#endif
- const QString DIR_MASK = QStringLiteral("dict-*");
- if (lodir.exists()) {
- foreach (const QString &d, lodir.entryList(QStringList(DIR_MASK), QDir::Dirs)) {
- dirList.append(lodir.absoluteFilePath(d));
- }
- }
-#endif
-
// search QStandardPaths
dirList.append(QStandardPaths::locateAll(
QStandardPaths::GenericDataLocation,
QStringLiteral("hunspell"),
QStandardPaths::LocateDirectory));
- dirList.append(QStringLiteral(HUNSPELL_MAIN_DICT_PATH));
- dirList.append(QStringLiteral("%1/../share/hunspell").arg(
- QCoreApplication::applicationDirPath()));
+ auto maybeAddPath = [&dirList](const QString &path)
+ {
+ if (QFileInfo::exists(path)) {
+ dirList.append(path);
+ }
+ };
+#ifdef Q_OS_WIN
+ maybeAddPath(QStringLiteral(SONNET_INSTALL_PREFIX "/bin/data/hunspell/"));
+#else
+ maybeAddPath(QStringLiteral("/System/Library/Spelling"));
+ maybeAddPath(QStringLiteral("/usr/share/hunspell/"));
+ maybeAddPath(QStringLiteral("/usr/share/myspell/"));
+#endif
for (const QString &dirString : dirList) {
QDir dir(dirString);
- for (const QFileInfo &dict : dir.entryInfoList(QStringList(AFF_MASK), QDir::Files)) {
+ for (const QFileInfo &dict : dir.entryInfoList({QStringLiteral("*.aff")}, QDir::Files)) {
m_languagePaths.insert(dict.baseName(), dict.canonicalPath());
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/hunspell/hunspelldict.h new/sonnet-5.45.0/src/plugins/hunspell/hunspelldict.h
--- old/sonnet-5.44.0/src/plugins/hunspell/hunspelldict.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/hunspell/hunspelldict.h 2018-04-07 21:41:09.000000000 +0200
@@ -24,14 +24,6 @@
#include "spellerplugin_p.h"
#include "hunspell.hxx"
-#ifndef HUNSPELL_MAIN_DICT_PATH
-#ifdef Q_OS_MAC
-#define HUNSPELL_MAIN_DICT_PATH "/System/Library/Spelling"
-#else
-#define HUNSPELL_MAIN_DICT_PATH "/usr/share/hunspell"
-#endif
-#endif
-
class HunspellDict : public Sonnet::SpellerPlugin
{
public:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/nsspellchecker/CMakeLists.txt new/sonnet-5.45.0/src/plugins/nsspellchecker/CMakeLists.txt
--- old/sonnet-5.44.0/src/plugins/nsspellchecker/CMakeLists.txt 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/nsspellchecker/CMakeLists.txt 2018-04-07 21:41:09.000000000 +0200
@@ -2,10 +2,14 @@
nsspellcheckerclient.mm
nsspellcheckerdict.mm
)
+ecm_qt_declare_logging_category(sonnet_nsspellchecker_PART_SRCS
+ HEADER nsspellcheckerdebug.h
+ IDENTIFIER SONNET_NSSPELLCHECKER
+ CATEGORY_NAME sonnet.plugins.nsspellchecker)
add_library(sonnet_nsspellchecker MODULE ${sonnet_nsspellchecker_PART_SRCS})
-target_link_libraries(sonnet_nsspellchecker PRIVATE KF5::SonnetCore "-framework Cocoa")
+target_link_libraries(sonnet_nsspellchecker PRIVATE KF5::SonnetCore "-framework AppKit")
install(TARGETS sonnet_nsspellchecker DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/sonnet/)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/nsspellchecker/nsspellcheckerclient.h new/sonnet-5.45.0/src/plugins/nsspellchecker/nsspellcheckerclient.h
--- old/sonnet-5.44.0/src/plugins/nsspellchecker/nsspellcheckerclient.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/nsspellchecker/nsspellcheckerclient.h 2018-04-07 21:41:09.000000000 +0200
@@ -37,10 +37,7 @@
explicit NSSpellCheckerClient(QObject *parent = nullptr);
~NSSpellCheckerClient();
- int reliability() const
- {
- return 30;
- }
+ int reliability() const;
SpellerPlugin *createSpeller(const QString &language);
QStringList languages() const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/nsspellchecker/nsspellcheckerclient.mm new/sonnet-5.45.0/src/plugins/nsspellchecker/nsspellcheckerclient.mm
--- old/sonnet-5.44.0/src/plugins/nsspellchecker/nsspellcheckerclient.mm 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/nsspellchecker/nsspellcheckerclient.mm 2018-04-07 21:41:09.000000000 +0200
@@ -21,7 +21,7 @@
#include "nsspellcheckerclient.h"
#include "nsspellcheckerdict.h"
-#import
+#import
using namespace Sonnet;
@@ -34,6 +34,11 @@
{
}
+int NSSpellCheckerClient::reliability() const
+{
+ return qEnvironmentVariableIsSet("SONNET_PREFER_NSSPELLCHECKER") ? 9999 : 30;
+}
+
SpellerPlugin *NSSpellCheckerClient::createSpeller(const QString &language)
{
return new NSSpellCheckerDict(language);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/nsspellchecker/nsspellcheckerdict.h new/sonnet-5.45.0/src/plugins/nsspellchecker/nsspellcheckerdict.h
--- old/sonnet-5.44.0/src/plugins/nsspellchecker/nsspellcheckerdict.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/nsspellchecker/nsspellcheckerdict.h 2018-04-07 21:41:09.000000000 +0200
@@ -37,7 +37,11 @@
virtual bool addToPersonal(const QString &word);
virtual bool addToSession(const QString &word);
private:
+#ifdef __OBJC__
+ NSString *m_langCode;
+#else
void *m_langCode;
+#endif
};
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/nsspellchecker/nsspellcheckerdict.mm new/sonnet-5.45.0/src/plugins/nsspellchecker/nsspellcheckerdict.mm
--- old/sonnet-5.44.0/src/plugins/nsspellchecker/nsspellcheckerdict.mm 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/nsspellchecker/nsspellcheckerdict.mm 2018-04-07 21:41:09.000000000 +0200
@@ -19,45 +19,95 @@
* 02110-1301 USA
*/
#include "nsspellcheckerdict.h"
+#include "nsspellcheckerdebug.h"
-#import
+#import
using namespace Sonnet;
NSSpellCheckerDict::NSSpellCheckerDict(const QString &lang)
: SpellerPlugin(lang)
- , m_langCode(lang.toNSString())
+ , m_langCode([lang.toNSString() retain])
{
+ NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker];
+ if ([checker setLanguage:m_langCode]) {
+ qCDebug(SONNET_NSSPELLCHECKER) << "Loading dictionary for" << lang;
+ [checker updatePanels];
+ } else {
+ qCWarning(SONNET_NSSPELLCHECKER) << "Loading dictionary for unsupported language" << lang;
+ }
}
NSSpellCheckerDict::~NSSpellCheckerDict()
{
+ [m_langCode release];
}
bool NSSpellCheckerDict::isCorrect(const QString &word) const
{
- NSRange range = [[NSSpellChecker sharedSpellChecker] checkSpellingOfString:word.toNSString() startingAt:0 language:reinterpret_cast(m_langCode) wrap:NO inSpellDocumentWithTag:0 wordCount:0];
- return range.length==0;
+ NSString *nsWord = word.toNSString();
+ NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker];
+ NSRange range = [checker checkSpellingOfString:nsWord
+ startingAt:0 language:m_langCode
+ wrap:NO inSpellDocumentWithTag:0 wordCount:nullptr];
+ if (range.length == 0) {
+ // Check if the user configured a replacement text for this string. Sadly
+ // we can only signal an error if that's the case, Sonnet has no other way
+ // to take such substitutions into account.
+ if (NSDictionary *replacements = [checker userReplacementsDictionary]) {
+ return [replacements objectForKey:nsWord] == nil;
+ } else {
+ return true;
+ }
+ }
+ return false;
}
QStringList NSSpellCheckerDict::suggest(const QString &word) const
{
- NSString* correction = [[NSSpellChecker sharedSpellChecker] correctionForWordRange:NSMakeRange(0, word.length()) inString:word.toNSString() language:reinterpret_cast(m_langCode) inSpellDocumentWithTag:0];
- return QStringList(QString::fromNSString(correction));
+ NSString *nsWord = word.toNSString();
+ NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker];
+ NSArray *suggestions = [checker guessesForWordRange:NSMakeRange(0, word.length())
+ inString:nsWord language:m_langCode inSpellDocumentWithTag:0];
+ QStringList lst;
+ NSDictionary *replacements = [checker userReplacementsDictionary];
+ QString replacement;
+ if ([replacements objectForKey:nsWord]) {
+ // return the replacement text from the userReplacementsDictionary first.
+ replacement = QString::fromNSString([replacements valueForKey:nsWord]);
+ lst << replacement;
+ }
+ for (NSString *suggestion in suggestions) {
+ // the replacement text from the userReplacementsDictionary will be in
+ // the suggestions list; don't add it again.
+ QString str = QString::fromNSString(suggestion);
+ if (str != replacement) {
+ lst << str;
+ }
+ }
+ return lst;
}
bool NSSpellCheckerDict::storeReplacement(const QString &bad,
const QString &good)
{
+ qCDebug(SONNET_NSSPELLCHECKER) << "Not storing replacement" << good << "for" << bad;
return false;
}
bool NSSpellCheckerDict::addToPersonal(const QString &word)
{
- return false;
+ NSString *nsWord = word.toNSString();
+ NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker];
+ if (![checker hasLearnedWord:nsWord]) {
+ [checker learnWord:nsWord];
+ [checker updatePanels];
+ }
+ return true;
}
bool NSSpellCheckerDict::addToSession(const QString &word)
{
+ qCDebug(SONNET_NSSPELLCHECKER) << "Not storing" << word << "in the session dictionary";
return false;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/voikko/voikkodict.cpp new/sonnet-5.45.0/src/plugins/voikko/voikkodict.cpp
--- old/sonnet-5.44.0/src/plugins/voikko/voikkodict.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/voikko/voikkodict.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -22,16 +22,16 @@
#include "voikkodict.h"
#include "voikkodebug.h"
-#include
-#include
-#include
+#include <QDir>
+#include <QStandardPaths>
+#include <QVector>
#ifdef Q_IS_WIN
- #include
+ #include <QSysInfo>
#endif
-#include
-#include
-#include
+#include <QJsonArray>
+#include <QJsonDocument>
+#include <QJsonObject>
namespace {
// QString literals used in loading and storing user dictionary
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/plugins/voikko/voikkodict.h new/sonnet-5.45.0/src/plugins/voikko/voikkodict.h
--- old/sonnet-5.44.0/src/plugins/voikko/voikkodict.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/plugins/voikko/voikkodict.h 2018-04-07 21:41:09.000000000 +0200
@@ -25,9 +25,9 @@
#include "spellerplugin_p.h"
#include
-#include
-#include
-#include
+#include <QHash>
+#include <QSet>
+#include <QScopedPointer>
class VoikkoClient;
class VoikkoDictPrivate;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/ui/dialog.cpp new/sonnet-5.45.0/src/ui/dialog.cpp
--- old/sonnet-5.44.0/src/ui/dialog.cpp 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/ui/dialog.cpp 2018-04-07 21:41:09.000000000 +0200
@@ -34,8 +34,8 @@
#include <QPushButton>
#include <QComboBox>
#include <QLabel>
-#include
-#include
+#include <QTimer>
+#include <QMessageBox>
namespace Sonnet {
//to initially disable sorting in the suggestions listview
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/ui/dictionarycombobox.h new/sonnet-5.45.0/src/ui/dictionarycombobox.h
--- old/sonnet-5.44.0/src/ui/dictionarycombobox.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/ui/dictionarycombobox.h 2018-04-07 21:41:09.000000000 +0200
@@ -23,7 +23,7 @@
#include "sonnetui_export.h"
-#include
+#include <QComboBox>
namespace Sonnet {
class DictionaryComboBoxPrivate;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/ui/highlighter.h new/sonnet-5.45.0/src/ui/highlighter.h
--- old/sonnet-5.44.0/src/ui/highlighter.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/ui/highlighter.h 2018-04-07 21:41:09.000000000 +0200
@@ -23,7 +23,7 @@
#define SONNET_HIGHLIGHTER_H
#include <QSyntaxHighlighter>
-#include
+#include <QStringList>
#include "sonnetui_export.h"
class QTextEdit;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/src/ui/spellcheckdecorator.h new/sonnet-5.45.0/src/ui/spellcheckdecorator.h
--- old/sonnet-5.44.0/src/ui/spellcheckdecorator.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/src/ui/spellcheckdecorator.h 2018-04-07 21:41:09.000000000 +0200
@@ -21,7 +21,7 @@
#ifndef SPELLCHECKDECORATOR_H
#define SPELLCHECKDECORATOR_H
-#include
+#include <QObject>
#include "sonnetui_export.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sonnet-5.44.0/tests/backgroundtest.h new/sonnet-5.45.0/tests/backgroundtest.h
--- old/sonnet-5.44.0/tests/backgroundtest.h 2018-03-03 11:08:31.000000000 +0100
+++ new/sonnet-5.45.0/tests/backgroundtest.h 2018-04-07 21:41:09.000000000 +0200
@@ -21,8 +21,8 @@
#ifndef BACKGROUNDTEST_H
#define BACKGROUNDTEST_H
-#include
-#include
+#include <QObject>
+#include <QDate>
#include "backgroundchecker.h"