Show dialogs after OBS_FRONTEND_EVENT_FINISHED_LOADING is fired
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled

This commit is contained in:
WarmUpTill
2026-02-23 17:18:15 +01:00
committed by WarmUpTill
parent 4966802f14
commit ff98ec36d6
5 changed files with 57 additions and 49 deletions

View File

@@ -54,31 +54,18 @@ void AskForBackup(obs_data_t *settings)
// or crashing.
// Therefore, we ask the user whether they want to back up the settings
// asynchronously.
//
// On macOS, an additional QTimer::singleShot wrapper is required for
// this to work correctly.
auto json = obs_data_get_json(settings);
static QString jsonQString = json ? json : "";
static const auto askForBackupWrapper = [](void *) {
#ifdef __APPLE__
QTimer::singleShot(0,
static_cast<QMainWindow *>(
obs_frontend_get_main_window()),
[]() {
#endif
showBackupDialogs(jsonQString);
#ifdef __APPLE__
});
#endif
showBackupDialogs(jsonQString);
};
std::thread t([]() {
AddFinishedLoadingStep([]() {
obs_queue_task(OBS_TASK_UI, askForBackupWrapper, nullptr,
false);
});
t.detach();
}
void BackupSettingsOfCurrentVersion()