From 0e3dce286ef8a520f325021189cf8182bfff72a0 Mon Sep 17 00:00:00 2001 From: Ajinkya Dahale Date: Tue, 13 Jun 2023 21:50:28 +0530 Subject: [PATCH] [Core] Warn user if using deprecated backup extension --- src/Gui/Application.cpp | 11 +++++++++++ src/Gui/Application.h | 2 ++ src/Gui/MainWindow.cpp | 3 +++ 3 files changed, 16 insertions(+) diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index 6d7d414f42..07848d0a8a 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -2518,6 +2518,17 @@ void Application::setStyleSheet(const QString& qssFile, bool tiledBackground) } } +void Application::checkForDeprecatedSettings() +{ + // From 0.21, `FCBak` will be the intended default backup format + // TODO: Check for `FCStd#` and warn user. + bool useFCBakExtension = App::GetApplication().GetParameterGroupByPath + ("User parameter:BaseApp/Preferences/Document")->GetBool("UseFCBakExtension", true); + if (!useFCBakExtension) { + Base::Console().Warning("`.FCStd#` backup format is deprecated from 0.21 and may be removed in future versions. Please use `.FCBak` instead.\n"); + } +} + void Application::checkForPreviousCrashes() { try { diff --git a/src/Gui/Application.h b/src/Gui/Application.h index 4ce5701f97..bee284c459 100644 --- a/src/Gui/Application.h +++ b/src/Gui/Application.h @@ -192,6 +192,8 @@ public: /// true when the application shutting down bool isClosing(); + + void checkForDeprecatedSettings(); void checkForPreviousCrashes(); /** @name workbench handling */ diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index df19d2001f..270a0750a1 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -1448,6 +1448,9 @@ void MainWindow::delayedStartup() return; } + // TODO: Check for deprecated settings + Application::Instance->checkForDeprecatedSettings(); + // Create new document? ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("Document"); if (hGrp->GetBool("CreateNewDoc", false)) {