diff options
author | Zach Hilman <zachhilman@gmail.com> | 2019-10-05 06:10:04 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2019-10-05 06:10:04 +0200 |
commit | 57fe7fdec0a04a41cfca228a20155dcb39971c81 (patch) | |
tree | 7975ee043368dddaf74071304ebd8dffb9035d59 /src | |
parent | common: Add additional SCM revision fields (diff) | |
download | yuzu-57fe7fdec0a04a41cfca228a20155dcb39971c81.tar yuzu-57fe7fdec0a04a41cfca228a20155dcb39971c81.tar.gz yuzu-57fe7fdec0a04a41cfca228a20155dcb39971c81.tar.bz2 yuzu-57fe7fdec0a04a41cfca228a20155dcb39971c81.tar.lz yuzu-57fe7fdec0a04a41cfca228a20155dcb39971c81.tar.xz yuzu-57fe7fdec0a04a41cfca228a20155dcb39971c81.tar.zst yuzu-57fe7fdec0a04a41cfca228a20155dcb39971c81.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/yuzu/main.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 2d82df739..197e704b4 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1889,15 +1889,24 @@ void GMainWindow::OnCaptureScreenshot() { } void GMainWindow::UpdateWindowTitle(const QString& title_name) { - const QString full_name = QString::fromUtf8(Common::g_build_fullname); - const QString branch_name = QString::fromUtf8(Common::g_scm_branch); - const QString description = QString::fromUtf8(Common::g_scm_desc); + const auto full_name = std::string(Common::g_build_fullname); + const auto branch_name = std::string(Common::g_scm_branch); + const auto description = std::string(Common::g_scm_desc); + const auto build_id = std::string(Common::g_build_id); + + const auto date = + QDateTime::currentDateTime().toString(QStringLiteral("yyyy-MM-dd")).toStdString(); if (title_name.isEmpty()) { - setWindowTitle(QStringLiteral("yuzu %1| %2-%3").arg(full_name, branch_name, description)); + const auto fmt = std::string(Common::g_title_bar_format_idle); + setWindowTitle(QString::fromStdString(fmt::format(fmt.empty() ? "yuzu {0}| {1}-{2}" : fmt, + full_name, branch_name, description, + std::string{}, date, build_id))); } else { - setWindowTitle(QStringLiteral("yuzu %1| %4 | %2-%3") - .arg(full_name, branch_name, description, title_name)); + const auto fmt = std::string(Common::g_title_bar_format_idle); + setWindowTitle(QString::fromStdString( + fmt::format(fmt.empty() ? "yuzu {0}| {3} | {1}-{2}" : fmt, full_name, branch_name, + description, std::string{}, date, build_id))); } } |