mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Fix profile persistence race during asynchronous mod profile switching
Signed-off-by: Vivek Kushwaha <notvivekkushwaha@gmail.com>
This commit is contained in:
parent
abcfc06872
commit
f9e8dbfcc0
1 changed files with 5 additions and 2 deletions
|
|
@ -286,6 +286,10 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, ModFolderModel* model, QWidget*
|
||||||
<< "[SAVE_TRIGGER]\n"
|
<< "[SAVE_TRIGGER]\n"
|
||||||
<< "source = updateFinished\n"
|
<< "source = updateFinished\n"
|
||||||
<< "currentProfile = " << m_currentProfile;
|
<< "currentProfile = " << m_currentProfile;
|
||||||
|
if (m_profileLoading) {
|
||||||
|
m_profileLoading = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
saveCurrentProfileState();
|
saveCurrentProfileState();
|
||||||
});
|
});
|
||||||
connect(m_model, &QAbstractItemModel::dataChanged, this, [this]() {
|
connect(m_model, &QAbstractItemModel::dataChanged, this, [this]() {
|
||||||
|
|
@ -837,10 +841,9 @@ void ModFolderPage::onProfileTabChanged(int index) {
|
||||||
m_currentProfile = QString();
|
m_currentProfile = QString();
|
||||||
setActiveProfileForModel(m_model, QStringLiteral("None"));
|
setActiveProfileForModel(m_model, QStringLiteral("None"));
|
||||||
m_profileTabBar->setProperty("currentProfileName", QString());
|
m_profileTabBar->setProperty("currentProfileName", QString());
|
||||||
|
m_profileLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_profileLoading = false;
|
|
||||||
|
|
||||||
qDebug() << "[INSTRUMENTATION]" << ++g_logSequence << "onProfileTabChanged() END"
|
qDebug() << "[INSTRUMENTATION]" << ++g_logSequence << "onProfileTabChanged() END"
|
||||||
<< "index:" << index
|
<< "index:" << index
|
||||||
<< "thread:" << QThread::currentThreadId()
|
<< "thread:" << QThread::currentThreadId()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue