Commit ca33bb7d authored by Martin Koller's avatar Martin Koller
Browse files

saving profile needs to reset the backup cycle

when manually saving a profile, we need to restart the backup
(incremental) cycle since e.g. adding a new dir would otherwise
not save its content on the next run

(cherry picked from commit a1769ab9)
parent 9a5ca69e
Pipeline #167245 passed with stage
in 36 seconds
//**************************************************************************
// Copyright 2006 - 2018 Martin Koller, kollix@aon.at
// Copyright 2006 - 2022 Martin Koller, kollix@aon.at
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
......@@ -213,6 +213,15 @@ void Archiver::setIncrementalBackup(bool inc)
//--------------------------------------------------------------------------------
void Archiver::resetBackupCycle()
{
lastFullBackup = QDateTime();
lastBackup = QDateTime();
setIncrementalBackup(false);
}
//--------------------------------------------------------------------------------
void Archiver::setFilePrefix(const QString &prefix)
{
filePrefix = prefix;
......
//**************************************************************************
// Copyright 2006 - 2017 Martin Koller, kollix@aon.at
// Copyright 2006 - 2022 Martin Koller, kollix@aon.at
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
......@@ -80,6 +80,9 @@ class Archiver : public QObject
const QDateTime &getLastFullBackup() const { return lastFullBackup; }
const QDateTime &getLastBackup() const { return lastBackup; }
// when manually saving a profile, we need to restart the backup (incremental) cycle
void resetBackupCycle();
// print every single file/dir in non-interactive mode
void setVerbose(bool b) { verbose = b; }
......
//**************************************************************************
// Copyright 2006 - 2017 Martin Koller, kollix@aon.at
// Copyright 2006 - 2022 Martin Koller, kollix@aon.at
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
......@@ -272,6 +272,10 @@ void MainWindow::saveProfile(QString fileName)
Archiver::instance->setTarget(QUrl(mainWidget->getTargetLineEdit()->text()));
// when manually saving a profile, we need to restart the backup (incremental) cycle
// since e.g. adding a new dir would otherwise not save its content on the next run
Archiver::instance->resetBackupCycle();
if ( ! Archiver::instance->saveProfile(fileName, includes, excludes, error) )
{
KMessageBox::error(this,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment