From 1187026bb43699126ac9541d64e16cac9f7bcb4a Mon Sep 17 00:00:00 2001 From: Chris Trowbridge Date: Tue, 24 Oct 2023 08:10:49 -0400 Subject: [PATCH] Fix MSVC/x64 builds --- CommandGroup.cpp | 15 +++++++++------ PredefinedCommand.cpp | 15 +++++++++------ UwTerminalX.pro | 1 + UwxMainWindow.cpp | 4 ---- UwxPredefinedCommands.cpp | 5 +++-- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/CommandGroup.cpp b/CommandGroup.cpp index f790732..cf6e512 100644 --- a/CommandGroup.cpp +++ b/CommandGroup.cpp @@ -98,14 +98,17 @@ CommandGroup *CommandGroup::fromJson(const QJsonObject &json) { CommandGroup *result = new CommandGroup(""); - if (const QJsonValue v = json["uuid"]; v.isString()) - result->uuid = QUuid(v.toString()); + const QJsonValue uuidValue = json["uuid"]; + if (uuidValue.isString()) + result->uuid = QUuid(uuidValue.toString()); - if (const QJsonValue v = json["name"]; v.isString()) - result->mstrName = v.toString(); + const QJsonValue nameValue = json["name"]; + if (nameValue.isString()) + result->mstrName = nameValue.toString(); - if (const QJsonValue v = json["commands"]; v.isArray()) { - const QJsonArray commands = v.toArray(); + const QJsonValue commandsValue = json["commands"]; + if (commandsValue.isArray()) { + const QJsonArray commands = commandsValue.toArray(); result->mlPredefinedCommands->reserve(commands.size()); for (const QJsonValue &command : commands) result->mlPredefinedCommands->append(*PredefinedCommand::fromJson(command.toObject())); diff --git a/PredefinedCommand.cpp b/PredefinedCommand.cpp index a0fc4a8..b7bf570 100644 --- a/PredefinedCommand.cpp +++ b/PredefinedCommand.cpp @@ -89,14 +89,17 @@ PredefinedCommand *PredefinedCommand::fromJson(const QJsonObject &json) { PredefinedCommand *result = new PredefinedCommand(); - if (const QJsonValue v = json["uuid"]; v.isString()) - result->uuid = QUuid(v.toString()); + const QJsonValue uuidValue = json["uuid"]; + if (uuidValue.isString()) + result->uuid = QUuid(uuidValue.toString()); - if (const QJsonValue v = json["command"]; v.isString()) - result->mstrCommand = v.toString(); + const QJsonValue commandValue = json["command"]; + if (commandValue.isString()) + result->mstrCommand = commandValue.toString(); - if (const QJsonValue v = json["description"]; v.isString()) - result->mstrDescription = v.toString(); + const QJsonValue descriptionValue = json["description"]; + if (descriptionValue.isString()) + result->mstrDescription = descriptionValue.toString(); return result; } diff --git a/UwTerminalX.pro b/UwTerminalX.pro index 2ccdbd4..ffdee2f 100644 --- a/UwTerminalX.pro +++ b/UwTerminalX.pro @@ -98,6 +98,7 @@ RESOURCES += \ #64-bit windows win32: LIBS += -L$$PWD/FTDI/Win64/ -lftd2xx } + win32:!*g++*: LIBS += -llegacy_stdio_definitions HEADERS += FTDI/ftd2xx.h } diff --git a/UwxMainWindow.cpp b/UwxMainWindow.cpp index 37638ce..46b5591 100644 --- a/UwxMainWindow.cpp +++ b/UwxMainWindow.cpp @@ -103,10 +103,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi //Setup the GUI ui->setupUi(this); -#if !defined(_WIN32) && !defined(__APPLE__) - setWindowIcon(QIcon(":/images/UwTerminal32.png")); -#endif - #if SKIPSPEEDTEST == 1 //Delete speed test elements to reduce RAM usage ui->tab_SpeedTest->setEnabled(false); diff --git a/UwxPredefinedCommands.cpp b/UwxPredefinedCommands.cpp index c889920..8f4f9c0 100644 --- a/UwxPredefinedCommands.cpp +++ b/UwxPredefinedCommands.cpp @@ -483,8 +483,9 @@ UwxPredefinedCommands::LoadFile( QJsonObject json = loadDoc.object(); - if (const QJsonValue v = json["groups"]; v.isArray()) { - const QJsonArray groups = v.toArray(); + const QJsonValue groupsValue = json["groups"]; + if (groupsValue.isArray()) { + const QJsonArray groups = groupsValue.toArray(); // Clear current commands int tabCount = ui->tabWidget->count();