diff options
| author | 2020-07-07 13:47:08 -0400 | |
|---|---|---|
| committer | 2020-07-20 23:03:55 -0400 | |
| commit | 599b7c26a9accd9e0e58604422473dd75519daee (patch) | |
| tree | 0b88f83a28a6481cca66bd15198203ffa9629a08 | |
| parent | main: rewrite (save as) screenshot saving (diff) | |
| download | yuzu-599b7c26a9accd9e0e58604422473dd75519daee.tar.gz yuzu-599b7c26a9accd9e0e58604422473dd75519daee.tar.xz yuzu-599b7c26a9accd9e0e58604422473dd75519daee.zip | |
main: Don't use as many string copies
Co-Authored-By: LC <lioncash@users.noreply.github.com>
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/main.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index c6bf5214e..e6a1a80a3 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -2155,12 +2155,14 @@ void GMainWindow::OnCaptureScreenshot() { | |||
| 2155 | OnPauseGame(); | 2155 | OnPauseGame(); |
| 2156 | 2156 | ||
| 2157 | const u64 title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID(); | 2157 | const u64 title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID(); |
| 2158 | const auto screenshot_path = FileUtil::GetUserPath(FileUtil::UserPath::ScreenshotsDir); | 2158 | const auto screenshot_path = |
| 2159 | const auto date = QDateTime::currentDateTime() | 2159 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::ScreenshotsDir)); |
| 2160 | .toString(QStringLiteral("yyyy-MM-dd_hh-mm-ss-zzz")) | 2160 | const auto date = |
| 2161 | .toStdString(); | 2161 | QDateTime::currentDateTime().toString(QStringLiteral("yyyy-MM-dd_hh-mm-ss-zzz")); |
| 2162 | QString filename = QString::fromStdString(screenshot_path + fmt::format("{:016X}", title_id) + | 2162 | QString filename = QStringLiteral("%1%2_%3.png") |
| 2163 | "_" + date + ".png"); | 2163 | .arg(screenshot_path) |
| 2164 | .arg(title_id, 16, 16, QLatin1Char{'0'}) | ||
| 2165 | .arg(date); | ||
| 2164 | 2166 | ||
| 2165 | #ifdef _WIN32 | 2167 | #ifdef _WIN32 |
| 2166 | if (UISettings::values.enable_screenshot_save_as) { | 2168 | if (UISettings::values.enable_screenshot_save_as) { |