Skip to content
Snippets Groups Projects
Commit 915c2a34 authored by d.kilic's avatar d.kilic Committed by d.kilic
Browse files

License headers and comments

parent 75c8b58b
No related branches found
No related tags found
1 merge request!154Resolve "Create `AutoSave` class and mechanism"
/*
* PeTrack - Software for tracking pedestrians movement in videos
* Copyright (C) 2010-2021 Forschungszentrum Jülich GmbH,
* Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand,
* Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef AUTOSAVE_H #ifndef AUTOSAVE_H
#define AUTOSAVE_H #define AUTOSAVE_H
......
/*
* PeTrack - Software for tracking pedestrians movement in videos
* Copyright (C) 2010-2021 Forschungszentrum Jülich GmbH,
* Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand,
* Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "autosave.h" #include "autosave.h"
#include "petrack.h" #include "petrack.h"
...@@ -62,8 +82,6 @@ void Autosave::deleteAutosave() ...@@ -62,8 +82,6 @@ void Autosave::deleteAutosave()
*/ */
void Autosave::loadAutosave() void Autosave::loadAutosave()
{ {
// TODO: Rename autosave to name from save and then load it?!?! Needs to have a different name than autosave, or
// does it?
auto autosaveFiles = getAutosave(); auto autosaveFiles = getAutosave();
if(autosaveFiles.empty()) if(autosaveFiles.empty())
{ {
...@@ -156,6 +174,7 @@ void Autosave::savePet() ...@@ -156,6 +174,7 @@ void Autosave::savePet()
mPetrack.saveProject(autosaveName); mPetrack.saveProject(autosaveName);
mPetrack.setProFileName(proFileName); mPetrack.setProFileName(proFileName);
// first save to temp file, so crash during saving doesn't corrupt old autosave
QString finalAutosaveName = buildAutosaveName(projectName, ".pet"); QString finalAutosaveName = buildAutosaveName(projectName, ".pet");
QFile tempAutosave{autosaveName}; QFile tempAutosave{autosaveName};
QFile autosave{finalAutosaveName}; QFile autosave{finalAutosaveName};
...@@ -188,6 +207,7 @@ void Autosave::saveTrc() ...@@ -188,6 +207,7 @@ void Autosave::saveTrc()
mPetrack.exportTracker(autosaveName); mPetrack.exportTracker(autosaveName);
mPetrack.setTrackFileName(trackFileName); mPetrack.setTrackFileName(trackFileName);
// first save to temp file, so crash during saving doesn't corrupt old autosave
QString finalAutosaveName = buildAutosaveName(projectName, ".trc"); QString finalAutosaveName = buildAutosaveName(projectName, ".trc");
QFile tempAutosave{autosaveName}; QFile tempAutosave{autosaveName};
QFile autosave{finalAutosaveName}; QFile autosave{finalAutosaveName};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment