summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/elevatedexecuteoperation.cpp
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2016-11-22 13:53:58 +0200
committerKatja Marttila <katja.marttila@qt.io>2020-02-13 11:44:43 +0000
commit77820bf2a318e4ac79b55f5e51361f159d561ac4 (patch)
tree2764c974cfcbe00971f92e450c4f31392dd90317 /src/libs/installer/elevatedexecuteoperation.cpp
parentd0592e4f79f74d5a0d472d50a3c54bf23e9181de (diff)
Use of QLoggingCategory
The change enables easier filtering of log messages Change-Id: I769f7c163e20f34c37fa0fe2b0729867ffca5bcb Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'src/libs/installer/elevatedexecuteoperation.cpp')
-rw-r--r--src/libs/installer/elevatedexecuteoperation.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/libs/installer/elevatedexecuteoperation.cpp b/src/libs/installer/elevatedexecuteoperation.cpp
index aa88f0398..05149fb26 100644
--- a/src/libs/installer/elevatedexecuteoperation.cpp
+++ b/src/libs/installer/elevatedexecuteoperation.cpp
@@ -30,6 +30,7 @@
#include "environment.h"
#include "qprocesswrapper.h"
+#include "globals.h"
#include <QtCore/QDebug>
#include <QtCore/QProcessEnvironment>
@@ -146,7 +147,8 @@ bool ElevatedExecuteOperation::Private::run(const QStringList &arguments)
process = new QProcessWrapper();
if (!workingDirectory.isEmpty()) {
process->setWorkingDirectory(workingDirectory);
- qDebug() << "ElevatedExecuteOperation setWorkingDirectory:" << workingDirectory;
+ qCDebug(QInstaller::lcGeneral) << "ElevatedExecuteOperation setWorkingDirectory:"
+ << workingDirectory;
}
QProcessEnvironment penv;
@@ -167,7 +169,8 @@ bool ElevatedExecuteOperation::Private::run(const QStringList &arguments)
//readProcessOutput should only called from this current Thread -> Qt::DirectConnection
QObject::connect(process, SIGNAL(readyRead()), q, SLOT(readProcessOutput()), Qt::DirectConnection);
process->start(args.front(), args.mid(1));
- qDebug() << args.front() << "started, arguments:" << QStringList(args.mid(1)).join(QLatin1String(" "));
+ qCDebug(QInstaller::lcGeneral) << args.front() << "started, arguments:"
+ << QStringList(args.mid(1)).join(QLatin1String(" "));
bool success = false;
//we still like the none blocking possibility to perform this operation without threads
@@ -213,7 +216,7 @@ bool ElevatedExecuteOperation::Private::run(const QStringList &arguments)
QByteArray standardErrorOutput = process->readAllStandardError();
// in error case it would be useful to see something in verbose output
if (!standardErrorOutput.isEmpty())
- qWarning().noquote() << standardErrorOutput;
+ qCWarning(QInstaller::lcGeneral).noquote() << standardErrorOutput;
returnValue = false;
}
@@ -240,14 +243,15 @@ void ElevatedExecuteOperation::Private::readProcessOutput()
Q_ASSERT(process);
Q_ASSERT(QThread::currentThread() == process->thread());
if (QThread::currentThread() != process->thread()) {
- qDebug() << Q_FUNC_INFO << "can only be called from the same thread as the process is.";
+ qCDebug(QInstaller::lcGeneral) << Q_FUNC_INFO << "can only be called from the "
+ "same thread as the process is.";
}
const QByteArray output = process->readAll();
if (!output.isEmpty()) {
if (q->error() == UserDefinedError)
- qWarning() << output;
+ qCWarning(QInstaller::lcGeneral)<< output;
else
- qDebug() << output;
+ qCDebug(QInstaller::lcGeneral) << output;
emit q->outputTextChanged(QString::fromLocal8Bit(output));
}
}