GUI-Wx: Fix variable initializations.

Codacy Warning: Variable 'variable' is assigned in constructor body. Consider performing initialization in initialization list.
This commit is contained in:
lightningterror 2022-08-24 03:43:53 +02:00
parent ab430355ec
commit 98724979cb
7 changed files with 30 additions and 34 deletions

View File

@ -557,8 +557,8 @@ AppConfig::AppConfig()
, McdSettingsTabName(L"none")
, AppSettingsTabName(L"none")
, GameDatabaseTabName(L"none")
, LanguageId(wxLANGUAGE_DEFAULT)
{
LanguageId = wxLANGUAGE_DEFAULT;
LanguageCode = L"default";
RecentIsoCount = 20;
Listbook_ImageSize = 32;
@ -827,6 +827,8 @@ void AppSetEmuFolders()
// ------------------------------------------------------------------------
AppConfig::GSWindowOptions::GSWindowOptions()
: WindowSize(wxSize(640, 480))
, WindowPos(wxDefaultPosition)
{
CloseOnEsc = true;
DefaultToFullscreen = false;
@ -834,8 +836,6 @@ AppConfig::GSWindowOptions::GSWindowOptions()
DisableResizeBorders = false;
DisableScreenSaver = true;
WindowSize = wxSize(640, 480);
WindowPos = wxDefaultPosition;
IsMaximized = false;
IsFullscreen = false;
EnableVsyncWindowFlag = false;
@ -934,18 +934,18 @@ void AppConfig::CaptureOptions::LoadSave(IniInterface& ini)
}
AppConfig::UiTemplateOptions::UiTemplateOptions()
: LimiterUnlimited(L"Max")
, LimiterTurbo(L"Turbo")
, LimiterSlowmo(L"Slowmo")
, LimiterNormal(L"Normal")
, OutputFrame(L"Frame")
, OutputField(L"Field")
, OutputProgressive(L"Progressive")
, OutputInterlaced(L"Interlaced")
, Paused(L"<PAUSED> ")
, TitleTemplate(L"Slot: ${slot} | Speed: ${speed} (${vfps}) | ${videomode} | Limiter: ${limiter} | ${gs} | ${omodei} | ${cpuusage}")
, RecordingTemplate(L"Slot: ${slot} | Frame: ${frame}/${maxFrame} | Rec. Mode: ${mode} | Speed: ${speed} (${vfps}) | Limiter: ${limiter}")
{
LimiterUnlimited = L"Max";
LimiterTurbo = L"Turbo";
LimiterSlowmo = L"Slowmo";
LimiterNormal = L"Normal";
OutputFrame = L"Frame";
OutputField = L"Field";
OutputProgressive = L"Progressive";
OutputInterlaced = L"Interlaced";
Paused = L"<PAUSED> ";
TitleTemplate = L"Slot: ${slot} | Speed: ${speed} (${vfps}) | ${videomode} | Limiter: ${limiter} | ${gs} | ${omodei} | ${cpuusage}";
RecordingTemplate = L"Slot: ${slot} | Frame: ${frame}/${maxFrame} | Rec. Mode: ${mode} | Speed: ${speed} (${vfps}) | Limiter: ${limiter}";
}
void AppConfig::UiTemplateOptions::LoadSave(IniInterface& ini)

View File

@ -112,8 +112,8 @@ static void PostCoreStatus(CoreThreadStatus pevt)
// --------------------------------------------------------------------------------------
AppCoreThread::AppCoreThread()
: SysCoreThread()
, m_resetCdvd(false)
{
m_resetCdvd = false;
}
AppCoreThread::~AppCoreThread()

View File

@ -677,6 +677,10 @@ protected:
Pcsx2App::Pcsx2App()
: SysExecutorThread(new SysEvtHandler())
, m_id_MainFrame(wxID_ANY)
, m_id_GsFrame(wxID_ANY)
, m_id_ProgramLogBox(wxID_ANY)
, m_id_Disassembler(wxID_ANY)
{
// Warning: Do not delete this comment block! Gettext will parse it to allow
// the translation of some wxWidget internal strings. -- greg
@ -717,10 +721,6 @@ Pcsx2App::Pcsx2App()
m_UseGUI = true;
m_NoGuiExitPrompt = true;
m_id_MainFrame = wxID_ANY;
m_id_GsFrame = wxID_ANY;
m_id_ProgramLogBox = wxID_ANY;
m_id_Disassembler = wxID_ANY;
m_ptr_ProgramLog = NULL;
SetAppName(L"PCSX2");

View File

@ -387,13 +387,13 @@ ConsoleLogFrame::ConsoleLogFrame( MainEmuFrame *parent, const wxString& title, A
, m_timer_FlushUnlocker( this )
, m_ColorTable( options.FontSize )
, m_pendingFlushMsg(false)
, m_WaitingThreadsForFlush(0)
, m_QueueColorSection( "ConsoleLog::QueueColorSection" )
, m_QueueBuffer( "ConsoleLog::QueueBuffer" )
, m_threadlogger( EnableThreadedLoggingTest ? new ConsoleTestThread() : NULL )
{
m_CurQueuePos = 0;
m_WaitingThreadsForFlush = 0;
m_pendingFlushMsg = false;
m_FlushRefreshLocked = false;
// create Log menu (contains most options)

View File

@ -41,8 +41,8 @@ protected:
public:
DroppedTooManyFiles( const wxWindow* window )
: pxActionEvent()
, m_ownerid(window->GetId())
{
m_ownerid = window->GetId();
}
virtual ~DroppedTooManyFiles() = default;
@ -70,8 +70,8 @@ protected:
public:
DroppedElf( const wxWindow* window )
: pxActionEvent()
, m_ownerid(window->GetId())
{
m_ownerid = window->GetId();
}
virtual ~DroppedElf() = default;
@ -118,9 +118,9 @@ protected:
public:
DroppedIso( const wxWindow* window, const wxString& filename )
: pxActionEvent()
, m_filename( filename )
, m_ownerid(window->GetId())
, m_filename(filename)
{
m_ownerid = window->GetId();
}
virtual ~DroppedIso() = default;

View File

@ -64,14 +64,13 @@ namespace PINESettings
// --------------------------------------------------------------------------------------
SysCoreThread::SysCoreThread()
: m_hasActiveMachine(false)
{
m_name = L"EE Core";
m_resetRecompilers = true;
m_resetProfilers = true;
m_resetVsyncTimers = true;
m_resetVirtualMachine = true;
m_hasActiveMachine = false;
}
SysCoreThread::~SysCoreThread()

View File

@ -50,9 +50,8 @@ static wxString i18n_GetBetterLanguageName( const wxLanguageInfo* info )
}
LangPackEnumeration::LangPackEnumeration( wxLanguage langId )
: wxLangId(langId)
{
wxLangId = langId;
if (const wxLanguageInfo* info = wxLocale::GetLanguageInfo( wxLangId ))
{
canonicalName = info->CanonicalName;
@ -61,12 +60,10 @@ LangPackEnumeration::LangPackEnumeration( wxLanguage langId )
}
LangPackEnumeration::LangPackEnumeration()
: wxLangId(wxLANGUAGE_DEFAULT)
, canonicalName(L"default")
, englishName(L"System Default" + _(" (default)"))
{
wxLangId = wxLANGUAGE_DEFAULT;
englishName = L"System Default";
englishName += _(" (default)");
canonicalName = L"default";
int sysLang = wxLocale::GetSystemLanguage();
if (sysLang == wxLANGUAGE_UNKNOWN)