Utils: Start adding some asynchronous API to FilePath

Especially with the "remote" scenarios synchronous operations cannot
be expected to work reasonably well.

This here starts with adding asynchronous versions to some of the
FilePath member functions, taking additional "Continuation" style.

This is not necessarily the final syntax (sugar like .then(...) comes
to mind...), but is simple enough for now for the few uses we have,
and it is too early to see what will be needed in the end.

Change-Id: Idf4dde1b77d04cafb81b6c024031145bdd91a762
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-08-30 15:42:21 +02:00
parent 3c4e7321bf
commit ebf0917b9f
7 changed files with 83 additions and 4 deletions

View File

@@ -223,10 +223,11 @@ void CallgrindController::getLocalDataFile()
// this, &CallgrindController::sftpInitialized);
// m_sftp->start();
const bool res = m_valgrindOutputFile.copyFile(m_hostOutputFile);
QTC_CHECK(res);
emit localParseDataAvailable(m_hostOutputFile);
const auto afterCopy = [this](bool res) {
QTC_CHECK(res);
emit localParseDataAvailable(m_hostOutputFile);
};
m_valgrindOutputFile.asyncCopyFile(afterCopy, m_hostOutputFile);
}
void CallgrindController::sftpInitialized()