summaryrefslogtreecommitdiffstats
path: root/src/core/browser_context_qt.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2016-04-28 19:20:33 +0200
committerMichal Klocek <michal.klocek@theqtcompany.com>2016-05-04 08:38:09 +0000
commit0bf8a13a4d0391339bae686e199fb922b64a1dcc (patch)
tree1a5e0f3a6009cd819510e7a7b11bb2bd34ad11bb /src/core/browser_context_qt.cpp
parent194c357aef23bf28befe1d51b343b5ac0683f728 (diff)
Remove availableDictionaries from spellcheck api
This method is broken, since SpellcheckerService is lazily initialized and dictionaries might be not loaded yet. Moreover there is a missing implementation on mac. Instead log warning when SpellcheckService can not load dictionary. Change-Id: Ifa2e769d83307543fa6cdf529475e9ab980022f0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/core/browser_context_qt.cpp')
-rw-r--r--src/core/browser_context_qt.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/core/browser_context_qt.cpp b/src/core/browser_context_qt.cpp
index 5b3115530..e76222d48 100644
--- a/src/core/browser_context_qt.cpp
+++ b/src/core/browser_context_qt.cpp
@@ -47,6 +47,7 @@
#include "ssl_host_state_delegate_qt.h"
#include "type_conversion.h"
#include "url_request_context_getter_qt.h"
+#include "web_engine_library_info.h"
#include "base/time/time.h"
#include "content/public/browser/browser_thread.h"
@@ -54,6 +55,7 @@
#include "net/proxy/proxy_config_service.h"
#if defined(ENABLE_SPELLCHECK)
+#include "base/base_paths.h"
#include "base/prefs/pref_member.h"
#include "base/prefs/pref_service.h"
#include "base/prefs/testing_pref_store.h"
@@ -201,22 +203,12 @@ net::URLRequestContextGetter *BrowserContextQt::CreateRequestContext(content::Pr
return url_request_getter_.get();
}
-
#if defined(ENABLE_SPELLCHECK)
-QStringList BrowserContextQt::spellCheckLanguages(const QStringList& acceptedLanguages)
+void BrowserContextQt::failedToLoadDictionary(const std::string &language)
{
- QStringList result;
-#if !defined(OS_MACOSX) // no SpellcheckService::GetSpellCheckLanguages
- m_prefService->SetString(prefs::kAcceptLanguages,acceptedLanguages.join(",").toStdString());
-
- std::vector<std::string> vec;
- SpellcheckService::GetSpellCheckLanguages(this, &vec);
-
- for (std::vector<std::string>::iterator it = vec.begin(); it != vec.end(); ++it) {
- result << QString::fromStdString(*it);
- }
-#endif
- return result;
+ Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ qWarning() << "Could not load dictionary for:" << toQt(language) << endl
+ << "Make sure that correct bdic file is in:" << toQt(WebEngineLibraryInfo::getPath(base::DIR_APP_DICTIONARIES).value());
}
void BrowserContextQt::setSpellCheckLanguage(const QString &language)