You are right, second thread looks like over-engineering, progress signal - OK. QDBusPendingReply something worth look at.
Maybe we can just propagate QNetworkAccessManager signals into specialized callbacks and specialized exceptions callbacks without raising exception.
So it would look like this:
CreateArg arg("new_folder");
void createDropboxFolder_Async(arg,
[](std::unique_ptr<FolderCreatedResult> result)
{
cout << "created folder " << result->toString();
},
[](std::unique_ptr<FolderCreatedError> error)
{
cout << "error creating folder " << error->toString();
}
)
and then if needed have also blocking companion function:
const CreateArg arg("new_folder");
FolderCreatedResult> result = createDropboxFolder(arg);




Reply With Quote



Bookmarks