Browse Source

FTP: Add 'skip' list entry handling.

QGC4.4
Vladimir Ermakov 11 years ago
parent
commit
8f56f842c9
  1. 6
      src/uas/QGCUASFileManager.cc

6
src/uas/QGCUASFileManager.cc

@ -160,7 +160,7 @@ void QGCUASFileManager::_listAckResponse(Request* listAck) @@ -160,7 +160,7 @@ void QGCUASFileManager::_listAckResponse(Request* listAck)
// get the length of the name
uint8_t cBytesLeft = cBytes - offset;
size_t nlen = strnlen(ptr, cBytesLeft);
if (nlen < 2) {
if ((*ptr == 'S' && nlen > 1) || (*ptr != 'S' && nlen < 2)) {
_currentOperation = kCOIdle;
_emitErrorMessage(tr("Incorrectly formed list entry: '%1'").arg(ptr));
return;
@ -170,10 +170,12 @@ void QGCUASFileManager::_listAckResponse(Request* listAck) @@ -170,10 +170,12 @@ void QGCUASFileManager::_listAckResponse(Request* listAck)
return;
}
// Returned names are prepended with D for directory, F for file, U for unknown
// Returned names are prepended with D for directory, F for file, S for skip
if (*ptr == 'F' || *ptr == 'D') {
// put it in the view
_emitListEntry(ptr);
} else if (*ptr == 'S') {
// do nothing
} else {
qDebug() << "unknown entry" << ptr;
}

Loading…
Cancel
Save