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
bb5ad4c1
Commit
bb5ad4c1
authored
May 24, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added --clear-settings command line option
Clears the persisted settings for the QGC
parent
6b2dc5d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
QGCCore.cc
src/QGCCore.cc
+19
-5
No files found.
src/QGCCore.cc
View file @
bb5ad4c1
...
...
@@ -47,6 +47,7 @@ This file is part of the QGROUNDCONTROL project
#include "MainWindow.h"
#include "QGCWelcomeMainWindow.h"
#include "GAudioOutput.h"
#include "CmdLineOptParser.h"
#ifdef QGC_RTLAB_ENABLED
#include "OpalLink.h"
...
...
@@ -82,12 +83,25 @@ QGCCore::QGCCore(bool firstStart, int &argc, char* argv[]) : QApplication(argc,
// Set settings format
QSettings
::
setDefaultFormat
(
QSettings
::
IniFormat
);
// Check application settings
// clear them if they mismatch
// QGC then falls back to default
// Parse command line options
bool
fClearSettingsOptions
=
false
;
// Clear stored settings
CmdLineOpt_t
rgCmdLineOptions
[]
=
{
{
"--clear-settings"
,
&
fClearSettingsOptions
},
// Add additional command line option flags here
};
ParseCmdLineOptions
(
argc
,
argv
,
rgCmdLineOptions
,
sizeof
(
rgCmdLineOptions
)
/
sizeof
(
rgCmdLineOptions
[
0
]),
false
);
QSettings
settings
;
if
(
fClearSettingsOptions
)
{
// User requested settings to be cleared on command line
settings
.
clear
();
}
// Show user an upgrade message if QGC got upgraded (see code below, after splash screen)
bool
upgraded
=
false
;
enum
MainWindow
::
CUSTOM_MODE
mode
=
MainWindow
::
CUSTOM_MODE_NONE
;
...
...
@@ -98,7 +112,7 @@ QGCCore::QGCCore(bool firstStart, int &argc, char* argv[]) : QApplication(argc,
if
(
qgcVersion
!=
QGC_APPLICATION_VERSION
)
{
lastApplicationVersion
=
qgcVersion
;
settings
.
clear
();
settings
.
clear
();
// Clear settings from different version
// Write current application version
settings
.
setValue
(
"QGC_APPLICATION_VERSION"
,
QGC_APPLICATION_VERSION
);
upgraded
=
true
;
...
...
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