tst_qmimedatabase: Add some log output when running update-mime-database.
When running the test, one gets the impression that it hangs. Add some debug output including time to show what happens. Change-Id: Iac6b4f0518ecec62169bf2269a0a8ec9192da570 Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
parent
99b94aadf8
commit
696ea2fff1
@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include "qstandardpaths.h"
|
#include "qstandardpaths.h"
|
||||||
|
|
||||||
|
#include <QtCore/QElapsedTimer>
|
||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
#include <QtCore/QTextStream>
|
#include <QtCore/QTextStream>
|
||||||
@ -765,16 +766,20 @@ static bool runUpdateMimeDatabase(const QString &path) // TODO make it a QMimeDa
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QElapsedTimer timer;
|
||||||
QProcess proc;
|
QProcess proc;
|
||||||
proc.setProcessChannelMode(QProcess::MergedChannels); // silence output
|
proc.setProcessChannelMode(QProcess::MergedChannels); // silence output
|
||||||
|
qDebug().noquote() << "runUpdateMimeDatabase: running" << umd << path << "...";
|
||||||
|
timer.start();
|
||||||
proc.start(umd, QStringList(path));
|
proc.start(umd, QStringList(path));
|
||||||
if (!proc.waitForStarted()) {
|
if (!proc.waitForStarted()) {
|
||||||
qWarning("Cannot start %s: %s",
|
qWarning("Cannot start %s: %s",
|
||||||
qPrintable(umd), qPrintable(proc.errorString()));
|
qPrintable(umd), qPrintable(proc.errorString()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
proc.waitForFinished();
|
const bool success = proc.waitForFinished();
|
||||||
//qDebug() << "runUpdateMimeDatabase" << path;
|
qDebug().noquote() << "runUpdateMimeDatabase: done,"
|
||||||
|
<< success << timer.elapsed() << "ms";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user