From 1e88a55671d6514894a663bf207d783e85759781 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 29 Apr 2019 09:46:48 +0200 Subject: Check that SSL support is available at compile time before using it Change-Id: Id0e7e14a06306a2d8c2098bcb6de6c53d28ca88f Reviewed-by: Paolo Angelelli --- examples/location/mapviewer/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/location/mapviewer/main.cpp b/examples/location/mapviewer/main.cpp index 39c117ed..b332de8c 100644 --- a/examples/location/mapviewer/main.cpp +++ b/examples/location/mapviewer/main.cpp @@ -52,7 +52,9 @@ #include #include #include +#if QT_CONFIG(ssl) #include +#endif #include static bool parseArgs(QStringList& args, QVariantMap& parameters) @@ -133,7 +135,11 @@ int main(int argc, char *argv[]) parameters[QStringLiteral("osm.useragent")] = QStringLiteral("QtLocation Mapviewer example"); QQmlApplicationEngine engine; +#if QT_CONFIG(ssl) engine.rootContext()->setContextProperty("supportsSsl", QSslSocket::supportsSsl()); +#else + engine.rootContext()->setContextProperty("supportsSsl", false); +#endif engine.addImportPath(QStringLiteral(":/imports")); engine.load(QUrl(QStringLiteral("qrc:///mapviewer.qml"))); QObject::connect(&engine, SIGNAL(quit()), qApp, SLOT(quit())); -- cgit v1.2.1