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
973b9c0c
Commit
973b9c0c
authored
Jul 06, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #746 from DonLakeFlyer/FileListFix
Onboard Files fixes
parents
8c5fc409
20d1dd02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
17 deletions
+11
-17
QGCUASFileView.cc
src/ui/QGCUASFileView.cc
+11
-17
No files found.
src/ui/QGCUASFileView.cc
View file @
973b9c0c
...
@@ -70,12 +70,7 @@ void QGCUASFileView::_downloadFiles(void)
...
@@ -70,12 +70,7 @@ void QGCUASFileView::_downloadFiles(void)
void
QGCUASFileView
::
_refreshTree
(
void
)
void
QGCUASFileView
::
_refreshTree
(
void
)
{
{
QTreeWidgetItem
*
item
;
_ui
.
treeWidget
->
clear
();
for
(
int
i
=
_ui
.
treeWidget
->
invisibleRootItem
()
->
childCount
();
i
>=
0
;
i
--
)
{
item
=
_ui
.
treeWidget
->
takeTopLevelItem
(
i
);
delete
item
;
}
_walkIndexStack
.
clear
();
_walkIndexStack
.
clear
();
_walkItemStack
.
clear
();
_walkItemStack
.
clear
();
...
@@ -89,6 +84,9 @@ void QGCUASFileView::_refreshTree(void)
...
@@ -89,6 +84,9 @@ void QGCUASFileView::_refreshTree(void)
success
=
connect
(
_manager
,
SIGNAL
(
listComplete
(
void
)),
this
,
SLOT
(
_listComplete
(
void
)));
success
=
connect
(
_manager
,
SIGNAL
(
listComplete
(
void
)),
this
,
SLOT
(
_listComplete
(
void
)));
Q_ASSERT
(
success
);
Q_ASSERT
(
success
);
Q_UNUSED
(
success
);
Q_UNUSED
(
success
);
// Don't queue up more than once
_ui
.
listFilesButton
->
setEnabled
(
false
);
qDebug
()
<<
"List: /"
;
qDebug
()
<<
"List: /"
;
_manager
->
listDirectory
(
"/"
);
_manager
->
listDirectory
(
"/"
);
...
@@ -110,11 +108,7 @@ void QGCUASFileView::_treeStatusMessage(const QString& msg)
...
@@ -110,11 +108,7 @@ void QGCUASFileView::_treeStatusMessage(const QString& msg)
}
}
QTreeWidgetItem
*
item
;
QTreeWidgetItem
*
item
;
if
(
_walkItemStack
.
count
()
==
0
)
{
item
=
new
QTreeWidgetItem
(
_walkItemStack
.
last
(),
type
);
item
=
new
QTreeWidgetItem
(
_ui
.
treeWidget
,
type
);
}
else
{
item
=
new
QTreeWidgetItem
(
_walkItemStack
.
last
(),
type
);
}
Q_CHECK_PTR
(
item
);
Q_CHECK_PTR
(
item
);
item
->
setText
(
0
,
msg
.
right
(
msg
.
size
()
-
1
));
item
->
setText
(
0
,
msg
.
right
(
msg
.
size
()
-
1
));
...
@@ -123,14 +117,13 @@ void QGCUASFileView::_treeStatusMessage(const QString& msg)
...
@@ -123,14 +117,13 @@ void QGCUASFileView::_treeStatusMessage(const QString& msg)
void
QGCUASFileView
::
_treeErrorMessage
(
const
QString
&
msg
)
void
QGCUASFileView
::
_treeErrorMessage
(
const
QString
&
msg
)
{
{
QTreeWidgetItem
*
item
;
QTreeWidgetItem
*
item
;
if
(
_walkItemStack
.
count
()
==
0
)
{
item
=
new
QTreeWidgetItem
(
_walkItemStack
.
last
(),
_typeError
);
item
=
new
QTreeWidgetItem
(
_ui
.
treeWidget
,
_typeError
);
}
else
{
item
=
new
QTreeWidgetItem
(
_walkItemStack
.
last
(),
_typeError
);
}
Q_CHECK_PTR
(
item
);
Q_CHECK_PTR
(
item
);
item
->
setText
(
0
,
tr
(
"Error: "
)
+
msg
);
item
->
setText
(
0
,
tr
(
"Error: "
)
+
msg
);
// Fake listComplete signal after an error
_listComplete
();
}
}
void
QGCUASFileView
::
_listComplete
(
void
)
void
QGCUASFileView
::
_listComplete
(
void
)
...
@@ -178,6 +171,7 @@ Again:
...
@@ -178,6 +171,7 @@ Again:
disconnect
(
_manager
,
SIGNAL
(
statusMessage
(
QString
)),
this
,
SLOT
(
_treeStatusMessage
(
QString
)));
disconnect
(
_manager
,
SIGNAL
(
statusMessage
(
QString
)),
this
,
SLOT
(
_treeStatusMessage
(
QString
)));
disconnect
(
_manager
,
SIGNAL
(
errorMessage
(
QString
)),
this
,
SLOT
(
_treeErrorMessage
(
QString
)));
disconnect
(
_manager
,
SIGNAL
(
errorMessage
(
QString
)),
this
,
SLOT
(
_treeErrorMessage
(
QString
)));
disconnect
(
_manager
,
SIGNAL
(
listComplete
(
void
)),
this
,
SLOT
(
_listComplete
(
void
)));
disconnect
(
_manager
,
SIGNAL
(
listComplete
(
void
)),
this
,
SLOT
(
_listComplete
(
void
)));
_ui
.
listFilesButton
->
setEnabled
(
true
);
}
}
}
}
}
}
...
@@ -196,5 +190,5 @@ void QGCUASFileView::_downloadStatusMessage(const QString& msg)
...
@@ -196,5 +190,5 @@ void QGCUASFileView::_downloadStatusMessage(const QString& msg)
void
QGCUASFileView
::
_currentItemChanged
(
QTreeWidgetItem
*
current
,
QTreeWidgetItem
*
previous
)
void
QGCUASFileView
::
_currentItemChanged
(
QTreeWidgetItem
*
current
,
QTreeWidgetItem
*
previous
)
{
{
Q_UNUSED
(
previous
);
Q_UNUSED
(
previous
);
_ui
.
downloadButton
->
setEnabled
(
current
->
type
()
==
_typeFil
e
);
_ui
.
downloadButton
->
setEnabled
(
current
?
(
current
->
type
()
==
_typeFile
)
:
fals
e
);
}
}
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