Skip to content

Commit

Permalink
refactor: replace deprecated methods and remove unused include
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanAizek committed Feb 29, 2024
1 parent c7771d6 commit 5ea8e3f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/Convert_HDD_Image_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const QString &Convert_HDD_Thread::Get_Error_Message() const

void Convert_HDD_Thread::run()
{
QProcess *proc = new QProcess();
auto* proc = new QProcess();

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

QString err_str = proc->readAllStandardError();
const QString& err_str = proc->readAllStandardError();
delete proc;

if (err_str.count() > 0)
if (err_str.size() > 0)
{
AQError("void Convert_HDD_Thread::run()", "qemu-img Send Error String!\nDetalis: " + err_str);
Error_Message = err_str;
Expand Down
2 changes: 1 addition & 1 deletion src/Create_Template_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void Create_Template_Window::on_Button_Create_clicked()
return;
}

if( ui.Edit_Template_Folder->text().at(ui.Edit_Template_Folder->text().count()-1) != '/' )
if( ui.Edit_Template_Folder->text().at(ui.Edit_Template_Folder->text().size()-1) != '/' )
{
ui.Edit_Template_Folder->setText( QDir::toNativeSeparators(ui.Edit_Template_Folder->text() + "/") );
}
Expand Down
5 changes: 2 additions & 3 deletions src/Emulator_Control_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#endif

#include "Utils.h"
#include "Ports_Tab_Widget.h"
#include "Emulator_Control_Window.h"
#include "System_Info.h"
#include "Snapshots_Window.h"
Expand Down Expand Up @@ -266,9 +265,9 @@ void Emulator_Control_Window::Create_Device_Menu()
fileIndex += jumpSize;

// Get path
if( fileIndex < value.count() )
if( fileIndex < value.size() )
{
for( int ix = fileIndex; ix < value.count(); ++ix )
for( int ix = fileIndex; ix < value.size(); ++ix )
{
if( value[ix] == ' ' && value[ix-1] != '\\' ) // End of file name?
{
Expand Down
2 changes: 0 additions & 2 deletions src/Settings_Widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
#include "Settings_Widget.h"
#include "Utils.h"

#include <iostream>

My_List_Widget::My_List_Widget(QWidget* parent) : QListWidget(parent)
{

Expand Down
2 changes: 0 additions & 2 deletions src/Snapshots_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include "Utils.h"
#include "Snapshots_Window.h"
#include "Snapshot_Properties_Window.h"
#include "HDD_Image_Info.h"
#include "Service.h"

Snapshots_Window::Snapshots_Window( QWidget *parent )
: QDialog( parent )
Expand Down
6 changes: 3 additions & 3 deletions src/System_Info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2112,7 +2112,7 @@ Available_Devices System_Info::Get_Emulator_Info(const QString &path, bool *ok,
continue;

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

QStringList net_cards_models = all_models.split(',', Qt::SkipEmptyParts);
Expand Down Expand Up @@ -3011,7 +3011,7 @@ QStringList System_Info::Get_Host_FDD_List()
}
else
{
WCHAR *w = new WCHAR[tmp.count()];
WCHAR *w = new WCHAR[tmp.size()];
tmp.toWCharArray(w);
UINT uDriveType = GetDriveType(w);
delete[] w;
Expand Down Expand Up @@ -3046,7 +3046,7 @@ QStringList System_Info::Get_Host_CDROM_List()
}
else
{
WCHAR *w = new WCHAR[tmp.count()];
WCHAR *w = new WCHAR[tmp.size()];
tmp.toWCharArray(w);
UINT uDriveType = GetDriveType(w);
delete[] w;
Expand Down
4 changes: 2 additions & 2 deletions src/VM_Devices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3608,7 +3608,7 @@ QString VM_Net_Card::Generate_MAC() const
}

// MAC Found?
if( nmac.count() != 12 )
if( nmac.size() != 12 )
{
AQError( "QString VM_Net_Card::Generate_MAC() const",
"Cannot Get MAC for This Card!" );
Expand All @@ -3620,7 +3620,7 @@ QString VM_Net_Card::Generate_MAC() const
}

// Adding separators :
for( int nx = 2; nx < nmac.count(); nx+=3 )
for( int nx = 2; nx < nmac.size(); nx+=3 )
{
nmac = nmac.insert( nx, ":" );
}
Expand Down

0 comments on commit 5ea8e3f

Please sign in to comment.