UI: Fix compiling error on nix platforms
On nix platforms, the compile would complain about using non-const values for the function parameters.master
parent
22dbf316df
commit
1cf93a4b29
|
@ -355,7 +355,7 @@ void OBSAdvAudioCtrl::OBSSourceRenamed(void *param, calldata_t *calldata)
|
||||||
QString newName = QT_UTF8(calldata_string(calldata, "new_name"));
|
QString newName = QT_UTF8(calldata_string(calldata, "new_name"));
|
||||||
|
|
||||||
QMetaObject::invokeMethod(reinterpret_cast<OBSAdvAudioCtrl *>(param),
|
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();
|
visible ? iconLabel->show() : iconLabel->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBSAdvAudioCtrl::SetSourceName(QString &newName)
|
void OBSAdvAudioCtrl::SetSourceName(QString newName)
|
||||||
{
|
{
|
||||||
TruncateLabel(nameLabel, newName);
|
TruncateLabel(nameLabel, newName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ public slots:
|
||||||
void SourceMonitoringTypeChanged(int type);
|
void SourceMonitoringTypeChanged(int type);
|
||||||
void SourceMixersChanged(uint32_t mixers);
|
void SourceMixersChanged(uint32_t mixers);
|
||||||
void SourceBalanceChanged(int balance);
|
void SourceBalanceChanged(int balance);
|
||||||
void SetSourceName(QString &newNamw);
|
void SetSourceName(QString newNamw);
|
||||||
|
|
||||||
void volumeChanged(double db);
|
void volumeChanged(double db);
|
||||||
void percentChanged(int percent);
|
void percentChanged(int percent);
|
||||||
|
|
|
@ -385,7 +385,7 @@ static void SetLabelText(QLabel *label, const QString &newText)
|
||||||
label->setText(newText);
|
label->setText(newText);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TruncateLabel(QLabel *label, QString &newText, int length)
|
void TruncateLabel(QLabel *label, QString newText, int length)
|
||||||
{
|
{
|
||||||
if (newText.length() < length) {
|
if (newText.length() < length) {
|
||||||
label->setToolTip(QString());
|
label->setToolTip(QString());
|
||||||
|
|
|
@ -120,5 +120,5 @@ QString OpenFile(QWidget *parent, QString title, QString path,
|
||||||
QStringList OpenFiles(QWidget *parent, QString title, QString path,
|
QStringList OpenFiles(QWidget *parent, QString title, QString path,
|
||||||
QString extensions);
|
QString extensions);
|
||||||
|
|
||||||
void TruncateLabel(QLabel *label, QString &newText,
|
void TruncateLabel(QLabel *label, QString newText,
|
||||||
int length = MAX_LABEL_LENGTH);
|
int length = MAX_LABEL_LENGTH);
|
||||||
|
|
Loading…
Reference in New Issue