From 37c4c596b5ce29bc42db130cd10532aaf9acd8a7 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 4 Mar 2022 18:04:05 +1000 Subject: [PATCH] Qt: Fix a few warnings on Linux --- pcsx2-qt/EmuThread.cpp | 3 +++ pcsx2-qt/MainWindow.cpp | 20 ++----------------- pcsx2-qt/MainWindow.h | 2 +- pcsx2-qt/Settings/AudioSettingsWidget.cpp | 2 +- pcsx2-qt/Settings/GameListSettingsWidget.cpp | 2 +- pcsx2-qt/Settings/InputBindingWidget.cpp | 1 - .../Settings/MemoryCardSettingsWidget.cpp | 2 +- pcsx2-qt/Settings/SettingsDialog.h | 2 +- pcsx2-qt/Settings/SystemSettingsWidget.cpp | 2 +- 9 files changed, 11 insertions(+), 25 deletions(-) diff --git a/pcsx2-qt/EmuThread.cpp b/pcsx2-qt/EmuThread.cpp index c304ae2575..c0847b3612 100644 --- a/pcsx2-qt/EmuThread.cpp +++ b/pcsx2-qt/EmuThread.cpp @@ -285,6 +285,9 @@ void EmuThread::executeVM() destroyVM(); m_event_loop->processEvents(QEventLoop::AllEvents); return; + + default: + continue; } } } diff --git a/pcsx2-qt/MainWindow.cpp b/pcsx2-qt/MainWindow.cpp index 0ae0d32a44..adebb3e67e 100644 --- a/pcsx2-qt/MainWindow.cpp +++ b/pcsx2-qt/MainWindow.cpp @@ -241,9 +241,6 @@ void MainWindow::setStyleFromSettings() // Alternative white theme. qApp->setStyle(QStyleFactory::create("Fusion")); - const QColor lighterGray(75, 75, 75); - const QColor darkGray(53, 53, 53); - const QColor gray(128, 128, 128); const QColor black(25, 25, 25); const QColor teal(0, 128, 128); const QColor tameTeal(160, 190, 185); @@ -279,18 +276,12 @@ void MainWindow::setStyleFromSettings() // Alternative light theme. qApp->setStyle(QStyleFactory::create("Fusion")); - const QColor lighterGray(75, 75, 75); const QColor gray(150, 150, 150); const QColor black(25, 25, 25); - const QColor darkPink(180, 80, 200); const QColor pink(255, 174, 201); const QColor brightPink(255, 230, 255); const QColor congoPink(255, 127, 121); - const QColor yellow(255, 235, 180); - const QColor darkGreen(161, 240, 183); - const QColor green(221, 239, 226); const QColor blue(221, 225, 239); - const QColor darkBlue(100, 95, 250); QPalette standardPalette; standardPalette.setColor(QPalette::Window, pink); @@ -322,13 +313,10 @@ void MainWindow::setStyleFromSettings() // Alternative light theme. qApp->setStyle(QStyleFactory::create("Fusion")); - const QColor lighterGray(75, 75, 75); - const QColor gray(128, 128, 128); const QColor black(25, 25, 25); const QColor darkBlue(73, 97, 177); const QColor blue(106, 156, 255); const QColor lightBlue(130, 155, 241); - const QColor brightBlue(164, 184, 255); QPalette standardPalette; standardPalette.setColor(QPalette::Window, lightBlue); @@ -394,7 +382,6 @@ void MainWindow::setStyleFromSettings() // adapted from https://gist.github.com/QuantumCD/6245215 qApp->setStyle(QStyleFactory::create("Fusion")); - const QColor lighterGray(75, 75, 75); const QColor darkGray(53, 53, 53); const QColor gray(128, 128, 128); const QColor black(25, 25, 25); @@ -431,9 +418,6 @@ void MainWindow::setStyleFromSettings() // Alternative dark theme. qApp->setStyle(QStyleFactory::create("Fusion")); - const QColor lighterGray(75, 75, 75); - const QColor gray(128, 128, 128); - const QColor black(25, 25, 25); const QColor darkRed(80, 45, 69); const QColor purplishRed(120, 45, 69); const QColor brightRed(200, 45, 69); @@ -692,7 +676,7 @@ void MainWindow::onGameListEntryContextMenuRequested(const QPoint& point) QAction* action = menu.addAction(tr("Properties...")); action->setEnabled(!entry->serial.empty()); if (action->isEnabled()) - connect(action, &QAction::triggered, [this, entry]() { SettingsDialog::openGamePropertiesDialog(entry, entry->crc); }); + connect(action, &QAction::triggered, [entry]() { SettingsDialog::openGamePropertiesDialog(entry, entry->crc); }); action = menu.addAction(tr("Open Containing Directory...")); connect(action, &QAction::triggered, [this, entry]() { @@ -1461,7 +1445,7 @@ void MainWindow::populateSaveStateMenu(QMenu* menu, const QString& serial, quint timestamp = tr("Empty"); QString title(tr("Save Slot %1 (%2)").arg(i).arg(timestamp)); - connect(menu->addAction(title), &QAction::triggered, [this, i]() { g_emu_thread->saveStateToSlot(i); }); + connect(menu->addAction(title), &QAction::triggered, [i]() { g_emu_thread->saveStateToSlot(i); }); } } diff --git a/pcsx2-qt/MainWindow.h b/pcsx2-qt/MainWindow.h index 0d80b03d22..ecb741e7e5 100644 --- a/pcsx2-qt/MainWindow.h +++ b/pcsx2-qt/MainWindow.h @@ -104,7 +104,7 @@ private Q_SLOTS: void recreate(); protected: - void closeEvent(QCloseEvent* event); + void closeEvent(QCloseEvent* event) override; private: enum : s32 diff --git a/pcsx2-qt/Settings/AudioSettingsWidget.cpp b/pcsx2-qt/Settings/AudioSettingsWidget.cpp index 27e758fb81..80d54281d9 100644 --- a/pcsx2-qt/Settings/AudioSettingsWidget.cpp +++ b/pcsx2-qt/Settings/AudioSettingsWidget.cpp @@ -27,7 +27,7 @@ AudioSettingsWidget::AudioSettingsWidget(SettingsDialog* dialog, QWidget* parent) : QWidget(parent) { - SettingsInterface* sif = dialog->getSettingsInterface(); + // SettingsInterface* sif = dialog->getSettingsInterface(); m_ui.setupUi(this); } diff --git a/pcsx2-qt/Settings/GameListSettingsWidget.cpp b/pcsx2-qt/Settings/GameListSettingsWidget.cpp index e079000140..a0de8dd250 100644 --- a/pcsx2-qt/Settings/GameListSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GameListSettingsWidget.cpp @@ -102,7 +102,7 @@ void GameListSettingsWidget::addPathToTable(const std::string& path, bool recurs m_ui.searchDirectoryList->setCellWidget(row, 1, cb); cb->setChecked(recursive); - connect(cb, &QCheckBox::stateChanged, [this, item](int state) { + connect(cb, &QCheckBox::stateChanged, [item](int state) { const std::string path(item->text().toStdString()); if (state == Qt::Checked) { diff --git a/pcsx2-qt/Settings/InputBindingWidget.cpp b/pcsx2-qt/Settings/InputBindingWidget.cpp index 6690d533ae..5bf3c8a591 100644 --- a/pcsx2-qt/Settings/InputBindingWidget.cpp +++ b/pcsx2-qt/Settings/InputBindingWidget.cpp @@ -1,4 +1,3 @@ -/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs * Copyright (C) 2002-2022 PCSX2 Dev Team * diff --git a/pcsx2-qt/Settings/MemoryCardSettingsWidget.cpp b/pcsx2-qt/Settings/MemoryCardSettingsWidget.cpp index 255705f03e..e2803b8869 100644 --- a/pcsx2-qt/Settings/MemoryCardSettingsWidget.cpp +++ b/pcsx2-qt/Settings/MemoryCardSettingsWidget.cpp @@ -27,7 +27,7 @@ MemoryCardSettingsWidget::MemoryCardSettingsWidget(SettingsDialog* dialog, QWidget* parent) : QWidget(parent) { - SettingsInterface* sif = dialog->getSettingsInterface(); + // SettingsInterface* sif = dialog->getSettingsInterface(); m_ui.setupUi(this); } diff --git a/pcsx2-qt/Settings/SettingsDialog.h b/pcsx2-qt/Settings/SettingsDialog.h index 2b3ab2f236..497a633941 100644 --- a/pcsx2-qt/Settings/SettingsDialog.h +++ b/pcsx2-qt/Settings/SettingsDialog.h @@ -93,7 +93,7 @@ private Q_SLOTS: void onRestoreDefaultsClicked(); protected: - void closeEvent(QCloseEvent*); + void closeEvent(QCloseEvent*) override; private: enum : u32 diff --git a/pcsx2-qt/Settings/SystemSettingsWidget.cpp b/pcsx2-qt/Settings/SystemSettingsWidget.cpp index 839af5cd55..b04a950d19 100644 --- a/pcsx2-qt/Settings/SystemSettingsWidget.cpp +++ b/pcsx2-qt/Settings/SystemSettingsWidget.cpp @@ -37,7 +37,7 @@ SystemSettingsWidget::SystemSettingsWidget(SettingsDialog* dialog, QWidget* pare m_ui.setupUi(this); - SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.eeCycleSkipping, "EmuCore/Speedhacks", "EECycleSkip", 0); + SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.eeCycleSkipping, "EmuCore/Speedhacks", "EECycleSkip", DEFAULT_EE_CYCLE_SKIP); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.MTVU, "EmuCore/Speedhacks", "vuThread", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.instantVU1, "EmuCore/Speedhacks", "vu1Instant", true);