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
1c328b9c
Unverified
Commit
1c328b9c
authored
Mar 27, 2020
by
Don Gagne
Committed by
GitHub
Mar 27, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8610 from booo/remove-trailing-white-spaces-joystickmanager
remove trailing whitespaces in JoystickManager.cc
parents
90941100
7079db9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
JoystickManager.cc
src/Joystick/JoystickManager.cc
+8
-8
JoystickManager.h
src/Joystick/JoystickManager.h
+8
-8
No files found.
src/Joystick/JoystickManager.cc
View file @
1c328b9c
...
...
@@ -106,14 +106,14 @@ void JoystickManager::_setActiveJoystickFromSettings(void)
}
QSettings
settings
;
settings
.
beginGroup
(
_settingsGroup
);
QString
name
=
settings
.
value
(
_settingsKeyActiveJoystick
).
toString
();
if
(
name
.
isEmpty
())
{
name
=
_name2JoystickMap
.
first
()
->
name
();
}
setActiveJoystick
(
_name2JoystickMap
.
value
(
name
,
_name2JoystickMap
.
first
()));
settings
.
setValue
(
_settingsKeyActiveJoystick
,
_activeJoystick
->
name
());
}
...
...
@@ -139,9 +139,9 @@ void JoystickManager::setActiveJoystick(Joystick* joystick)
if
(
_activeJoystick
)
{
_activeJoystick
->
stopPolling
();
}
_activeJoystick
=
joystick
;
if
(
_activeJoystick
!=
nullptr
)
{
qCDebug
(
JoystickManagerLog
)
<<
"Set active:"
<<
_activeJoystick
->
name
();
...
...
@@ -156,11 +156,11 @@ void JoystickManager::setActiveJoystick(Joystick* joystick)
QVariantList
JoystickManager
::
joysticks
(
void
)
{
QVariantList
list
;
for
(
const
QString
&
name
:
_name2JoystickMap
.
keys
())
{
list
+=
QVariant
::
fromValue
(
_name2JoystickMap
[
name
]);
}
return
list
;
}
...
...
@@ -180,7 +180,7 @@ void JoystickManager::setActiveJoystickName(const QString& name)
qCWarning
(
JoystickManagerLog
)
<<
"Set active not in map"
<<
name
;
return
;
}
setActiveJoystick
(
_name2JoystickMap
[
name
]);
}
...
...
src/Joystick/JoystickManager.h
View file @
1c328b9c
...
...
@@ -25,27 +25,27 @@ Q_DECLARE_LOGGING_CATEGORY(JoystickManagerLog)
class
JoystickManager
:
public
QGCTool
{
Q_OBJECT
public:
JoystickManager
(
QGCApplication
*
app
,
QGCToolbox
*
toolbox
);
~
JoystickManager
();
Q_PROPERTY
(
QVariantList
joysticks
READ
joysticks
NOTIFY
availableJoysticksChanged
)
Q_PROPERTY
(
QStringList
joystickNames
READ
joystickNames
NOTIFY
availableJoysticksChanged
)
Q_PROPERTY
(
Joystick
*
activeJoystick
READ
activeJoystick
WRITE
setActiveJoystick
NOTIFY
activeJoystickChanged
)
Q_PROPERTY
(
QString
activeJoystickName
READ
activeJoystickName
WRITE
setActiveJoystickName
NOTIFY
activeJoystickNameChanged
)
/// List of available joysticks
QVariantList
joysticks
();
/// List of available joystick names
QStringList
joystickNames
(
void
);
/// Get active joystick
Joystick
*
activeJoystick
(
void
);
/// Set active joystick
void
setActiveJoystick
(
Joystick
*
joystick
);
QString
activeJoystickName
(
void
);
void
setActiveJoystickName
(
const
QString
&
name
);
...
...
@@ -65,15 +65,15 @@ signals:
private
slots
:
void
_updateAvailableJoysticks
(
void
);
private:
void
_setActiveJoystickFromSettings
(
void
);
private:
Joystick
*
_activeJoystick
;
QMap
<
QString
,
Joystick
*>
_name2JoystickMap
;
MultiVehicleManager
*
_multiVehicleManager
;
static
const
char
*
_settingsGroup
;
static
const
char
*
_settingsKeyActiveJoystick
;
...
...
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