From b63716370433c22e4623dee2edc286eec99e2975 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 27 Mar 2018 22:26:57 -0400 Subject: [PATCH 1/7] CodeWidget: Remove unnecessary c_str() calls --- Source/Core/DolphinQt2/Debugger/CodeWidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinQt2/Debugger/CodeWidget.cpp b/Source/Core/DolphinQt2/Debugger/CodeWidget.cpp index ec71d0273e..4cbaa1713a 100644 --- a/Source/Core/DolphinQt2/Debugger/CodeWidget.cpp +++ b/Source/Core/DolphinQt2/Debugger/CodeWidget.cpp @@ -310,8 +310,8 @@ void CodeWidget::UpdateFunctionCalls(Symbol* symbol) if (call_symbol) { - auto* item = new QListWidgetItem(QString::fromStdString( - StringFromFormat("> %s (%08x)", call_symbol->name.c_str(), addr).c_str())); + auto* item = new QListWidgetItem( + QString::fromStdString(StringFromFormat("> %s (%08x)", call_symbol->name.c_str(), addr))); item->setData(Qt::UserRole, addr); m_function_calls_list->addItem(item); @@ -331,7 +331,7 @@ void CodeWidget::UpdateFunctionCallers(Symbol* symbol) if (caller_symbol) { auto* item = new QListWidgetItem(QString::fromStdString( - StringFromFormat("< %s (%08x)", caller_symbol->name.c_str(), addr).c_str())); + StringFromFormat("< %s (%08x)", caller_symbol->name.c_str(), addr))); item->setData(Qt::UserRole, addr); m_function_callers_list->addItem(item); From d3283a881f34b2a73944645a8e4684b8bb754a7c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 27 Mar 2018 22:27:48 -0400 Subject: [PATCH 2/7] MenuBar: Remove unnecessary c_str() call Also uses the character overload for find_last_of --- Source/Core/DolphinQt2/MenuBar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt2/MenuBar.cpp b/Source/Core/DolphinQt2/MenuBar.cpp index c9f6641a70..a92255a2ef 100644 --- a/Source/Core/DolphinQt2/MenuBar.cpp +++ b/Source/Core/DolphinQt2/MenuBar.cpp @@ -929,7 +929,7 @@ void MenuBar::LoadSymbolMap() g_symbolDB.LoadMap(existing_map_file); QMessageBox::information( this, tr("Information"), - tr("Loaded symbols from '%1'").arg(QString::fromStdString(existing_map_file.c_str()))); + tr("Loaded symbols from '%1'").arg(QString::fromStdString(existing_map_file))); } HLE::PatchFunctions(); @@ -978,7 +978,7 @@ void MenuBar::SaveCode() CBoot::FindMapFile(&existing_map_file, &writable_map_file); const std::string path = - writable_map_file.substr(0, writable_map_file.find_last_of(".")) + "_code.map"; + writable_map_file.substr(0, writable_map_file.find_last_of('.')) + "_code.map"; g_symbolDB.SaveCodeMap(path); } From 568490fdfb14dbef2b64f81ea54bc231b6e68ddb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 27 Mar 2018 22:28:48 -0400 Subject: [PATCH 3/7] MD5Dialog: Call .empty() instead of testing against an empty string --- Source/Core/DolphinQt2/NetPlay/MD5Dialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt2/NetPlay/MD5Dialog.cpp b/Source/Core/DolphinQt2/NetPlay/MD5Dialog.cpp index b304b73adc..72fb4af5d5 100644 --- a/Source/Core/DolphinQt2/NetPlay/MD5Dialog.cpp +++ b/Source/Core/DolphinQt2/NetPlay/MD5Dialog.cpp @@ -109,7 +109,7 @@ void MD5Dialog::SetResult(int pid, const std::string& result) m_status_labels[pid]->setText( tr("%1[%2]: %3").arg(player_name, QString::number(pid), QString::fromStdString(result))); - if (m_last_result == "") + if (m_last_result.empty()) { m_check_label->setText(tr("The hashes match!")); return; From eb8a853d8e3623fa4d1c0fd86d951d4adc71f14d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 27 Mar 2018 22:30:06 -0400 Subject: [PATCH 4/7] Resources: Remove unused string in Init() --- Source/Core/DolphinQt2/Resources.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Source/Core/DolphinQt2/Resources.cpp b/Source/Core/DolphinQt2/Resources.cpp index d24f8cc184..636947c475 100644 --- a/Source/Core/DolphinQt2/Resources.cpp +++ b/Source/Core/DolphinQt2/Resources.cpp @@ -6,9 +6,7 @@ #include #include #include -#include -#include "Common/CommonPaths.h" #include "Common/FileUtil.h" #include "Core/ConfigManager.h" #include "DolphinQt2/Resources.h" @@ -82,8 +80,6 @@ QPixmap Resources::GetScaledThemePixmap(const std::string& name) void Resources::Init() { - QString sys_dir = QString::fromStdString(File::GetSysDirectory() + RESOURCES_DIR + DIR_SEP); - for (const std::string& platform : {"Platform_Gamecube", "Platform_Wii", "Platform_Wad", "Platform_File"}) { From 833c0304960ba093431885c514664e22384051bb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 27 Mar 2018 22:31:55 -0400 Subject: [PATCH 5/7] WiiPane: Remove unused variable in OnUSBWhitelistRemoveButton() --- Source/Core/DolphinQt2/Settings/WiiPane.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/Core/DolphinQt2/Settings/WiiPane.cpp b/Source/Core/DolphinQt2/Settings/WiiPane.cpp index f14c194b4c..11137f6bb7 100644 --- a/Source/Core/DolphinQt2/Settings/WiiPane.cpp +++ b/Source/Core/DolphinQt2/Settings/WiiPane.cpp @@ -245,7 +245,6 @@ void WiiPane::OnUSBWhitelistAddButton() void WiiPane::OnUSBWhitelistRemoveButton() { - std::set> test_set = SConfig::GetInstance().m_usb_passthrough_devices; QString device = m_whitelist_usb_list->currentItem()->text().left(9); QString vid = QString(device.split(QString::fromStdString(":"), QString::SplitBehavior::KeepEmptyParts)[0]); From 306d132232a18b4b0bb059160d07107b63d949b8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 27 Mar 2018 22:35:06 -0400 Subject: [PATCH 6/7] MainWindow: Remove unused std::string variable in NetPlayHost() --- Source/Core/DolphinQt2/MainWindow.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp index 8b9b22d33e..0f301d904c 100644 --- a/Source/Core/DolphinQt2/MainWindow.cpp +++ b/Source/Core/DolphinQt2/MainWindow.cpp @@ -928,7 +928,6 @@ bool MainWindow::NetPlayHost(const QString& game_id) const std::string traversal_host = Config::Get(Config::NETPLAY_TRAVERSAL_SERVER); const u16 traversal_port = Config::Get(Config::NETPLAY_TRAVERSAL_PORT); - const std::string nickname = Config::Get(Config::NETPLAY_NICKNAME); if (is_traversal) host_port = Config::Get(Config::NETPLAY_LISTEN_PORT); From df4ca7f05eff87ac148083befa046a584fd006dc Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 27 Mar 2018 22:40:21 -0400 Subject: [PATCH 7/7] SearchBar: Remove unused class variables --- Source/Core/DolphinQt2/SearchBar.cpp | 1 - Source/Core/DolphinQt2/SearchBar.h | 3 --- 2 files changed, 4 deletions(-) diff --git a/Source/Core/DolphinQt2/SearchBar.cpp b/Source/Core/DolphinQt2/SearchBar.cpp index 71b38bf92f..f12b359727 100644 --- a/Source/Core/DolphinQt2/SearchBar.cpp +++ b/Source/Core/DolphinQt2/SearchBar.cpp @@ -4,7 +4,6 @@ #include "DolphinQt2/SearchBar.h" -#include #include #include #include diff --git a/Source/Core/DolphinQt2/SearchBar.h b/Source/Core/DolphinQt2/SearchBar.h index 1a4ea7957d..7db5bc0f1a 100644 --- a/Source/Core/DolphinQt2/SearchBar.h +++ b/Source/Core/DolphinQt2/SearchBar.h @@ -6,7 +6,6 @@ #include -class QCheckBox; class QLineEdit; class QPushButton; @@ -25,7 +24,5 @@ private: void ConnectWidgets(); QLineEdit* m_search_edit; - QCheckBox* m_wii_check; - QCheckBox* m_gc_check; QPushButton* m_close_button; };