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
20d1dd02
Commit
20d1dd02
authored
Jul 06, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix multiple clicks on List Files bugs
parent
7843cab1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
16 deletions
+10
-16
QGCUASFileView.cc
src/ui/QGCUASFileView.cc
+10
-16
No files found.
src/ui/QGCUASFileView.cc
View file @
20d1dd02
...
...
@@ -70,12 +70,7 @@ void QGCUASFileView::_downloadFiles(void)
void
QGCUASFileView
::
_refreshTree
(
void
)
{
QTreeWidgetItem
*
item
;
for
(
int
i
=
_ui
.
treeWidget
->
invisibleRootItem
()
->
childCount
();
i
>=
0
;
i
--
)
{
item
=
_ui
.
treeWidget
->
takeTopLevelItem
(
i
);
delete
item
;
}
_ui
.
treeWidget
->
clear
();
_walkIndexStack
.
clear
();
_walkItemStack
.
clear
();
...
...
@@ -89,6 +84,9 @@ void QGCUASFileView::_refreshTree(void)
success
=
connect
(
_manager
,
SIGNAL
(
listComplete
(
void
)),
this
,
SLOT
(
_listComplete
(
void
)));
Q_ASSERT
(
success
);
Q_UNUSED
(
success
);
// Don't queue up more than once
_ui
.
listFilesButton
->
setEnabled
(
false
);
qDebug
()
<<
"List: /"
;
_manager
->
listDirectory
(
"/"
);
...
...
@@ -110,11 +108,7 @@ void QGCUASFileView::_treeStatusMessage(const QString& msg)
}
QTreeWidgetItem
*
item
;
if
(
_walkItemStack
.
count
()
==
0
)
{
item
=
new
QTreeWidgetItem
(
_ui
.
treeWidget
,
type
);
}
else
{
item
=
new
QTreeWidgetItem
(
_walkItemStack
.
last
(),
type
);
}
item
=
new
QTreeWidgetItem
(
_walkItemStack
.
last
(),
type
);
Q_CHECK_PTR
(
item
);
item
->
setText
(
0
,
msg
.
right
(
msg
.
size
()
-
1
));
...
...
@@ -123,14 +117,13 @@ void QGCUASFileView::_treeStatusMessage(const QString& msg)
void
QGCUASFileView
::
_treeErrorMessage
(
const
QString
&
msg
)
{
QTreeWidgetItem
*
item
;
if
(
_walkItemStack
.
count
()
==
0
)
{
item
=
new
QTreeWidgetItem
(
_ui
.
treeWidget
,
_typeError
);
}
else
{
item
=
new
QTreeWidgetItem
(
_walkItemStack
.
last
(),
_typeError
);
}
item
=
new
QTreeWidgetItem
(
_walkItemStack
.
last
(),
_typeError
);
Q_CHECK_PTR
(
item
);
item
->
setText
(
0
,
tr
(
"Error: "
)
+
msg
);
// Fake listComplete signal after an error
_listComplete
();
}
void
QGCUASFileView
::
_listComplete
(
void
)
...
...
@@ -178,6 +171,7 @@ Again:
disconnect
(
_manager
,
SIGNAL
(
statusMessage
(
QString
)),
this
,
SLOT
(
_treeStatusMessage
(
QString
)));
disconnect
(
_manager
,
SIGNAL
(
errorMessage
(
QString
)),
this
,
SLOT
(
_treeErrorMessage
(
QString
)));
disconnect
(
_manager
,
SIGNAL
(
listComplete
(
void
)),
this
,
SLOT
(
_listComplete
(
void
)));
_ui
.
listFilesButton
->
setEnabled
(
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