Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
d535a632
Commit
d535a632
authored
Jun 18, 2016
by
Don Gagne
Browse files
Fix settings prompt on clean install
parent
fdb13156
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/QGCApplication.cc
View file @
d535a632
...
...
@@ -181,6 +181,7 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
,
_styleIsDark
(
true
)
#endif
,
_fakeMobile
(
false
)
,
_settingsUpgraded
(
false
)
#ifdef QT_DEBUG
,
_testHighDPI
(
false
)
#endif
...
...
@@ -307,6 +308,19 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
QDir
paramDir
(
ParameterLoader
::
parameterCacheDir
());
paramDir
.
removeRecursively
();
paramDir
.
mkpath
(
paramDir
.
absolutePath
());
}
else
{
// Determine if upgrade message for settings version bump is required. Check must happen before toolbox is started since
// that will write some settings.
if
(
settings
.
contains
(
_settingsVersionKey
))
{
if
(
settings
.
value
(
_settingsVersionKey
).
toInt
()
!=
QGC_SETTINGS_VERSION
)
{
_settingsUpgraded
=
true
;
}
}
else
if
(
settings
.
allKeys
().
count
())
{
// Settings version key is missing and there are settings. This is an upgrade scenario.
_settingsUpgraded
=
true
;
}
else
{
settings
.
setValue
(
_settingsVersionKey
,
QGC_SETTINGS_VERSION
);
}
}
// Set up our logging filters
...
...
@@ -429,20 +443,7 @@ bool QGCApplication::_initForNormalAppBoot(void)
// Load known link configurations
toolbox
()
->
linkManager
()
->
loadLinkConfigurationList
();
// Show user an upgrade message if the settings version has been bumped up
bool
settingsUpgraded
=
false
;
if
(
settings
.
contains
(
_settingsVersionKey
))
{
if
(
settings
.
value
(
_settingsVersionKey
).
toInt
()
!=
QGC_SETTINGS_VERSION
)
{
settingsUpgraded
=
true
;
}
}
else
if
(
settings
.
allKeys
().
count
())
{
// Settings version key is missing and there are settings. This is an upgrade scenario.
settingsUpgraded
=
true
;
}
else
{
settings
.
setValue
(
_settingsVersionKey
,
QGC_SETTINGS_VERSION
);
}
if
(
settingsUpgraded
)
{
if
(
_settingsUpgraded
)
{
settings
.
clear
();
settings
.
setValue
(
_settingsVersionKey
,
QGC_SETTINGS_VERSION
);
showMessage
(
"The format for QGroundControl saved settings has been modified. "
...
...
src/QGCApplication.h
View file @
d535a632
...
...
@@ -183,13 +183,12 @@ private:
static
const
char
*
_darkStyleFile
;
static
const
char
*
_lightStyleFile
;
bool
_styleIsDark
;
///< true: dark style, false: light style
static
const
int
_missingParamsDelayedDisplayTimerTimeout
=
1000
;
///< Timeout to wait for next missing fact to come in before display
QTimer
_missingParamsDelayedDisplayTimer
;
///< Timer use to delay missing fact display
QStringList
_missingParams
;
///< List of missing facts to be displayed
bool
_fakeMobile
;
///< true: Fake ui into displaying mobile interface
bool
_styleIsDark
;
///< true: dark style, false: light style
static
const
int
_missingParamsDelayedDisplayTimerTimeout
=
1000
;
///< Timeout to wait for next missing fact to come in before display
QTimer
_missingParamsDelayedDisplayTimer
;
///< Timer use to delay missing fact display
QStringList
_missingParams
;
///< List of missing facts to be displayed
bool
_fakeMobile
;
///< true: Fake ui into displaying mobile interface
bool
_settingsUpgraded
;
///< true: Settings format has been upgrade to new version
#ifdef QT_DEBUG
bool
_testHighDPI
;
///< true: double fonts sizes for simulating high dpi devices
...
...
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