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
b0202ff5
Commit
b0202ff5
authored
Oct 20, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support bool settings
parent
230bf5e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
FlightMapSettings.cc
src/FlightMap/FlightMapSettings.cc
+18
-0
FlightMapSettings.h
src/FlightMap/FlightMapSettings.h
+3
-1
No files found.
src/FlightMap/FlightMapSettings.cc
View file @
b0202ff5
...
...
@@ -138,3 +138,21 @@ QString FlightMapSettings::loadMapSetting (const QString &mapName, const QString
settings
.
beginGroup
(
mapName
);
return
settings
.
value
(
key
,
defaultValue
).
toString
();
}
void
FlightMapSettings
::
saveBoolMapSetting
(
const
QString
&
mapName
,
const
QString
&
key
,
bool
value
)
{
QSettings
settings
;
settings
.
beginGroup
(
_settingsGroup
);
settings
.
beginGroup
(
mapName
);
settings
.
setValue
(
key
,
value
);
}
bool
FlightMapSettings
::
loadBoolMapSetting
(
const
QString
&
mapName
,
const
QString
&
key
,
bool
defaultValue
)
{
QSettings
settings
;
settings
.
beginGroup
(
_settingsGroup
);
settings
.
beginGroup
(
mapName
);
return
settings
.
value
(
key
,
defaultValue
).
toBool
();
}
src/FlightMap/FlightMapSettings.h
View file @
b0202ff5
...
...
@@ -46,6 +46,8 @@ public:
Q_INVOKABLE
void
saveMapSetting
(
const
QString
&
mapName
,
const
QString
&
key
,
const
QString
&
value
);
Q_INVOKABLE
QString
loadMapSetting
(
const
QString
&
mapName
,
const
QString
&
key
,
const
QString
&
defaultValue
);
Q_INVOKABLE
void
saveBoolMapSetting
(
const
QString
&
mapName
,
const
QString
&
key
,
bool
value
);
Q_INVOKABLE
bool
loadBoolMapSetting
(
const
QString
&
mapName
,
const
QString
&
key
,
bool
defaultValue
);
// Property accessors
...
...
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