refactor: Address (Windows) compile warnings (#840)

* Windows compile errors and (Qt 5.15 deprecation) warnings

* Usability - Enable/Disable Instance button

Co-authored-by: brindosch <edeltraud70@gmx.de>
This commit is contained in:
LordGrey
2020-06-28 23:05:32 +02:00
committed by GitHub
parent e365a2839d
commit bfb50b8d91
61 changed files with 530 additions and 365 deletions

View File

@@ -58,7 +58,11 @@ void QtHttpClientWrapper::onClientDataReceived (void)
case AwaitingRequest: // "command url version" × 1
{
QString str = QString::fromUtf8 (line).trimmed ();
QStringList parts = str.split (SPACE, QString::SkipEmptyParts);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList parts = str.split (SPACE, Qt::SkipEmptyParts);
#else
QStringList parts = str.split (SPACE, QString::SkipEmptyParts);
#endif
if (parts.size () == 3)
{
@@ -192,7 +196,12 @@ void QtHttpClientWrapper::onClientDataReceived (void)
// catch /jsonrpc in url, we need async callback, StaticFileServing is sync
QString path = m_currentRequest->getUrl ().path ();
QStringList uri_parts = path.split('/', QString::SkipEmptyParts);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList uri_parts = path.split('/', Qt::SkipEmptyParts);
#else
QStringList uri_parts = path.split('/', QString::SkipEmptyParts);
#endif
if ( ! uri_parts.empty() && uri_parts.at(0) == "json-rpc" )
{

View File

@@ -81,7 +81,11 @@ void StaticFileServing::onRequestNeedsReply (QtHttpRequest * request, QtHttpRepl
if (command == QStringLiteral ("GET"))
{
QString path = request->getUrl ().path ();
QStringList uri_parts = path.split('/', QString::SkipEmptyParts);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QStringList uri_parts = path.split('/', Qt::SkipEmptyParts);
#else
QStringList uri_parts = path.split('/', QString::SkipEmptyParts);
#endif
// special uri handling for server commands
if ( ! uri_parts.empty() )

View File

@@ -239,7 +239,7 @@ void WebSocketClient::handleBinaryMessage(QByteArray &data)
unsigned width = ((data.at(2) << 8) & 0xFF00) | (data.at(3) & 0xFF);
unsigned height = imgSize / width;
if ( ! (imgSize) % width)
if ( imgSize % width > 0 )
{
Error(_log, "data size is not multiple of width");
return;