From 820fba2d7fd04144d42971558424b71431b0aee1 Mon Sep 17 00:00:00 2001 From: Richard Stanway Date: Sun, 2 Apr 2023 22:34:34 +0200 Subject: [PATCH] UI: Remove unnecessary variables type conversions Detected by PVS Studio. --- UI/obs-app.cpp | 3 +-- UI/window-basic-main-outputs.cpp | 13 +++---------- UI/window-basic-main.cpp | 5 ++--- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index a67f6bfb4..e0b9d114a 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -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; } diff --git a/UI/window-basic-main-outputs.cpp b/UI/window-basic-main-outputs.cpp index 5151bf77a..04a08a8b4 100644 --- a/UI/window-basic-main-outputs.cpp +++ b/UI/window-basic-main-outputs.cpp @@ -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(); diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index b3470b39a..6d9375eb4 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -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) {