Qt: Shut coverity up a bit more

This commit is contained in:
Vicki Pfau 2024-01-31 15:41:34 -08:00
parent 3b32da60fa
commit bba2c131a1
5 changed files with 7 additions and 7 deletions

View File

@ -15,7 +15,7 @@ using namespace QGBA;
PlacementControl::PlacementControl(std::shared_ptr<CoreController> controller, QWidget* parent) PlacementControl::PlacementControl(std::shared_ptr<CoreController> controller, QWidget* parent)
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint)
, m_controller(controller) , m_controller(std::move(controller))
{ {
m_ui.setupUi(this); m_ui.setupUi(this);

View File

@ -326,7 +326,7 @@ void ShortcutController::loadProfile(const QString& profile) {
m_profileName = profile; m_profileName = profile;
m_profile = InputProfile::findProfile(profile); m_profile = InputProfile::findProfile(profile);
onSubitems({}, [this](std::shared_ptr<Shortcut> item) { onSubitems({}, [this](std::shared_ptr<Shortcut> item) {
loadGamepadShortcuts(item); loadGamepadShortcuts(std::move(item));
}); });
} }

View File

@ -75,7 +75,7 @@ private:
QSize dims; QSize dims;
Preset() {} Preset() {}
Preset(QString container, QString vcodec, QString acodec, int vbr, int abr, QSize dims = QSize()) Preset(const QString& container, const QString& vcodec, const QString& acodec, int vbr, int abr, QSize dims = QSize())
: container(container) : container(container)
, vcodec(vcodec) , vcodec(vcodec)
, acodec(acodec) , acodec(acodec)

View File

@ -1612,7 +1612,7 @@ void Window::setupMenu(QMenuBar* menubar) {
double nativeGB = double(GBA_ARM7TDMI_FREQUENCY) / double(VIDEO_TOTAL_LENGTH); double nativeGB = double(GBA_ARM7TDMI_FREQUENCY) / double(VIDEO_TOTAL_LENGTH);
fpsTargets[nativeGB] = fpsTargetOption->addValue(tr("Native (59.7275)"), nativeGB, &m_actions, "target"); fpsTargets[nativeGB] = fpsTargetOption->addValue(tr("Native (59.7275)"), nativeGB, &m_actions, "target");
fpsTargetOption->connect([this, fpsTargets](const QVariant& value) { fpsTargetOption->connect([this, fpsTargets = std::move(fpsTargets)](const QVariant& value) {
reloadConfig(); reloadConfig();
for (auto iter = fpsTargets.begin(); iter != fpsTargets.end(); ++iter) { for (auto iter = fpsTargets.begin(); iter != fpsTargets.end(); ++iter) {
bool enableSignals = iter.value()->blockSignals(true); bool enableSignals = iter.value()->blockSignals(true);
@ -1982,7 +1982,7 @@ void Window::updateMRU() {
} }
std::shared_ptr<Action> Window::addGameAction(const QString& visibleName, const QString& name, Action::Function function, const QString& menu, const QKeySequence& shortcut) { std::shared_ptr<Action> Window::addGameAction(const QString& visibleName, const QString& name, Action::Function function, const QString& menu, const QKeySequence& shortcut) {
auto action = m_actions.addAction(visibleName, name, [this, function]() { auto action = m_actions.addAction(visibleName, name, [this, function = std::move(function)]() {
if (m_controller) { if (m_controller) {
function(); function();
} }
@ -2006,7 +2006,7 @@ std::shared_ptr<Action> Window::addGameAction(const QString& visibleName, const
} }
std::shared_ptr<Action> Window::addGameAction(const QString& visibleName, const QString& name, Action::BooleanFunction function, const QString& menu, const QKeySequence& shortcut) { std::shared_ptr<Action> Window::addGameAction(const QString& visibleName, const QString& name, Action::BooleanFunction function, const QString& menu, const QKeySequence& shortcut) {
auto action = m_actions.addBooleanAction(visibleName, name, [this, function](bool value) { auto action = m_actions.addBooleanAction(visibleName, name, [this, function = std::move(function)](bool value) {
if (m_controller) { if (m_controller) {
function(value); function(value);
} }

View File

@ -73,7 +73,7 @@ void ScriptingController::setController(std::shared_ptr<CoreController> controll
if (!controller) { if (!controller) {
return; return;
} }
m_controller = controller; m_controller = std::move(controller);
CoreController::Interrupter interrupter(m_controller); CoreController::Interrupter interrupter(m_controller);
m_controller->thread()->scriptContext = &m_scriptContext; m_controller->thread()->scriptContext = &m_scriptContext;
if (m_controller->hasStarted()) { if (m_controller->hasStarted()) {