Explorar o código

UI: Fix compiling error on nix platforms

On nix platforms, the compile would complain about
using non-const values for the function parameters.
Clayton Groeneveld %!s(int64=3) %!d(string=hai) anos
pai
achega
1cf93a4b29
Modificáronse 4 ficheiros con 5 adicións e 5 borrados
  1. 2 2
      UI/adv-audio-control.cpp
  2. 1 1
      UI/adv-audio-control.hpp
  3. 1 1
      UI/qt-wrappers.cpp
  4. 1 1
      UI/qt-wrappers.hpp

+ 2 - 2
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<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);
 }

+ 1 - 1
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);

+ 1 - 1
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());

+ 1 - 1
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);