From 1cf93a4b29fb278b096f852996cb9e44579c9aa1 Mon Sep 17 00:00:00 2001 From: Clayton Groeneveld Date: Tue, 31 May 2022 05:21:35 -0500 Subject: [PATCH] UI: Fix compiling error on nix platforms On nix platforms, the compile would complain about using non-const values for the function parameters. --- UI/adv-audio-control.cpp | 4 ++-- UI/adv-audio-control.hpp | 2 +- UI/qt-wrappers.cpp | 2 +- UI/qt-wrappers.hpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/UI/adv-audio-control.cpp b/UI/adv-audio-control.cpp index d36e652f1..45523db10 100644 --- a/UI/adv-audio-control.cpp +++ b/UI/adv-audio-control.cpp @@ -355,7 +355,7 @@ void OBSAdvAudioCtrl::OBSSourceRenamed(void *param, calldata_t *calldata) QString newName = QT_UTF8(calldata_string(calldata, "new_name")); QMetaObject::invokeMethod(reinterpret_cast(param), - "SetSourceName", Q_ARG(QString &, newName)); + "SetSourceName", Q_ARG(QString, newName)); } /* ------------------------------------------------------------------------- */ @@ -688,7 +688,7 @@ void OBSAdvAudioCtrl::SetIconVisible(bool visible) visible ? iconLabel->show() : iconLabel->hide(); } -void OBSAdvAudioCtrl::SetSourceName(QString &newName) +void OBSAdvAudioCtrl::SetSourceName(QString newName) { TruncateLabel(nameLabel, newName); } diff --git a/UI/adv-audio-control.hpp b/UI/adv-audio-control.hpp index c1239f720..42b53b3e3 100644 --- a/UI/adv-audio-control.hpp +++ b/UI/adv-audio-control.hpp @@ -85,7 +85,7 @@ public slots: void SourceMonitoringTypeChanged(int type); void SourceMixersChanged(uint32_t mixers); void SourceBalanceChanged(int balance); - void SetSourceName(QString &newNamw); + void SetSourceName(QString newNamw); void volumeChanged(double db); void percentChanged(int percent); diff --git a/UI/qt-wrappers.cpp b/UI/qt-wrappers.cpp index f2f93ed3b..6e1f07e85 100644 --- a/UI/qt-wrappers.cpp +++ b/UI/qt-wrappers.cpp @@ -385,7 +385,7 @@ static void SetLabelText(QLabel *label, const QString &newText) label->setText(newText); } -void TruncateLabel(QLabel *label, QString &newText, int length) +void TruncateLabel(QLabel *label, QString newText, int length) { if (newText.length() < length) { label->setToolTip(QString()); diff --git a/UI/qt-wrappers.hpp b/UI/qt-wrappers.hpp index 0f4dfa7ff..b01242334 100644 --- a/UI/qt-wrappers.hpp +++ b/UI/qt-wrappers.hpp @@ -120,5 +120,5 @@ QString OpenFile(QWidget *parent, QString title, QString path, QStringList OpenFiles(QWidget *parent, QString title, QString path, QString extensions); -void TruncateLabel(QLabel *label, QString &newText, +void TruncateLabel(QLabel *label, QString newText, int length = MAX_LABEL_LENGTH);