mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
Fix static initialisation order fiasco issue for Version variables
Fixes a crash that could occur if the static constructor function for the MainSettings.cpp TU happened to run before the variables in Common/Version.cpp are initialised. (This is known as the static initialisation order fiasco.) By using wrapper functions, those variables are now guaranteed to be constructed on first use.
This commit is contained in:
@ -47,12 +47,12 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
|
||||
<a href='https://forums.dolphin-emu.org/'>%SUPPORT%</a>
|
||||
)")
|
||||
.replace(QStringLiteral("%VERSION_STRING%"),
|
||||
QString::fromUtf8(Common::scm_desc_str.c_str()))
|
||||
QString::fromUtf8(Common::GetScmDescStr().c_str()))
|
||||
.replace(QStringLiteral("%BRANCH%"),
|
||||
// i18n: "Branch" means the version control term, not a literal tree branch.
|
||||
tr("Branch: %1").arg(QString::fromUtf8(Common::scm_branch_str.c_str())))
|
||||
tr("Branch: %1").arg(QString::fromUtf8(Common::GetScmBranchStr().c_str())))
|
||||
.replace(QStringLiteral("%REVISION%"),
|
||||
tr("Revision: %1").arg(QString::fromUtf8(Common::scm_rev_git_str.c_str())))
|
||||
tr("Revision: %1").arg(QString::fromUtf8(Common::GetScmRevGitStr().c_str())))
|
||||
.replace(QStringLiteral("%QT_VERSION%"),
|
||||
tr("Using Qt %1").arg(QStringLiteral(QT_VERSION_STR)))
|
||||
.replace(QStringLiteral("%CHECK_FOR_UPDATES%"), tr("Check for updates"))
|
||||
|
@ -206,7 +206,7 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters,
|
||||
const std::string& movie_path)
|
||||
: QMainWindow(nullptr)
|
||||
{
|
||||
setWindowTitle(QString::fromStdString(Common::scm_rev_str));
|
||||
setWindowTitle(QString::fromStdString(Common::GetScmRevStr()));
|
||||
setWindowIcon(Resources::GetAppIcon());
|
||||
setUnifiedTitleAndToolBarOnMac(true);
|
||||
setAcceptDrops(true);
|
||||
@ -1145,7 +1145,7 @@ void MainWindow::HideRenderWidget(bool reinit, bool is_exit)
|
||||
m_rendering_to_main = false;
|
||||
m_stack->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
disconnect(Host::GetInstance(), &Host::RequestTitle, this, &MainWindow::setWindowTitle);
|
||||
setWindowTitle(QString::fromStdString(Common::scm_rev_str));
|
||||
setWindowTitle(QString::fromStdString(Common::GetScmRevStr()));
|
||||
}
|
||||
|
||||
// The following code works around a driver bug that would lead to Dolphin crashing when changing
|
||||
|
@ -158,7 +158,7 @@ void NetPlayBrowser::Refresh()
|
||||
std::map<std::string, std::string> filters;
|
||||
|
||||
if (m_check_hide_incompatible->isChecked())
|
||||
filters["version"] = Common::scm_desc_str;
|
||||
filters["version"] = Common::GetScmDescStr();
|
||||
|
||||
if (!m_edit_name->text().isEmpty())
|
||||
filters["name"] = m_edit_name->text().toStdString();
|
||||
@ -246,7 +246,7 @@ void NetPlayBrowser::UpdateList()
|
||||
auto* player_count = new QTableWidgetItem(QStringLiteral("%1").arg(entry.player_count));
|
||||
auto* version = new QTableWidgetItem(QString::fromStdString(entry.version));
|
||||
|
||||
const bool enabled = Common::scm_desc_str == entry.version;
|
||||
const bool enabled = Common::GetScmDescStr() == entry.version;
|
||||
|
||||
for (const auto& item : {region, name, password, in_game, game_id, player_count, version})
|
||||
item->setFlags(enabled ? Qt::ItemIsEnabled | Qt::ItemIsSelectable : Qt::NoItemFlags);
|
||||
|
@ -55,7 +55,7 @@ void Updater::OnUpdateAvailable(const NewVersionInformation& info)
|
||||
"download. "
|
||||
"You are running %2.<br> Would you like to update?<br><h4>Release Notes:</h4>")
|
||||
.arg(QString::fromStdString(info.new_shortrev))
|
||||
.arg(QString::fromStdString(Common::scm_desc_str)));
|
||||
.arg(QString::fromStdString(Common::GetScmDescStr())));
|
||||
label->setTextFormat(Qt::RichText);
|
||||
|
||||
auto* changelog = new QTextBrowser;
|
||||
|
Reference in New Issue
Block a user