mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-21 12:04:45 +00:00
SettingsDialog: Passing physical devices as span
This commit is contained in:
parent
c9b96179ef
commit
26685b5b54
3 changed files with 6 additions and 6 deletions
|
@ -202,7 +202,7 @@ void MainWindow::CreateConnects() {
|
|||
&MainWindow::StartGame);
|
||||
|
||||
connect(ui->settingsButton, &QPushButton::clicked, this, [this]() {
|
||||
auto settingsDialog = new SettingsDialog(this, &m_physical_devices);
|
||||
auto settingsDialog = new SettingsDialog(m_physical_devices, this);
|
||||
settingsDialog->exec();
|
||||
});
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "settings_dialog.h"
|
||||
#include "ui_settings_dialog.h"
|
||||
|
||||
SettingsDialog::SettingsDialog(QWidget* parent, std::vector<QString>* physical_devices)
|
||||
SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidget* parent)
|
||||
: QDialog(parent), ui(new Ui::SettingsDialog) {
|
||||
ui->setupUi(this);
|
||||
ui->tabWidgetSettings->setUsesScrollButtons(false);
|
||||
|
@ -14,8 +14,8 @@ SettingsDialog::SettingsDialog(QWidget* parent, std::vector<QString>* physical_d
|
|||
|
||||
// Add list of available GPUs
|
||||
ui->graphicsAdapterBox->addItem("Auto Select"); // -1, auto selection
|
||||
for (auto device = physical_devices->begin(); device != physical_devices->end(); ++device) {
|
||||
ui->graphicsAdapterBox->addItem(*device);
|
||||
for (const auto& device : physical_devices) {
|
||||
ui->graphicsAdapterBox->addItem(device);
|
||||
}
|
||||
|
||||
LoadValuesFromConfig();
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <QDialog>
|
||||
#include <QPushButton>
|
||||
#include <span>
|
||||
|
||||
#include "common/config.h"
|
||||
#include "common/path_util.h"
|
||||
|
@ -16,8 +17,7 @@ class SettingsDialog;
|
|||
class SettingsDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SettingsDialog(QWidget* parent = nullptr,
|
||||
std::vector<QString>* physical_devices = nullptr);
|
||||
explicit SettingsDialog(std::span<const QString> physical_devices, QWidget* parent = nullptr);
|
||||
~SettingsDialog();
|
||||
|
||||
int exec() override;
|
||||
|
|
Loading…
Add table
Reference in a new issue