Skip to content

Commit 5ea8e3f

Browse files
committed
refactor: replace deprecated methods and remove unused include
1 parent c7771d6 commit 5ea8e3f

7 files changed

+11
-16
lines changed

src/Convert_HDD_Image_Window.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const QString &Convert_HDD_Thread::Get_Error_Message() const
4949

5050
void Convert_HDD_Thread::run()
5151
{
52-
QProcess *proc = new QProcess();
52+
auto* proc = new QProcess();
5353

5454
QSettings settings;
5555
proc->start(settings.value("QEMU-IMG_Path", "qemu-img").toString(), Arguments);
@@ -60,10 +60,10 @@ void Convert_HDD_Thread::run()
6060
if (!proc->waitForFinished(-1))
6161
AQError("void Convert_HDD_Thread::run()", "Cannot Finish qemu-img!");
6262

63-
QString err_str = proc->readAllStandardError();
63+
const QString& err_str = proc->readAllStandardError();
6464
delete proc;
6565

66-
if (err_str.count() > 0)
66+
if (err_str.size() > 0)
6767
{
6868
AQError("void Convert_HDD_Thread::run()", "qemu-img Send Error String!\nDetalis: " + err_str);
6969
Error_Message = err_str;

src/Create_Template_Window.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void Create_Template_Window::on_Button_Create_clicked()
9494
return;
9595
}
9696

97-
if( ui.Edit_Template_Folder->text().at(ui.Edit_Template_Folder->text().count()-1) != '/' )
97+
if( ui.Edit_Template_Folder->text().at(ui.Edit_Template_Folder->text().size()-1) != '/' )
9898
{
9999
ui.Edit_Template_Folder->setText( QDir::toNativeSeparators(ui.Edit_Template_Folder->text() + "/") );
100100
}

src/Emulator_Control_Window.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#endif
4040

4141
#include "Utils.h"
42-
#include "Ports_Tab_Widget.h"
4342
#include "Emulator_Control_Window.h"
4443
#include "System_Info.h"
4544
#include "Snapshots_Window.h"
@@ -266,9 +265,9 @@ void Emulator_Control_Window::Create_Device_Menu()
266265
fileIndex += jumpSize;
267266

268267
// Get path
269-
if( fileIndex < value.count() )
268+
if( fileIndex < value.size() )
270269
{
271-
for( int ix = fileIndex; ix < value.count(); ++ix )
270+
for( int ix = fileIndex; ix < value.size(); ++ix )
272271
{
273272
if( value[ix] == ' ' && value[ix-1] != '\\' ) // End of file name?
274273
{

src/Settings_Widget.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
#include "Settings_Widget.h"
3232
#include "Utils.h"
3333

34-
#include <iostream>
35-
3634
My_List_Widget::My_List_Widget(QWidget* parent) : QListWidget(parent)
3735
{
3836

src/Snapshots_Window.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
#include "Utils.h"
2727
#include "Snapshots_Window.h"
2828
#include "Snapshot_Properties_Window.h"
29-
#include "HDD_Image_Info.h"
30-
#include "Service.h"
3129

3230
Snapshots_Window::Snapshots_Window( QWidget *parent )
3331
: QDialog( parent )

src/System_Info.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,7 +2112,7 @@ Available_Devices System_Info::Get_Emulator_Info(const QString &path, bool *ok,
21122112
continue;
21132113

21142114
// Get all models string
2115-
QString all_models = tmp.mid(tmp.indexOf("models:") + QString("models:").count(), tmp.count());
2115+
QString all_models = tmp.mid(tmp.indexOf("models:") + QString("models:").size(), tmp.size());
21162116
all_models.remove(QChar(' ')); // Remove all spaces
21172117

21182118
QStringList net_cards_models = all_models.split(',', Qt::SkipEmptyParts);
@@ -3011,7 +3011,7 @@ QStringList System_Info::Get_Host_FDD_List()
30113011
}
30123012
else
30133013
{
3014-
WCHAR *w = new WCHAR[tmp.count()];
3014+
WCHAR *w = new WCHAR[tmp.size()];
30153015
tmp.toWCharArray(w);
30163016
UINT uDriveType = GetDriveType(w);
30173017
delete[] w;
@@ -3046,7 +3046,7 @@ QStringList System_Info::Get_Host_CDROM_List()
30463046
}
30473047
else
30483048
{
3049-
WCHAR *w = new WCHAR[tmp.count()];
3049+
WCHAR *w = new WCHAR[tmp.size()];
30503050
tmp.toWCharArray(w);
30513051
UINT uDriveType = GetDriveType(w);
30523052
delete[] w;

src/VM_Devices.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3608,7 +3608,7 @@ QString VM_Net_Card::Generate_MAC() const
36083608
}
36093609

36103610
// MAC Found?
3611-
if( nmac.count() != 12 )
3611+
if( nmac.size() != 12 )
36123612
{
36133613
AQError( "QString VM_Net_Card::Generate_MAC() const",
36143614
"Cannot Get MAC for This Card!" );
@@ -3620,7 +3620,7 @@ QString VM_Net_Card::Generate_MAC() const
36203620
}
36213621

36223622
// Adding separators :
3623-
for( int nx = 2; nx < nmac.count(); nx+=3 )
3623+
for( int nx = 2; nx < nmac.size(); nx+=3 )
36243624
{
36253625
nmac = nmac.insert( nx, ":" );
36263626
}

0 commit comments

Comments
 (0)