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

Formatting

parent c5b79148
No related branches found
No related tags found
Loading
...@@ -4,24 +4,22 @@ ...@@ -4,24 +4,22 @@
#include <QTimer> #include <QTimer>
// TODO Doxygen komemntare
Autosave::Autosave(Petrack &petrack) : mPetrack(petrack) Autosave::Autosave(Petrack &petrack) : mPetrack(petrack)
{ {
mTimer = new QTimer{this}; mTimer = new QTimer{this};
connect(mTimer, &QTimer::timeout, this, &Autosave::savePet); connect(mTimer, &QTimer::timeout, this, &Autosave::savePet);
} }
Autosave::~Autosave() Autosave::~Autosave() = default;
{ //{
// NOTE: Currently this would also delete on Keyboard Interrupt (Ctrl + C) // NOTE: Currently this would also delete on Keyboard Interrupt (Ctrl + C)
// Replaced by Method call in closeEvent in Petrack to circumvent this // Replaced by Method call in closeEvent in Petrack to circumvent this
// if Project-Object from Issue 88 gets implemented, // if Project-Object from Issue 88 gets implemented,
// Autosave should be a Member of the project, not Petrack // Autosave should be a Member of the project, not Petrack
// then the destructor could maybe be used to delete the autosave // then the destructor could maybe be used to delete the autosave
// deleteAutosave(); // deleteAutosave();
} //}
void Autosave::trackPersonModified() void Autosave::trackPersonModified()
{ {
...@@ -146,7 +144,7 @@ QString Autosave::buildAutosaveName(const QString &projectFileName, const QStrin ...@@ -146,7 +144,7 @@ QString Autosave::buildAutosaveName(const QString &projectFileName, const QStrin
*/ */
void Autosave::savePet() void Autosave::savePet()
{ {
auto projectName = mPetrack.getProFileName(); auto projectName = mPetrack.getProFileName();
// only save if there is a project name; Means there needs to be an .pet file already for autosave to work. With our // only save if there is a project name; Means there needs to be an .pet file already for autosave to work. With our
// workflow usually the case // workflow usually the case
if(projectName.isEmpty() || QFileInfo(projectName).isDir()) if(projectName.isEmpty() || QFileInfo(projectName).isDir())
...@@ -184,7 +182,7 @@ void Autosave::savePet() ...@@ -184,7 +182,7 @@ void Autosave::savePet()
*/ */
void Autosave::saveTrc() void Autosave::saveTrc()
{ {
auto projectName = mPetrack.getProFileName(); auto projectName = mPetrack.getProFileName();
QString autosaveName = buildAutosaveName(projectName, "_running.trc"); QString autosaveName = buildAutosaveName(projectName, "_running.trc");
auto trackFileName = mPetrack.getTrackFileName(); auto trackFileName = mPetrack.getTrackFileName();
mPetrack.exportTracker(autosaveName); mPetrack.exportTracker(autosaveName);
......
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