Fix profile persistence race during asynchronous mod profile switching

Signed-off-by: Vivek Kushwaha <notvivekkushwaha@gmail.com>
This commit is contained in:
Vivek Kushwaha 2026-06-18 18:35:28 +05:30
parent abcfc06872
commit f9e8dbfcc0

View file

@ -286,6 +286,10 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, ModFolderModel* model, QWidget*
<< "[SAVE_TRIGGER]\n"
<< "source = updateFinished\n"
<< "currentProfile = " << m_currentProfile;
if (m_profileLoading) {
m_profileLoading = false;
return;
}
saveCurrentProfileState();
});
connect(m_model, &QAbstractItemModel::dataChanged, this, [this]() {
@ -837,10 +841,9 @@ void ModFolderPage::onProfileTabChanged(int index) {
m_currentProfile = QString();
setActiveProfileForModel(m_model, QStringLiteral("None"));
m_profileTabBar->setProperty("currentProfileName", QString());
m_profileLoading = false;
}
m_profileLoading = false;
qDebug() << "[INSTRUMENTATION]" << ++g_logSequence << "onProfileTabChanged() END"
<< "index:" << index
<< "thread:" << QThread::currentThreadId()