UI: Remove unnecessary variables type conversions

Detected by PVS Studio.
This commit is contained in:
Richard Stanway 2023-04-02 22:34:34 +02:00 committed by Rodney
parent 43f12d1fbd
commit 820fba2d7f
3 changed files with 6 additions and 15 deletions

View file

@ -1212,13 +1212,12 @@ std::string OBSApp::GetTheme(std::string name, std::string path)
std::string OBSApp::SetParentTheme(std::string name)
{
string path = GetTheme(name.c_str(), "");
string path = GetTheme(name, "");
if (path.empty())
return path;
setPalette(defaultPalette);
QString mpath = QString("file:///") + path.c_str();
ParseExtraThemeData(path.c_str());
return path;
}

View file

@ -1300,14 +1300,10 @@ bool SimpleOutput::ConfigureRecording(bool updateReplayBuffer)
bool is_fragmented = strncmp(format, "fragmented", 10) == 0;
string f;
string strPath;
OBSDataAutoRelease settings = obs_data_create();
if (updateReplayBuffer) {
f = GetFormatString(filenameFormat, rbPrefix, rbSuffix);
strPath = GetOutputFilename(path, ffmpegOutput ? "avi" : format,
noSpace, overwriteIfExists,
f.c_str());
obs_data_set_string(settings, "directory", path);
obs_data_set_string(settings, "format", f.c_str());
obs_data_set_string(settings, "extension", format);
@ -1317,10 +1313,9 @@ bool SimpleOutput::ConfigureRecording(bool updateReplayBuffer)
usingRecordingPreset ? rbSize : 0);
} else {
f = GetFormatString(filenameFormat, nullptr, nullptr);
strPath = GetRecordingFilename(path,
ffmpegOutput ? "avi" : format,
noSpace, overwriteIfExists,
f.c_str(), ffmpegOutput);
string strPath = GetRecordingFilename(
path, ffmpegOutput ? "avi" : format, noSpace,
overwriteIfExists, f.c_str(), ffmpegOutput);
obs_data_set_string(settings, ffmpegOutput ? "url" : "path",
strPath.c_str());
if (ffmpegOutput)
@ -2309,8 +2304,6 @@ bool AdvancedOutput::StartReplayBuffer()
rbSize = config_get_int(main->Config(), "AdvOut", "RecRBSize");
string f = GetFormatString(filenameFormat, rbPrefix, rbSuffix);
string strPath = GetOutputFilename(
path, recFormat, noSpace, overwriteIfExists, f.c_str());
OBSDataAutoRelease settings = obs_data_create();

View file

@ -6371,9 +6371,8 @@ void OBSBasic::UploadLog(const char *subdir, const char *file, const bool crash)
logUploadThread->wait();
}
RemoteTextThread *thread =
new RemoteTextThread("https://obsproject.com/logs/upload",
"text/plain", ss.str().c_str());
RemoteTextThread *thread = new RemoteTextThread(
"https://obsproject.com/logs/upload", "text/plain", ss.str());
logUploadThread.reset(thread);
if (crash) {