#include <iostream>
#include <QProcess>
-#include <QTime>
+#include <QElapsedTimer>
#include <QThread>
#include <QCoreApplication>
#include <QDebug>
};
-static ProgressInterface * progress_instance = 0;
+static ProgressInterface * progress_instance = nullptr;
void ProgressInterface::setInstance(ProgressInterface* p)
{
while (!timedout) {
if (process_->waitForFinished(timeout))
return true;
- bool stop = queryStopCommand(cmd_);
+ bool const stop = queryStopCommand(cmd_);
// The command may have finished in the meantime
if (process_->state() == QProcess::NotRunning)
return true;
}
// process events while waiting with timeout
- QTime timer;
+ QElapsedTimer timer;
timer.start();
while (state == waitwhile && state != Error && !timedout) {
// check for cancellation of background process
return false;
if (timer.elapsed() > timeout) {
- bool stop = queryStopCommand(cmd_);
+ bool const stop = queryStopCommand(cmd_);
// The command may have finished in the meantime
if (process_->state() == QProcess::NotRunning)
break;
QProcess* SystemcallPrivate::releaseProcess()
{
QProcess* released = process_;
- process_ = 0;
+ process_ = nullptr;
return released;
}