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)
${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}
editor/addresseditor/addresseslocationgrantleeformater.cpp
editor/addresseditor/addressgrantleeobject.cpp
editor/addresseditor/iconnamecache.cpp
- editor/addresseditor/addresseslocationwidget.cpp
editor/addresseditor/selectaddresstypecombobox.cpp
editor/addresseditor/addresstypedialog.cpp
)
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}
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})
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()
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()
#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"
ContactEditor::GeneralInfoWidget *mGeneralInfoWidget;
+#ifdef HAVE_WEBENGINE
// widgets from addresses group
ContactEditor::AddressesLocationWidget *mAddressesLocationWidget;
+#endif
ContactEditor::BusinessEditorWidget *mBusinessEditorWidget;
void ContactEditorWidget::Private::initGuiLocationTab()
{
+#ifdef HAVE_WEBENGINE
mAddressesLocationWidget = new ContactEditor::AddressesLocationWidget;
mTabWidget->addTab(mAddressesLocationWidget, i18nc("@title:tab", "Location"));
+#endif
}
void ContactEditorWidget::Private::initGuiBusinessTab()
{
d->mGeneralInfoWidget->loadContact(contact);
+#ifdef HAVE_WEBENGINE
// address group
d->mAddressesLocationWidget->loadContact(contact);
+#endif
// general group
d->mBusinessEditorWidget->loadContact(contact);
{
d->mGeneralInfoWidget->storeContact(contact);
+#ifdef HAVE_WEBENGINE
// address group
d->mAddressesLocationWidget->storeContact(contact);
+#endif
// general group
d->mBusinessEditorWidget->storeContact(contact);
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);