Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
b1a9d302
Commit
b1a9d302
authored
Feb 19, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1242 from basil-huber/Fix1241
Repaired overwriting current files for flight data log (fix #1241)
parents
64e8919c
9134bd06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
9 deletions
+23
-9
QGCApplication.cc
src/QGCApplication.cc
+23
-9
No files found.
src/QGCApplication.cc
View file @
b1a9d302
...
...
@@ -490,15 +490,29 @@ void QGCApplication::criticalMessageBoxOnMainThread(const QString& title, const
void
QGCApplication
::
saveTempFlightDataLogOnMainThread
(
QString
tempLogfile
)
{
QString
saveFilename
=
QGCFileDialog
::
getSaveFileName
(
MainWindow
::
instance
(),
tr
(
"Save Flight Data Log"
),
qgcApp
()
->
mavlinkLogFilesLocation
(),
tr
(
"Flight Data Log Files (*.mavlink)"
),
"mavlink"
);
if
(
!
saveFilename
.
isEmpty
())
{
QFile
::
copy
(
tempLogfile
,
saveFilename
);
}
bool
saveError
;
do
{
saveError
=
false
;
QString
saveFilename
=
QGCFileDialog
::
getSaveFileName
(
MainWindow
::
instance
(),
tr
(
"Save Flight Data Log"
),
qgcApp
()
->
mavlinkLogFilesLocation
(),
tr
(
"Flight Data Log Files (*.mavlink)"
),
"mavlink"
);
if
(
!
saveFilename
.
isEmpty
())
{
// if file exsits already, try to remove it first to overwrite it
if
(
QFile
::
exists
(
saveFilename
)
&&
!
QFile
::
remove
(
saveFilename
)){
// if the file cannot be removed, prompt user and ask new path
saveError
=
true
;
QGCMessageBox
::
warning
(
"File Error"
,
"Could not overwrite existing file.
\n
Please provide a different file name to save to."
);
}
else
if
(
!
QFile
::
copy
(
tempLogfile
,
saveFilename
))
{
// if file could not be copied, prompt user and ask new path
saveError
=
true
;
QGCMessageBox
::
warning
(
"File Error"
,
"Could not create file.
\n
Please provide a different file name to save to."
);
}
}
}
while
(
saveError
);
// if the file could not be overwritten, ask for new file
QFile
::
remove
(
tempLogfile
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment