From 70d26004f065c5fd18be00cab17fc93ed231d849 Mon Sep 17 00:00:00 2001 From: OBATA Akio Date: Wed, 19 Aug 2020 16:51:24 +0900 Subject: [PATCH] Add an ability to specify default spell checker There is no reason to determine it with operating system basis. Change to use build configuration instead. "ispell" by default, and you can override it. Signed-off-by: OBATA Akio --- CMakeLists.txt | 4 ++++ config.h.cmake | 3 +++ tdeui/ksconfig.cpp | 6 +----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9ae8384c..dc06d3b62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1257,6 +1257,10 @@ if( WITH_HSPELL ) endif( WITH_HSPELL ) +####" default spell checker ##################### +set( DEFAULT_SPELL_CHECKER "ISPELL" CACHE STRING "default spell checker" ) + + ##### enable TDEIconLoader debugging ############ if ( WITH_TDEICONLOADER_DEBUG ) diff --git a/config.h.cmake b/config.h.cmake index 3e4a0e27c..76c299e08 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -6,6 +6,9 @@ /* Define where aspell data dir is */ #define ASPELL_DATADIR "@ASPELL_DATADIR@" +/* Define default spell checker */ +#define DEFAULT_SPELL_CHECKER KS_CLIENT_@DEFAULT_SPELL_CHECKER@ + /* Avahi API 0.6 */ #cmakedefine HAVE_DNSSD 1 #cmakedefine AVAHI_API_0_6 1 diff --git a/tdeui/ksconfig.cpp b/tdeui/ksconfig.cpp index c814fec5c..cb211e4df 100644 --- a/tdeui/ksconfig.cpp +++ b/tdeui/ksconfig.cpp @@ -188,11 +188,7 @@ KSpellConfig::readGlobalSettings() setDictionary ( kc->readEntry("KSpell_Dictionary") ); setDictFromList ( kc->readNumEntry("KSpell_DictFromList", false) ); setEncoding ( kc->readNumEntry ("KSpell_Encoding", KS_E_UTF8) ); -#if defined(__OpenBSD__) || defined(__FreeBSD__) - setClient ( kc->readNumEntry ("KSpell_Client", KS_CLIENT_ASPELL) ); -#else - setClient ( kc->readNumEntry ("KSpell_Client", KS_CLIENT_ISPELL) ); -#endif + setClient ( kc->readNumEntry ("KSpell_Client", DEFAULT_SPELL_CHECKER) ); return true; }