UI: Fix compiling error on nix platforms

On nix platforms, the compile would complain about
using non-const values for the function parameters.
master
Clayton Groeneveld 2022-05-31 05:21:35 -05:00 committed by Matt Gajownik
parent 22dbf316df
commit 1cf93a4b29
4 changed files with 5 additions and 5 deletions

View File

@ -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<OBSAdvAudioCtrl *>(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);
}

View File

@ -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);

View File

@ -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());

View File

@ -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);