#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)
{
in_double_quote = !in_double_quote;
}
} else if (c == '\\' && !escaped) {
- escaped = !escaped;
+ escaped = true;
} else if (c == '>' && !(in_double_quote || escaped)) {
if (suffixIs(outcmd[o], " 2")) {
outcmd[o] = rtrim(outcmd[o], "2");
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;
}