Use more std::span arguments
This commit is contained in:
1 parent
c05b231015
commit
f6a67aa6e7
79 files changed
+164
-146
No files matched your search
@@ -45,7 +45,7 @@ void ConfigChoiceU32::OnConfigChanged()
|
||||
setCurrentIndex(ReadValue(m_setting));
|
||||
}
|
||||
|
||||
ConfigStringChoice::ConfigStringChoice(const std::vector<std::string>& options,
|
||||
ConfigStringChoice::ConfigStringChoice(std::span<const std::string> options,
|
||||
const Config::Info<std::string>& setting,
|
||||
Config::Layer* layer)
|
||||
: ConfigControl(setting.GetLocation(), layer), m_setting(setting), m_text_is_data(true)
|
||||
@@ -57,7 +57,7 @@ ConfigStringChoice::ConfigStringChoice(const std::vector<std::string>& options,
|
||||
connect(this, &QComboBox::currentIndexChanged, this, &ConfigStringChoice::Update);
|
||||
}
|
||||
|
||||
ConfigStringChoice::ConfigStringChoice(const std::vector<std::pair<QString, QString>>& options,
|
||||
ConfigStringChoice::ConfigStringChoice(std::span<const std::pair<QString, QString>> options,
|
||||
const Config::Info<std::string>& setting,
|
||||
Config::Layer* layer)
|
||||
: ConfigControl(setting.GetLocation(), layer), m_setting(setting), m_text_is_data(false)
|
||||
|
||||
@@ -85,9 +85,9 @@ class ConfigStringChoice final : public ConfigControl<ToolTipComboBox>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ConfigStringChoice(const std::vector<std::string>& options,
|
||||
const Config::Info<std::string>& setting, Config::Layer* layer = nullptr);
|
||||
ConfigStringChoice(const std::vector<std::pair<QString, QString>>& options,
|
||||
ConfigStringChoice(std::span<const std::string> options, const Config::Info<std::string>& setting,
|
||||
Config::Layer* layer = nullptr);
|
||||
ConfigStringChoice(std::span<const std::pair<QString, QString>> options,
|
||||
const Config::Info<std::string>& setting, Config::Layer* layer = nullptr);
|
||||
void Load();
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#include <future>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QHBoxLayout>
|
||||
@@ -129,7 +129,7 @@ void VerifyWidget::ConnectWidgets()
|
||||
#endif
|
||||
}
|
||||
|
||||
static void SetHash(QLineEdit* line_edit, const std::vector<u8>& hash)
|
||||
static void SetHash(QLineEdit* line_edit, std::span<const u8> hash)
|
||||
{
|
||||
const QByteArray byte_array = QByteArray::fromRawData(reinterpret_cast<const char*>(hash.data()),
|
||||
static_cast<int>(hash.size()));
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include <QCheckBox>
|
||||
|
||||
@@ -98,7 +98,7 @@ void WiimoteControllersWidget::StartBluetoothAdapterRefresh()
|
||||
}
|
||||
|
||||
void WiimoteControllersWidget::OnBluetoothAdapterRefreshComplete(
|
||||
const std::vector<USBUtils::DeviceInfo>& devices)
|
||||
std::span<const USBUtils::DeviceInfo> devices)
|
||||
{
|
||||
const int configured_vid = Config::Get(Config::MAIN_BLUETOOTH_PASSTHROUGH_VID);
|
||||
const int configured_pid = Config::Get(Config::MAIN_BLUETOOTH_PASSTHROUGH_PID);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <span>
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
@@ -40,7 +41,7 @@ private:
|
||||
void OnBluetoothPassthroughDeviceChanged(int index);
|
||||
void OnBluetoothPassthroughSyncPressed();
|
||||
void OnBluetoothPassthroughResetPressed();
|
||||
void OnBluetoothAdapterRefreshComplete(const std::vector<USBUtils::DeviceInfo>& devices);
|
||||
void OnBluetoothAdapterRefreshComplete(std::span<const USBUtils::DeviceInfo> devices);
|
||||
void OnWiimoteRefreshPressed();
|
||||
void OnWiimoteConfigure(size_t index);
|
||||
void StartBluetoothAdapterRefresh();
|
||||
|
||||
Reference in new issue
Block a user