From 2559f9a7cfe5b8477656a760c6b170200efd9f3d Mon Sep 17 00:00:00 2001 From: mbs Date: Thu, 21 Dec 2023 12:15:40 +0000 Subject: [PATCH] ensure the old backup folder gets removed --- src/SHAPERGUI/SHAPERGUI.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index 8d97ebf82..cca76f434 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -932,11 +932,13 @@ void SHAPERGUI::onBackupDone(QString aFolder, bool aResult) // * _valid.log - the output of the "check_validity.py" script QDir dir(myLastBackupFolder); QStringList files = dir.entryList(QDir::Files|QDir::Dirs|QDir::NoDotAndDotDot); - if (!files.isEmpty() && files.length() <= 3) { + if (!files.isEmpty() && files.length() <= 5) { QString baseName = files.constFirst(); baseName = baseName.left(baseName.lastIndexOf('.')); - if (!baseName.isEmpty() && files.filter(baseName).length() == files.length()) + if (!baseName.isEmpty() && files.filter(baseName).length() == files.length()) { + MSGEL("........removing old backup folder"); dir.removeRecursively(); + } } } myLastBackupFolder = aFolder; @@ -1414,7 +1416,9 @@ void SHAPERGUI::preferencesChanged(const QString& theSection, const QString& the if (useBackup) { int backupInterval = aResMgr->integerValue( ModuleBase_Preferences::GENERAL_SECTION, "backup_interval", 1 ); if ( backupInterval > 0 ){ - backupInterval = 1; +#ifdef DBG_BACKUP_INTERVAL + backupInterval = DBG_BACKUP_INTERVAL; // MBS: use shorter interval for debugging +#endif MSGEL("....starting BackupTimer: interval=" << backupInterval << " min"); myBackupTimer->start( backupInterval*60000 ); } -- 2.39.2