Skip to content

Commit

Permalink
Fix MSVC/x64 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
trowbridgec1 committed Oct 30, 2023
1 parent 5a20e92 commit 1187026
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
15 changes: 9 additions & 6 deletions CommandGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
15 changes: 9 additions & 6 deletions PredefinedCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions UwTerminalX.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 0 additions & 4 deletions UwxMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions UwxPredefinedCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 1187026

Please sign in to comment.