Hello everybody,

my application checks at start (actually at the beginning of the MainWindow constructor) whether last run quit cleanly, otherwise asks the user if s/he wants to upload a log file to an ftp server. It does something very simple like this:

Qt Code:
  1. if ( crashed == true )
  2. uploadLogs( );
To copy to clipboard, switch view to plain text mode 

where the function uploadLogs( ) takes care of uploading the log file using QFtp. Since QFtp works asynchronously, uploadLogs( ) returns immediately, while the whole ftp login, transfer and closing takes a few seconds. My question is whether is it possible to prevent uploadLogs( ) from returning until the last pending command has completed.

Thanks a lot for any help.
Aaron