optional-qtwebengine
authorDebian/Kubuntu Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Sat, 20 Jan 2018 08:20:22 +0000 (08:20 +0000)
committerPino Toscano <pino@debian.org>
Sat, 20 Jan 2018 08:20:22 +0000 (08:20 +0000)
Gbp-Pq: Name optional-qtwebengine.diff

CMakeLists.txt
src/contact-editor/CMakeLists.txt
src/contact-editor/editor/addresseditor/autotests/CMakeLists.txt
src/contact-editor/editor/addresseditor/tests/CMakeLists.txt
src/contact-editor/editor/contacteditorwidget.cpp

index 96bc16447c86a80828e2f5164a1e0a76a8f3e7a4..9c41464c323d082ab604da943574bc718c2ed59b 100644 (file)
@@ -30,7 +30,12 @@ set(KMIMELIB_VERSION "5.6.3")
 set(AKONADI_VERSION "5.6.3")
 
 set(QT_REQUIRED_VERSION "5.7.0")
-find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test WebEngine WebEngineWidgets)
+find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test)
+find_package(Qt5WebEngine ${QT_REQUIRED_VERSION} CONFIG)
+find_package(Qt5WebEngineWidgets ${QT_REQUIRED_VERSION} CONFIG)
+if (Qt5WebEngine_FOUND)
+    add_definitions(-DHAVE_WEBENGINE)
+endif()
 ########### Find packages ###########
 find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
 find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
index 7ab0b0951d6b47c5a7540e205b1152bfa38bc12c..cbc966c04b7c17b9c342525b9191e12ade1629b4 100644 (file)
@@ -89,10 +89,13 @@ set(contacteditor_editor_generalinfo_SRCS
     ${contacteditor_editor_generalinfo_mail_SRCS}
     )
 
-set(contacteditor_addresslocation_web_editor_SRCS
-    editor/addresseditor/webengine/addresseslocationengineviewer.cpp
-    editor/addresseditor/webengine/addresseslocationenginepage.cpp
-    )
+if (TARGET Qt5::WebEngine)
+    set(contacteditor_addresslocation_web_editor_SRCS
+        editor/addresseditor/webengine/addresseslocationengineviewer.cpp
+        editor/addresseditor/webengine/addresseslocationenginepage.cpp
+        editor/addresseditor/addresseslocationwidget.cpp
+        )
+endif()
 
 set(contacteditor_addresslocation_editor_SRCS
     ${contacteditor_addresslocation_web_editor_SRCS}
@@ -100,7 +103,6 @@ set(contacteditor_addresslocation_editor_SRCS
     editor/addresseditor/addresseslocationgrantleeformater.cpp
     editor/addresseditor/addressgrantleeobject.cpp
     editor/addresseditor/iconnamecache.cpp
-    editor/addresseditor/addresseslocationwidget.cpp
     editor/addresseditor/selectaddresstypecombobox.cpp
     editor/addresseditor/addresstypedialog.cpp
     )
@@ -176,9 +178,14 @@ target_link_libraries(KF5ContactEditor
     KF5::TextWidgets
     KF5::WidgetsAddons
     Grantlee5::Templates
-    Qt5::WebEngine
-    Qt5::WebEngineWidgets
     )
+if (TARGET Qt5::WebEngine)
+    target_link_libraries(KF5ContactEditor
+        PRIVATE
+        Qt5::WebEngine
+        Qt5::WebEngineWidgets
+        )
+endif()
 
 set_target_properties(KF5ContactEditor PROPERTIES
     VERSION ${AKONADICONTACT_VERSION_STRING}
index 55284cf2f4c530fd094b7fc40e9e7749b55606d3..118c007545cd8962c054f25416bcc1011dfe72d8 100644 (file)
@@ -8,13 +8,15 @@ set(contacteditor_webengine_LIB Qt5::WebEngine Qt5::WebEngineWidgets)
 
 ecm_qt_declare_logging_category(contacteditor_addresslocation_web_editor_SRCS HEADER contacteditor_debug.h IDENTIFIER CONTACTEDITOR_LOG CATEGORY_NAME org.kde.pim.contacteditor)
 
-set(addresseslocationviewer_SRCS addresseslocationviewertest.cpp ${contacteditor_addresslocation_web_editor_SRCS} ../addresseslocationgrantleeformater.cpp
-    ../addressgrantleeobject.cpp ../iconnamecache.cpp)
-add_executable(addresseslocationviewer ${addresseslocationviewer_SRCS})
-add_test(addresseslocationviewer addresseslocationviewer)
-ecm_mark_as_test(addresseslocationviewer)
-target_link_libraries(addresseslocationviewer Qt5::Test  Qt5::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n ${contacteditor_webengine_LIB} Grantlee5::Templates
-    KF5::IconThemes KF5::WidgetsAddons)
+if (TARGET Qt5::WebEngine)
+    set(addresseslocationviewer_SRCS addresseslocationviewertest.cpp ${contacteditor_addresslocation_web_editor_SRCS} ../addresseslocationgrantleeformater.cpp
+        ../addressgrantleeobject.cpp ../iconnamecache.cpp)
+    add_executable(addresseslocationviewer ${addresseslocationviewer_SRCS})
+    add_test(addresseslocationviewer addresseslocationviewer)
+    ecm_mark_as_test(addresseslocationviewer)
+    target_link_libraries(addresseslocationviewer Qt5::Test  Qt5::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n ${contacteditor_webengine_LIB} Grantlee5::Templates
+        KF5::IconThemes KF5::WidgetsAddons)
+endif()
 
 set(addresslocationwidget_SRCS addresslocationwidgettest.cpp ../addresslocationwidget.cpp ../selectaddresstypecombobox.cpp ../addresstypedialog.cpp)
 add_executable(addresslocationwidget ${addresslocationwidget_SRCS})
@@ -22,10 +24,12 @@ add_test(addresslocationwidget addresslocationwidget)
 ecm_mark_as_test(addresslocationwidget)
 target_link_libraries(addresslocationwidget Qt5::Test  Qt5::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion)
 
-set(addresseslocationwidget_SRCS addresseslocationwidgettest.cpp ../addresseslocationwidget.cpp ${contacteditor_addresslocation_web_editor_SRCS} ../addresseslocationgrantleeformater.cpp
-    ../addressgrantleeobject.cpp ../iconnamecache.cpp ../addresslocationwidget.cpp ../selectaddresstypecombobox.cpp ../addresstypedialog.cpp)
-add_executable(addresseslocationwidget ${addresseslocationwidget_SRCS})
-add_test(addresseslocationwidget addresseslocationwidget)
-ecm_mark_as_test(addresseslocationwidget)
-target_link_libraries(addresseslocationwidget Qt5::Test  Qt5::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion ${contacteditor_webengine_LIB}
-    Grantlee5::Templates KF5::IconThemes KF5::WidgetsAddons)
+if (TARGET Qt5::WebEngine)
+    set(addresseslocationwidget_SRCS addresseslocationwidgettest.cpp ../addresseslocationwidget.cpp ${contacteditor_addresslocation_web_editor_SRCS} ../addresseslocationgrantleeformater.cpp
+        ../addressgrantleeobject.cpp ../iconnamecache.cpp ../addresslocationwidget.cpp ../selectaddresstypecombobox.cpp ../addresstypedialog.cpp)
+    add_executable(addresseslocationwidget ${addresseslocationwidget_SRCS})
+    add_test(addresseslocationwidget addresseslocationwidget)
+    ecm_mark_as_test(addresseslocationwidget)
+    target_link_libraries(addresseslocationwidget Qt5::Test  Qt5::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion ${contacteditor_webengine_LIB}
+        Grantlee5::Templates KF5::IconThemes KF5::WidgetsAddons)
+endif()
index 3198e47042ebf99576dfab59c7b5889dd8541f9d..cdfd9164b46ef83b460d93d40ada9c9b6a27fd6a 100644 (file)
@@ -6,29 +6,31 @@ set(akonadicontact_webengine_LIB Qt5::WebEngine Qt5::WebEngineWidgets)
 
 ecm_qt_declare_logging_category(akonadicontact_addresslocation_web_editor_SRCS HEADER contacteditor_debug.h IDENTIFIER CONTACTEDITOR_LOG CATEGORY_NAME org.kde.pim.akonadi_contact)
 
-set(addresseditor_SRCS
-    ${akonadicontact_addresslocation_web_editor_SRCS}
-    main.cpp
-    ../addresseslocationwidget.cpp
-    ../addresseslocationgrantleeformater.cpp
-    ../addressgrantleeobject.cpp
-    ../iconnamecache.cpp
-    ../addresslocationwidget.cpp
-    ../selectaddresstypecombobox.cpp
-    ../addresstypedialog.cpp
-    )
+if (TARGET Qt5::WebEngine)
+    set(addresseditor_SRCS
+        ${akonadicontact_addresslocation_web_editor_SRCS}
+        main.cpp
+        ../addresseslocationwidget.cpp
+        ../addresseslocationgrantleeformater.cpp
+        ../addressgrantleeobject.cpp
+        ../iconnamecache.cpp
+        ../addresslocationwidget.cpp
+        ../selectaddresstypecombobox.cpp
+        ../addresstypedialog.cpp
+        )
 
-add_executable(addresseditortest ${addresseditor_SRCS})
+    add_executable(addresseditortest ${addresseditor_SRCS})
 
-target_link_libraries(addresseditortest
-    Qt5::Widgets
-    KF5::AkonadiContact
-    KF5::Contacts
-    KF5::I18n
-    KF5::Completion
-    Grantlee5::Templates
-    KF5::IconThemes
-    KF5::WidgetsAddons
-    ${akonadicontact_webengine_LIB}
-    )
+    target_link_libraries(addresseditortest
+        Qt5::Widgets
+        KF5::AkonadiContact
+        KF5::Contacts
+        KF5::I18n
+        KF5::Completion
+        Grantlee5::Templates
+        KF5::IconThemes
+        KF5::WidgetsAddons
+        ${akonadicontact_webengine_LIB}
+        )
+endif()
 
index abc235dcc39c0e86bca9a73e4a5f742dddf95b7f..24411b285c45f0b1a250830f67d6a4321f8bfe4e 100644 (file)
@@ -35,7 +35,9 @@
 #include <QDirIterator>
 #include <QPluginLoader>
 #include <QVBoxLayout>
+#ifdef HAVE_WEBENGINE
 #include "addresseditor/addresseslocationwidget.h"
+#endif
 #include "customfieldeditor/customfieldswidget.h"
 #include "businesseditor/businesseditorwidget.h"
 #include "generalinfoeditor/generalinfowidget.h"
@@ -69,8 +71,10 @@ public:
 
     ContactEditor::GeneralInfoWidget *mGeneralInfoWidget;
 
+#ifdef HAVE_WEBENGINE
     // widgets from addresses group
     ContactEditor::AddressesLocationWidget *mAddressesLocationWidget;
+#endif
 
     ContactEditor::BusinessEditorWidget *mBusinessEditorWidget;
 
@@ -113,8 +117,10 @@ void ContactEditorWidget::Private::initGuiContactTab()
 
 void ContactEditorWidget::Private::initGuiLocationTab()
 {
+#ifdef HAVE_WEBENGINE
     mAddressesLocationWidget = new ContactEditor::AddressesLocationWidget;
     mTabWidget->addTab(mAddressesLocationWidget, i18nc("@title:tab", "Location"));
+#endif
 }
 
 void ContactEditorWidget::Private::initGuiBusinessTab()
@@ -211,8 +217,10 @@ void ContactEditorWidget::loadContact(const KContacts::Addressee &contact, const
 {
     d->mGeneralInfoWidget->loadContact(contact);
 
+#ifdef HAVE_WEBENGINE
     // address group
     d->mAddressesLocationWidget->loadContact(contact);
+#endif
 
     // general group
     d->mBusinessEditorWidget->loadContact(contact);
@@ -237,8 +245,10 @@ void ContactEditorWidget::storeContact(KContacts::Addressee &contact, ContactEdi
 {
     d->mGeneralInfoWidget->storeContact(contact);
 
+#ifdef HAVE_WEBENGINE
     // address group
     d->mAddressesLocationWidget->storeContact(contact);
+#endif
 
     // general group
     d->mBusinessEditorWidget->storeContact(contact);
@@ -264,8 +274,10 @@ void ContactEditorWidget::storeContact(KContacts::Addressee &contact, ContactEdi
 void ContactEditorWidget::setReadOnly(bool readOnly)
 {
     d->mGeneralInfoWidget->setReadOnly(readOnly);
+#ifdef HAVE_WEBENGINE
     // widgets from addresses group
     d->mAddressesLocationWidget->setReadOnly(readOnly);
+#endif
 
     // widgets from general group
     d->mBusinessEditorWidget->setReadOnly(readOnly);