diff options
author | Grigorii Zimin <gzimin@luxoft.com> | 2019-09-06 16:07:19 +0300 |
---|---|---|
committer | Grigorii Zimin <gzimin@luxoft.com> | 2019-09-06 15:58:31 +0000 |
commit | e87ce768bf1b4ab0fccdf99198f06722d0fd7242 (patch) | |
tree | 98b288cdb1087a14b12acbcdfba09c849b2139d2 | |
parent | 44d31915da3948343279941cf993cc0058fb51bd (diff) |
[systeminfo] stop send https requests if the system has no ssl lib
Task-number: AUTOSUITE-1224
Change-Id: I588d6d35deadaf8899344e03073c8cc02fa96bbf
Reviewed-by: Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>
-rw-r--r-- | plugins/systeminfo/systeminfo.cpp | 10 | ||||
-rw-r--r-- | plugins/systeminfo/systeminfo.h | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/plugins/systeminfo/systeminfo.cpp b/plugins/systeminfo/systeminfo.cpp index 3560842f..8a782572 100644 --- a/plugins/systeminfo/systeminfo.cpp +++ b/plugins/systeminfo/systeminfo.cpp @@ -35,6 +35,7 @@ #include <QStandardPaths> #include <QSysInfo> #include <QLibraryInfo> +#include <QtQml/qqmlinfo.h> #include "systeminfo.h" @@ -72,7 +73,14 @@ SystemInfo::~SystemInfo() void SystemInfo::init() { getAddress(); - m_timerId = startTimer(1000, Qt::VeryCoarseTimer); + if (QSslSocket::supportsSsl()) { + m_timerId = startTimer(1000, Qt::VeryCoarseTimer); + } else { + updateInternetAccessStatus(false); + qmlWarning(this) << "SSL/TLS is not supported in this installation. HTTPS connections can't be established"; + qmlWarning(this) << "Please verify, SSL library is installed and/or updated"; + qmlWarning(this) << "This installation was build with: " << QSslSocket::sslLibraryBuildVersionString(); + } } /* diff --git a/plugins/systeminfo/systeminfo.h b/plugins/systeminfo/systeminfo.h index 1451af52..97eb0e61 100644 --- a/plugins/systeminfo/systeminfo.h +++ b/plugins/systeminfo/systeminfo.h @@ -91,7 +91,7 @@ private: void getAddress(); void getQtDiagInfo(); QStringList m_addressList; - int m_timerId; + int m_timerId{0}; bool m_connected{false}; bool m_internetAccess{false}; QString m_qtDiagContents; |