Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PeTrack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pedestrian Dynamics Empiricism
PeTrack
Commits
75c8b58b
Commit
75c8b58b
authored
3 years ago
by
d.kilic
Committed by
d.kilic
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Formatting
parent
c5b79148
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/autosave.cpp
+11
-13
11 additions, 13 deletions
src/autosave.cpp
with
11 additions
and
13 deletions
src/autosave.cpp
+
11
−
13
View file @
75c8b58b
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment