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
04984370
Commit
04984370
authored
Mar 30, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup current link before the link gets deleted
parent
f712a7f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
17 deletions
+13
-17
DebugConsole.cc
src/ui/DebugConsole.cc
+13
-17
No files found.
src/ui/DebugConsole.cc
View file @
04984370
...
...
@@ -189,6 +189,19 @@ void DebugConsole::addLink(LinkInterface* link)
void
DebugConsole
::
removeLink
(
LinkInterface
*
const
link
)
{
// Now if this was the current link, clean up some stuff.
if
(
link
==
currLink
)
{
disconnect
(
currLink
,
&
LinkInterface
::
bytesReceived
,
this
,
&
DebugConsole
::
receiveBytes
);
disconnect
(
currLink
,
&
LinkInterface
::
connected
,
this
,
&
DebugConsole
::
_linkConnected
);
disconnect
(
currLink
,
&
LinkInterface
::
communicationUpdate
,
this
,
&
DebugConsole
::
linkStatusUpdate
);
// Like disable the update time for the UI.
snapShotTimer
.
stop
();
currLink
=
NULL
;
}
bool
found
=
false
;
int
linkIndex
;
for
(
linkIndex
=
0
;
linkIndex
<
_links
.
count
();
linkIndex
++
)
{
...
...
@@ -203,14 +216,6 @@ void DebugConsole::removeLink(LinkInterface* const link)
m_ui
->
linkComboBox
->
removeItem
(
linkIndex
);
// Now if this was the current link, clean up some stuff.
if
(
link
==
currLink
)
{
// Like disable the update time for the UI.
snapShotTimer
.
stop
();
currLink
=
NULL
;
}
}
void
DebugConsole
::
linkStatusUpdate
(
const
QString
&
name
,
const
QString
&
text
)
{
...
...
@@ -222,15 +227,6 @@ void DebugConsole::linkStatusUpdate(const QString& name,const QString& text)
void
DebugConsole
::
linkSelected
(
int
linkIndex
)
{
// Disconnect
if
(
currLink
)
{
disconnect
(
currLink
,
SIGNAL
(
bytesReceived
(
LinkInterface
*
,
QByteArray
)),
this
,
SLOT
(
receiveBytes
(
LinkInterface
*
,
QByteArray
)));
disconnect
(
currLink
,
&
LinkInterface
::
connected
,
this
,
&
DebugConsole
::
_linkConnected
);
disconnect
(
currLink
,
SIGNAL
(
communicationUpdate
(
QString
,
QString
)),
this
,
SLOT
(
linkStatusUpdate
(
QString
,
QString
)));
snapShotTimer
.
stop
();
}
// Clear data
m_ui
->
receiveText
->
clear
();
...
...
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