aarpon
21st October 2009, 11:27
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:
if ( crashed == true )
uploadLogs( );
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
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:
if ( crashed == true )
uploadLogs( );
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