diff options
Diffstat (limited to 'src/webengine')
-rw-r--r-- | src/webengine/api/qquickwebenginecontextmenudata.cpp | 4 | ||||
-rw-r--r-- | src/webengine/api/qquickwebenginecontextmenudata_p.h | 6 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineprofile.cpp | 16 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineprofile.h | 12 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineview.cpp | 15 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineview_p.h | 6 | ||||
-rw-r--r-- | src/webengine/webengine.pro | 5 |
7 files changed, 12 insertions, 52 deletions
diff --git a/src/webengine/api/qquickwebenginecontextmenudata.cpp b/src/webengine/api/qquickwebenginecontextmenudata.cpp index 9fec90525..221b42245 100644 --- a/src/webengine/api/qquickwebenginecontextmenudata.cpp +++ b/src/webengine/api/qquickwebenginecontextmenudata.cpp @@ -170,7 +170,6 @@ bool QQuickWebEngineContextMenuData::isContentEditable() const return d ? d->isEditable : false; } -#if !defined(QT_NO_SPELLCHECK) /*! \qmlproperty QString WebEngineDownloadItem::misspelledWord @@ -194,7 +193,6 @@ QStringList QQuickWebEngineContextMenuData::spellCheckerSuggestions() const return d->spellCheckerSuggestions; return QStringList(); } -#endif void QQuickWebEngineContextMenuData::update(const QtWebEngineCore::WebEngineContextMenuData &update) { @@ -225,13 +223,11 @@ void QQuickWebEngineContextMenuData::update(const QtWebEngineCore::WebEngineCont if (isContentEditable() != old.isContentEditable()) Q_EMIT isContentEditableChanged(); -#if !defined(QT_NO_SPELLCHECK) if (misspelledWord() != old.misspelledWord()) Q_EMIT misspelledWordChanged(); if (spellCheckerSuggestions() != old.spellCheckerSuggestions()) Q_EMIT spellCheckerSuggestionsChanged(); -#endif } QQuickWebEngineContextMenuData::QQuickWebEngineContextMenuData(const QQuickWebEngineContextMenuDataPrivate *p, QObject *parent) diff --git a/src/webengine/api/qquickwebenginecontextmenudata_p.h b/src/webengine/api/qquickwebenginecontextmenudata_p.h index 162c28662..0989eaa5a 100644 --- a/src/webengine/api/qquickwebenginecontextmenudata_p.h +++ b/src/webengine/api/qquickwebenginecontextmenudata_p.h @@ -92,10 +92,8 @@ public: Q_PROPERTY(QUrl mediaUrl READ mediaUrl NOTIFY mediaUrlChanged) Q_PROPERTY(MediaType mediaType READ mediaType NOTIFY mediaTypeChanged) Q_PROPERTY(bool isContentEditable READ isContentEditable NOTIFY isContentEditableChanged) -#if !defined(QT_NO_SPELLCHECK) Q_PROPERTY(QString misspelledWord READ misspelledWord NOTIFY misspelledWordChanged) Q_PROPERTY(QStringList spellCheckerSuggestions READ spellCheckerSuggestions NOTIFY spellCheckerSuggestionsChanged) -#endif bool isValid() const; @@ -107,10 +105,8 @@ public: MediaType mediaType() const; bool isContentEditable() const; -#if !defined(QT_NO_SPELLCHECK) QString misspelledWord() const; QStringList spellCheckerSuggestions() const; -#endif Q_SIGNALS: void isValidChanged(); @@ -121,10 +117,8 @@ Q_SIGNALS: void mediaUrlChanged(); void mediaTypeChanged(); void isContentEditableChanged(); -#if !defined(QT_NO_SPELLCHECK) void misspelledWordChanged(); void spellCheckerSuggestionsChanged(); -#endif private: void update(const QtWebEngineCore::WebEngineContextMenuData &update); diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index 3873bc9c5..f38422966 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -612,30 +612,29 @@ QQuickWebEngineProfile *QQuickWebEngineProfile::defaultProfile() return profile; } -#if !defined(QT_NO_SPELLCHECK) /*! - \qmlmethod void QQuickWebEngineProfile::spellCheckLanguages() + \qmlmethod void QQuickWebEngineProfile::availableDictionaries() - Returns the subset of \a acceptLanguages supported by the spell checker. + Returns the subset of \a languages supported by the spell checker. Checks whether the spell checker dictionary is installed for the specified - language from the \a acceptLanguages list. If the dictionary file is missing + language from the \a languages list. If the dictionary file is missing or corrupted, the language is removed from the returned list. \since QtWebEngine 1.3 */ /*! - Returns the subset of \a acceptLanguages supported by the spell checker. + Returns the subset of \a languages supported by the spell checker. Checks whether the spell checker dictionary is installed for the specified - language from the \a acceptLanguages list. If the dictionary file is missing + language from the \a languages list. If the dictionary file is missing or corrupted, the language is removed from the returned list. \since QtWebEngine 1.3 */ -QStringList QQuickWebEngineProfile::spellCheckLanguages(const QStringList &acceptLanguages) +QStringList QQuickWebEngineProfile::availableDictionaries(const QStringList &languages) { const Q_D(QQuickWebEngineProfile); - return d->browserContext()->spellCheckLanguages(acceptLanguages); + return d->browserContext()->spellCheckLanguages(languages); } /*! @@ -700,7 +699,6 @@ bool QQuickWebEngineProfile::isSpellCheckEnabled() const const Q_D(QQuickWebEngineProfile); return d->browserContext()->isSpellCheckEnabled(); } -#endif /*! diff --git a/src/webengine/api/qquickwebengineprofile.h b/src/webengine/api/qquickwebengineprofile.h index cf4334126..8d120d10e 100644 --- a/src/webengine/api/qquickwebengineprofile.h +++ b/src/webengine/api/qquickwebengineprofile.h @@ -71,10 +71,8 @@ class Q_WEBENGINE_EXPORT QQuickWebEngineProfile : public QObject { Q_PROPERTY(QString httpAcceptLanguage READ httpAcceptLanguage WRITE setHttpAcceptLanguage NOTIFY httpAcceptLanguageChanged FINAL REVISION 1) Q_PROPERTY(PersistentCookiesPolicy persistentCookiesPolicy READ persistentCookiesPolicy WRITE setPersistentCookiesPolicy NOTIFY persistentCookiesPolicyChanged FINAL) Q_PROPERTY(int httpCacheMaximumSize READ httpCacheMaximumSize WRITE setHttpCacheMaximumSize NOTIFY httpCacheMaximumSizeChanged FINAL) -#if !defined(QT_NO_SPELLCHECK) - Q_PROPERTY(QString spellCheckLanguage READ spellCheckLanguage WRITE setSpellCheckLanguage NOTIFY spellCheckLanguageChanged REVISION 2) - Q_PROPERTY(bool spellCheckEnabled READ isSpellCheckEnabled WRITE setSpellCheckEnabled NOTIFY spellCheckEnabledChanged REVISION 2) -# endif + Q_PROPERTY(QString spellCheckLanguage READ spellCheckLanguage WRITE setSpellCheckLanguage NOTIFY spellCheckLanguageChanged FINAL REVISION 2) + Q_PROPERTY(bool spellCheckEnabled READ isSpellCheckEnabled WRITE setSpellCheckEnabled NOTIFY spellCheckEnabledChanged FINAL REVISION 2) public: QQuickWebEngineProfile(QObject *parent = Q_NULLPTR); @@ -133,13 +131,11 @@ public: void clearHttpCache(); -#if !defined(QT_NO_SPELLCHECK) - Q_REVISION(2) Q_INVOKABLE QStringList spellCheckLanguages(const QStringList &acceptLanguages); + Q_REVISION(2) Q_INVOKABLE QStringList availableDictionaries(const QStringList &languages); Q_REVISION(2) void setSpellCheckLanguage(const QString &language); Q_REVISION(2) QString spellCheckLanguage() const; Q_REVISION(2) void setSpellCheckEnabled(bool enabled); Q_REVISION(2) bool isSpellCheckEnabled() const; -# endif static QQuickWebEngineProfile *defaultProfile(); @@ -153,10 +149,8 @@ Q_SIGNALS: void persistentCookiesPolicyChanged(); void httpCacheMaximumSizeChanged(); Q_REVISION(1) void httpAcceptLanguageChanged(); -#if !defined(QT_NO_SPELLCHECK) Q_REVISION(2) void spellCheckLanguageChanged(); Q_REVISION(2) void spellCheckEnabledChanged(); -#endif void downloadRequested(QQuickWebEngineDownloadItem *download); void downloadFinished(QQuickWebEngineDownloadItem *download); diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index b33654788..9296cc4dd 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -199,7 +199,6 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu // Populate our menu MenuItemHandler *item = 0; -#if !defined(QT_NO_SPELLCHECK) if (contextMenuData.isContentEditable() && !contextMenuData.spellCheckerSuggestions().isEmpty()) { const QPointer<QQuickWebEngineView> qRef(q); for (int i=0; i < contextMenuData.spellCheckerSuggestions().count() && i < 4; i++) { @@ -210,7 +209,6 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu } ui()->addMenuSeparator(menu); } -#endif if (!data.linkText.isEmpty() && data.linkUrl.isValid()) { item = new MenuItemHandler(menu); QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::OpenLinkInThisWindow); }); @@ -305,13 +303,7 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::ExitFullScreen); }); ui()->addMenuItem(item, QQuickWebEngineView::tr("Exit Full Screen Mode")); } -#if !defined(QT_NO_SPELLCHECK) - if (data.isEditable) { - item = new MenuItemHandler(menu); - QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::ToggleSpellcheck); }); - ui()->addMenuItem(item, QQuickWebEngineView::tr("Check Spelling"), QString(), true, true, data.isSpellCheckerEnabled); - } -#endif + // FIXME: expose the context menu data as an attached property to make this more useful if (contextMenuExtraItems) { ui()->addMenuSeparator(menu); @@ -1584,11 +1576,6 @@ void QQuickWebEngineView::triggerWebAction(WebAction action) case SavePage: d->adapter->save(); break; -#if !defined(QT_NO_SPELLCHECK) - case ToggleSpellcheck: - d->adapter->toogleSpellCheckEnabled(); - break; -#endif default: Q_UNREACHABLE(); } diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h index 2a4563d70..8015820b7 100644 --- a/src/webengine/api/qquickwebengineview_p.h +++ b/src/webengine/api/qquickwebengineview_p.h @@ -241,9 +241,6 @@ public: RequestClose, Unselect, SavePage, -#if !defined(QT_NO_SPELLCHECK) - ToggleSpellcheck, -#endif WebActionCount }; Q_ENUM(WebAction) @@ -473,10 +470,7 @@ public Q_SLOTS: Q_REVISION(2) void triggerWebAction(WebAction action); Q_REVISION(3) void printToPdf(const QString &filePath, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait); Q_REVISION(3) void printToPdf(const QJSValue &callback, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait); - -#if !defined(QT_NO_SPELLCHECK) Q_REVISION(3) void replaceMisspelledWord(const QString &replacement); -#endif private Q_SLOTS: void lazyInitialize(); diff --git a/src/webengine/webengine.pro b/src/webengine/webengine.pro index 9ec0db5cb..e4b274a82 100644 --- a/src/webengine/webengine.pro +++ b/src/webengine/webengine.pro @@ -57,10 +57,7 @@ isQMLTestSupportApiEnabled() { DEFINES += ENABLE_QML_TESTSUPPORT_API } -no_spellcheck { - DEFINES += QT_NO_SPELLCHECK - MODULE_DEFINES += QT_NO_SPELLCHECK -} else { +!contains(WEBENGINE_CONFIG, no_spellcheck) { DEFINES += ENABLE_SPELLCHECK } |