From e490ec1c4de6989cfff236dbac8625841da3c2cb Mon Sep 17 00:00:00 2001 From: Floris Bos Date: Mon, 22 May 2023 10:44:13 +0200 Subject: [PATCH] Windows: fix depreceation warnings - winsock2.h should be included before windows.h - QProcess::execute('name') -> QProcess::execute('name', args); --- src/downloadthread.cpp | 2 +- src/downloadthread.h | 4 ++++ src/driveformatthread.cpp | 2 +- src/imagewriter.cpp | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp index 01ce22d..c603d0e 100644 --- a/src/downloadthread.cpp +++ b/src/downloadthread.cpp @@ -153,7 +153,7 @@ bool DownloadThread::_openAndPrepareDevice() qDebug() << "Removing partition table from Windows drive #" << _nr << "(" << _filename << ")"; QProcess proc; - proc.start("diskpart"); + proc.start("diskpart", QStringList()); proc.waitForStarted(); proc.write("select disk "+_nr+"\r\n" "clean\r\n" diff --git a/src/downloadthread.h b/src/downloadthread.h index b7275af..40134f3 100644 --- a/src/downloadthread.h +++ b/src/downloadthread.h @@ -6,6 +6,10 @@ * Copyright (C) 2020 Raspberry Pi Ltd */ +#ifdef _WIN32 +#include +#endif + #include #include #include diff --git a/src/driveformatthread.cpp b/src/driveformatthread.cpp index 5482162..11a5748 100644 --- a/src/driveformatthread.cpp +++ b/src/driveformatthread.cpp @@ -48,7 +48,7 @@ void DriveFormatThread::run() "select partition 1\r\n" "set id=0e\r\n" "assign\r\n"; - proc.start("diskpart"); + proc.start("diskpart", QStringList()); proc.waitForStarted(); proc.write(diskpartCmds); proc.closeWriteChannel(); diff --git a/src/imagewriter.cpp b/src/imagewriter.cpp index 1d815ac..a04be2d 100644 --- a/src/imagewriter.cpp +++ b/src/imagewriter.cpp @@ -3,9 +3,9 @@ * Copyright (C) 2020 Raspberry Pi Ltd */ +#include "downloadextractthread.h" #include "imagewriter.h" #include "drivelistitem.h" -#include "downloadextractthread.h" #include "dependencies/drivelist/src/drivelist.hpp" #include "dependencies/sha256crypt/sha256crypt.h" #include "driveformatthread.h"