mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-11 16:59:43 -04:00
frontend,shared: Replace and disable QByteArray to char * casts
This commit is contained in:
@@ -802,7 +802,7 @@ bool LoadBranchesFile(vector<UpdateBranch> &out)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
branchesText = branchesFile.readAll();
|
||||
branchesText = branchesFile.readAll().toStdString();
|
||||
if (branchesText.empty()) {
|
||||
error = "File empty.";
|
||||
goto fail;
|
||||
|
||||
@@ -1178,8 +1178,8 @@ void OBSBasicSettings::LoadLanguageList()
|
||||
#if defined(_WIN32) || defined(ENABLE_SPARKLE_UPDATER)
|
||||
void TranslateBranchInfo(const QString &name, QString &displayName, QString &description)
|
||||
{
|
||||
QString translatedName = QTStr("Basic.Settings.General.ChannelName." + name.toUtf8());
|
||||
QString translatedDesc = QTStr("Basic.Settings.General.ChannelDescription." + name.toUtf8());
|
||||
QString translatedName = QTStr(QT_TO_UTF8(("Basic.Settings.General.ChannelName." + name)));
|
||||
QString translatedDesc = QTStr(QT_TO_UTF8(("Basic.Settings.General.ChannelDescription." + name)));
|
||||
|
||||
if (!translatedName.startsWith("Basic.Settings."))
|
||||
displayName = translatedName;
|
||||
@@ -4536,7 +4536,7 @@ void OBSBasicSettings::AdvOutRecCheckCodecs()
|
||||
QString recFormatName = ui->advOutRecFormat->currentText();
|
||||
|
||||
/* Set tooltip if available */
|
||||
QString tooltip = QTStr("Basic.Settings.Output.Format.TT." + recFormat.toUtf8());
|
||||
QString tooltip = QTStr(QT_TO_UTF8(("Basic.Settings.Output.Format.TT." + recFormat)));
|
||||
|
||||
if (!tooltip.startsWith("Basic.Settings.Output"))
|
||||
ui->advOutRecFormat->setToolTip(tooltip);
|
||||
@@ -5199,7 +5199,7 @@ void OBSBasicSettings::SimpleRecordingEncoderChanged()
|
||||
|
||||
QString format = ui->simpleOutRecFormat->currentData().toString();
|
||||
/* Set tooltip if available */
|
||||
QString tooltip = QTStr("Basic.Settings.Output.Format.TT." + format.toUtf8());
|
||||
QString tooltip = QTStr(QT_TO_UTF8(("Basic.Settings.Output.Format.TT." + format)));
|
||||
|
||||
if (!tooltip.startsWith("Basic.Settings.Output"))
|
||||
ui->simpleOutRecFormat->setToolTip(tooltip);
|
||||
|
||||
@@ -81,7 +81,7 @@ GoLiveApi::Config DownloadGoLiveConfig(QWidget *parent, QString url, const GoLiv
|
||||
|
||||
std::vector<std::string> headers;
|
||||
headers.push_back("Content-Type: application/json");
|
||||
bool encodeConfigDownloadedOk = GetRemoteFile(url.toLocal8Bit(), encodeConfigText,
|
||||
bool encodeConfigDownloadedOk = GetRemoteFile(url.toUtf8().constData(), encodeConfigText,
|
||||
libraryError, // out params
|
||||
nullptr,
|
||||
nullptr, // out params (response code and content type)
|
||||
|
||||
@@ -51,7 +51,8 @@ bool IsUserSignedIntoYT()
|
||||
|
||||
bool YoutubeApiWrappers::GetTranslatedError(QString &error_message)
|
||||
{
|
||||
QString translated = QTStr("YouTube.Errors." + lastErrorReason.toUtf8());
|
||||
const QString errorKey = "YouTube.Errors." + lastErrorReason.toUtf8();
|
||||
const QString translated = QTStr(QT_TO_UTF8(errorKey));
|
||||
// No translation found
|
||||
if (translated.startsWith("YouTube.Errors."))
|
||||
return false;
|
||||
|
||||
@@ -43,7 +43,7 @@ void OBSBasic::copyActionsDynamicProperties()
|
||||
continue;
|
||||
|
||||
for (QByteArray &y : x->dynamicPropertyNames()) {
|
||||
temp->setProperty(y, x->property(y));
|
||||
temp->setProperty(y.constData(), x->property(y.constData()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ void OBSBasic::copyActionsDynamicProperties()
|
||||
continue;
|
||||
|
||||
for (QByteArray &y : x->dynamicPropertyNames()) {
|
||||
temp->setProperty(y, x->property(y));
|
||||
temp->setProperty(y.constData(), x->property(y.constData()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ void OBSBasic::copyActionsDynamicProperties()
|
||||
continue;
|
||||
|
||||
for (QByteArray &y : x->dynamicPropertyNames()) {
|
||||
temp->setProperty(y, x->property(y));
|
||||
temp->setProperty(y.constData(), x->property(y.constData()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -733,7 +733,7 @@ void OBSPropertiesView::AddEditableList(obs_property_t *prop, QFormLayout *layou
|
||||
/* for backwards compatibility */
|
||||
if (uuid.isEmpty()) {
|
||||
uuid = QUuid::createUuid().toString(QUuid::WithoutBraces);
|
||||
obs_data_set_string(item, "uuid", uuid.toUtf8());
|
||||
obs_data_set_string(item, "uuid", QT_TO_UTF8(uuid));
|
||||
}
|
||||
list_item->setData(Qt::UserRole, uuid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user