]> git.lyx.org Git - lyx.git/blobdiff - src/support/Systemcall.cpp
DocBook: simplify code to handle abstracts.
[lyx.git] / src / support / Systemcall.cpp
index a270b4118dbfc59584518317b37bc948b525e7c3..6ec50e1238b305d4346aa1fc45e0eb76aea37d6a 100644 (file)
@@ -29,7 +29,7 @@
 #include <iostream>
 
 #include <QProcess>
-#include <QTime>
+#include <QElapsedTimer>
 #include <QThread>
 #include <QCoreApplication>
 #include <QDebug>
@@ -78,7 +78,7 @@ public:
 };
 
 
-static ProgressInterface * progress_instance = 0;
+static ProgressInterface * progress_instance = nullptr;
 
 void ProgressInterface::setInstance(ProgressInterface* p)
 {
@@ -440,7 +440,7 @@ bool SystemcallPrivate::waitWhile(State waitwhile, bool process_events, int time
                        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;
@@ -467,7 +467,7 @@ bool SystemcallPrivate::waitWhile(State waitwhile, bool process_events, int time
        }
 
        // process events while waiting with timeout
-       QTime timer;
+       QElapsedTimer timer;
        timer.start();
        while (state == waitwhile && state != Error && !timedout) {
                // check for cancellation of background process
@@ -475,7 +475,7 @@ bool SystemcallPrivate::waitWhile(State waitwhile, bool process_events, int time
                        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;
@@ -639,7 +639,7 @@ int SystemcallPrivate::exitCode()
 QProcess* SystemcallPrivate::releaseProcess()
 {
        QProcess* released = process_;
-       process_ = 0;
+       process_ = nullptr;
        return released;
 }