summaryrefslogtreecommitdiffstats
path: root/src/libs/installer
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-07-08 16:56:22 +0200
committerKai Koehne <kai.koehne@theqtcompany.com>2015-07-09 13:38:42 +0000
commitb2a65ce68bce4fcd4b517d1aadedb40792bfc818 (patch)
treee3685aa349abe10148c250d963723c049919b5c9 /src/libs/installer
parentd7f53290d9a8589752b9191131dfe2b500a23511 (diff)
Sanitize QDebug output
Prefer using the stream operator logic instead of using QString::fromLatin1. Add a noquote() where a QString should be printed without any quotes/escapes. This also fixes the tests with Qt 5.5, where QString's are further escaped. Change-Id: Ie3afd14b9355101d3c0b52f30f66ec759c76526c Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Diffstat (limited to 'src/libs/installer')
-rw-r--r--src/libs/installer/adminauthorization_win.cpp6
-rw-r--r--src/libs/installer/consumeoutputoperation.cpp3
-rw-r--r--src/libs/installer/downloadfiletask.cpp2
-rw-r--r--src/libs/installer/elevatedexecuteoperation.cpp2
-rw-r--r--src/libs/installer/fileutils.cpp11
-rw-r--r--src/libs/installer/installercalculator.cpp6
-rw-r--r--src/libs/installer/installiconsoperation.cpp6
-rw-r--r--src/libs/installer/link.cpp26
-rw-r--r--src/libs/installer/messageboxhandler.cpp4
-rw-r--r--src/libs/installer/metadatajob.cpp12
-rw-r--r--src/libs/installer/packagemanagercore.cpp4
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp34
-rw-r--r--src/libs/installer/packagemanagergui.cpp6
-rw-r--r--src/libs/installer/progresscoordinator.cpp2
-rw-r--r--src/libs/installer/qtpatch.cpp14
-rw-r--r--src/libs/installer/scriptengine_p.h2
-rw-r--r--src/libs/installer/settings.cpp7
-rw-r--r--src/libs/installer/settingsoperation.cpp4
18 files changed, 70 insertions, 81 deletions
diff --git a/src/libs/installer/adminauthorization_win.cpp b/src/libs/installer/adminauthorization_win.cpp
index 3f2155d35..f2ccfd5e0 100644
--- a/src/libs/installer/adminauthorization_win.cpp
+++ b/src/libs/installer/adminauthorization_win.cpp
@@ -112,14 +112,14 @@ bool AdminAuthorization::execute(QWidget *, const QString &program, const QStrin
shellExecuteInfo.lpParameters = (wchar_t *)args.utf16();
shellExecuteInfo.fMask = SEE_MASK_NOASYNC;
- qDebug() << QString::fromLatin1("Starting elevated process \"%1\" with arguments \"%2\".").arg(file, args);
+ qDebug() << "Starting elevated process" << file << "with arguments" << args;
if (ShellExecuteExW(&shellExecuteInfo)) {
qDebug() << "Finished starting elevated process.";
return true;
} else {
- qWarning() << QString::fromLatin1("Error while starting elevated process %1: %2").arg(
- program, QInstaller::windowsErrorString(GetLastError()));
+ qWarning() << "Error while starting elevated process" << program
+ << ":" << QInstaller::windowsErrorString(GetLastError());
}
return false;
}
diff --git a/src/libs/installer/consumeoutputoperation.cpp b/src/libs/installer/consumeoutputoperation.cpp
index e366b655f..4e8fc56aa 100644
--- a/src/libs/installer/consumeoutputoperation.cpp
+++ b/src/libs/installer/consumeoutputoperation.cpp
@@ -127,8 +127,7 @@ bool ConsumeOutputOperation::performOperation()
}
if (executableOutput.isEmpty()) {
- qWarning() << QString::fromLatin1("Cannot get any query output from executable \"%1\".").arg(
- executable.absoluteFilePath());
+ qWarning() << "Cannot get any query output from executable" << executable.absoluteFilePath();
}
core->setValue(installerKeyName, QString::fromLocal8Bit(executableOutput));
return true;
diff --git a/src/libs/installer/downloadfiletask.cpp b/src/libs/installer/downloadfiletask.cpp
index b35284b49..4a0ac3784 100644
--- a/src/libs/installer/downloadfiletask.cpp
+++ b/src/libs/installer/downloadfiletask.cpp
@@ -278,7 +278,7 @@ void Downloader::onSslErrors(const QList<QSslError> &sslErrors)
Q_UNUSED(sslErrors);
#else
foreach (const QSslError &error, sslErrors)
- qDebug() << QString::fromLatin1("SSL error: %1").arg(error.errorString());
+ qDebug() << "SSL error:" << error.errorString();
#endif
}
diff --git a/src/libs/installer/elevatedexecuteoperation.cpp b/src/libs/installer/elevatedexecuteoperation.cpp
index 6aa52e00b..a3d33e907 100644
--- a/src/libs/installer/elevatedexecuteoperation.cpp
+++ b/src/libs/installer/elevatedexecuteoperation.cpp
@@ -226,7 +226,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() << standardErrorOutput;
+ qWarning().noquote() << standardErrorOutput;
returnValue = false;
}
diff --git a/src/libs/installer/fileutils.cpp b/src/libs/installer/fileutils.cpp
index 00c289ffa..7da62a367 100644
--- a/src/libs/installer/fileutils.cpp
+++ b/src/libs/installer/fileutils.cpp
@@ -186,7 +186,7 @@ void QInstaller::removeFiles(const QString &path, bool ignoreErrors)
QDir::toNativeSeparators(f.fileName()), f.errorString());
if (!ignoreErrors)
throw Error(errorMessage);
- qWarning() << errorMessage;
+ qWarning().noquote() << errorMessage;
}
}
}
@@ -228,7 +228,7 @@ void QInstaller::removeDirectory(const QString &path, bool ignoreErrors)
errnoToQString(errno));
if (!ignoreErrors)
throw Error(errorMessage);
- qWarning() << errorMessage;
+ qWarning().noquote() << errorMessage;
}
}
}
@@ -493,14 +493,13 @@ void QInstaller::setApplicationIcon(const QString &application, const QString &i
{
QFile iconFile(icon);
if (!iconFile.open(QIODevice::ReadOnly)) {
- qWarning() << QString::fromLatin1("Cannot use \"%1\" as application icon: %2")
- .arg(icon, iconFile.errorString());
+ qWarning() << "Cannot use" << icon << "as an application icon:" << iconFile.errorString();
return;
}
if (QImageReader::imageFormat(icon) != "ico") {
- qWarning() << QString::fromLatin1("Cannot use \"%1\" as application icon, unsupported format %2.")
- .arg(icon, QLatin1String(QImageReader::imageFormat(icon)));
+ qWarning() << "Cannot use" << icon << "as an application icon, unsupported format"
+ << QImageReader::imageFormat(icon).constData();
return;
}
diff --git a/src/libs/installer/installercalculator.cpp b/src/libs/installer/installercalculator.cpp
index a03d11fc2..211190e6c 100644
--- a/src/libs/installer/installercalculator.cpp
+++ b/src/libs/installer/installercalculator.cpp
@@ -121,7 +121,7 @@ bool InstallerCalculator::appendComponentsToInstall(const QList<Component *> &co
foreach (Component *component, components){
if (m_toInstallComponentIds.contains(component->name())) {
const QString errorMessage = recursionError(component);
- qWarning() << errorMessage;
+ qWarning().noquote() << errorMessage;
m_componentsToInstallError.append(errorMessage);
Q_ASSERT_X(!m_toInstallComponentIds.contains(component->name()), Q_FUNC_INFO,
qPrintable(errorMessage));
@@ -173,7 +173,7 @@ bool InstallerCalculator::appendComponentToInstall(Component *component)
const QString errorMessage = QCoreApplication::translate("InstallerCalculator",
"Cannot find missing dependency \"%1\" for \"%2\".").arg(dependencyComponentName,
component->name());
- qWarning() << errorMessage;
+ qWarning().noquote() << errorMessage;
m_componentsToInstallError.append(errorMessage);
return false;
}
@@ -182,7 +182,7 @@ bool InstallerCalculator::appendComponentToInstall(Component *component)
&& !m_toInstallComponentIds.contains(dependencyComponent->name())) {
if (m_visitedComponents.value(component).contains(dependencyComponent)) {
const QString errorMessage = recursionError(component);
- qWarning() << errorMessage;
+ qWarning().noquote() << errorMessage;
m_componentsToInstallError = errorMessage;
Q_ASSERT_X(!m_visitedComponents.value(component).contains(dependencyComponent),
Q_FUNC_INFO, qPrintable(errorMessage));
diff --git a/src/libs/installer/installiconsoperation.cpp b/src/libs/installer/installiconsoperation.cpp
index 377151745..6240640f2 100644
--- a/src/libs/installer/installiconsoperation.cpp
+++ b/src/libs/installer/installiconsoperation.cpp
@@ -273,10 +273,10 @@ bool InstallIconsOperation::undoOperation()
}
if (!warningMessages.isEmpty()) {
- qWarning() << QString::fromLatin1("Undo of operation %1 with arguments \"%2\" had some problems.").arg(
- name(), arguments().join(QLatin1String(", ")));
+ qWarning() << "Undo of operation" << name() << "with arguments"
+ << arguments().join(QLatin1String(", ")) << "had some problems.";
foreach (const QString &message, warningMessages) {
- qWarning() << message;
+ qWarning().noquote() << message;
}
}
diff --git a/src/libs/installer/link.cpp b/src/libs/installer/link.cpp
index f90a6d3c1..4eaf58ece 100644
--- a/src/libs/installer/link.cpp
+++ b/src/libs/installer/link.cpp
@@ -94,8 +94,7 @@ public:
OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, 0);
if (m_dirHandle == INVALID_HANDLE_VALUE) {
- qWarning() << QString::fromLatin1("Cannot open: \"%1\": %2\n").arg(path)
- .arg(QInstaller::windowsErrorString(GetLastError()));
+ qWarning() << "Cannot open" << path << ":" << QInstaller::windowsErrorString(GetLastError());
}
}
@@ -144,14 +143,12 @@ QString readWindowsSymLink(const QString &path)
Link createJunction(const QString &linkPath, const QString &targetPath)
{
if (!QDir().mkpath(linkPath)) {
- qWarning() << QString::fromLatin1("Cannot create the mount directory: %1").arg(
- linkPath);
+ qWarning() << "Cannot create the mount directory" << linkPath;
return Link(linkPath);
}
FileHandleWrapper dirHandle(linkPath);
if (dirHandle.handle() == INVALID_HANDLE_VALUE) {
- qWarning() << QString::fromLatin1("Cannot open: \"%1\": %2\n").arg(linkPath)
- .arg(QInstaller::windowsErrorString(GetLastError()));
+ qWarning() << "Cannot open" << linkPath << ":" << QInstaller::windowsErrorString(GetLastError());
return Link(linkPath);
}
@@ -181,8 +178,8 @@ Link createJunction(const QString &linkPath, const QString &targetPath)
if (!::DeviceIoControl(dirHandle.handle(), FSCTL_SET_REPARSE_POINT, reparseStructData,
reparseStructData->ReparseDataLength + REPARSE_DATA_BUFFER_HEADER_SIZE, 0, 0,
&bytesReturned, 0)) {
- qWarning() << QString::fromLatin1("Cannot set the reparse point for \"%1\" to %2: %3"
- ).arg(linkPath, targetPath).arg(QInstaller::windowsErrorString(GetLastError()));
+ qWarning() << "Cannot set the reparse point for" << linkPath "to" << targetPath
+ << ":" << QInstaller::windowsErrorString(GetLastError());
}
return Link(linkPath);
}
@@ -203,8 +200,7 @@ bool removeJunction(const QString &path)
REPARSE_GUID_DATA_BUFFER_HEADER_SIZE, 0, 0,
&bytesReturned, 0)) {
- qWarning() << QString::fromLatin1("Cannot remove the reparse point \"'%1\": %3"
- ).arg(path).arg(QInstaller::windowsErrorString(GetLastError()));
+ qWarning() << "Cannot remove the reparse point" << path << ":" << QInstaller::windowsErrorString(GetLastError());
return false;
}
}
@@ -217,8 +213,7 @@ Link createLnSymlink(const QString &linkPath, const QString &targetPath)
int linkedError = symlink(QFileInfo(targetPath).absoluteFilePath().toUtf8(),
QFileInfo(linkPath).absoluteFilePath().toUtf8());
if (linkedError != 0) {
- qWarning() << QString::fromLatin1("Cannot create a symlink from \"%1\" to \"%2\": %3"
- ).arg(linkPath, targetPath).arg(linkedError);
+ qWarning() << "Cannot create a symlink from" << linkPath << "to" << targetPath << ":" << linkedError;
}
@@ -245,8 +240,7 @@ Link Link::create(const QString &link, const QString &targetPath)
if (!linkPathExists)
linkPathExists = QDir().mkpath(linkPath);
if (!linkPathExists) {
- qWarning() << QString::fromLatin1("Cannot create the needed directories: %1").arg(
- link);
+ qWarning() << "Cannot create the needed directories" << link;
return Link(link);
}
@@ -254,8 +248,8 @@ Link Link::create(const QString &link, const QString &targetPath)
if (QFileInfo(targetPath).isDir())
return createJunction(link, targetPath);
- qWarning() << QString::fromLatin1("At the moment the %1 can not create anything else as "\
- "junctions for directories under windows").arg(QLatin1String(Q_FUNC_INFO));
+ qWarning() << "At the moment the" << Q_FUNC_INFO << "can not create anything else as "
+ << "junctions for directories under windows";
return Link(link);
#else
return createLnSymlink(link, targetPath);
diff --git a/src/libs/installer/messageboxhandler.cpp b/src/libs/installer/messageboxhandler.cpp
index 368a68e01..deba89506 100644
--- a/src/libs/installer/messageboxhandler.cpp
+++ b/src/libs/installer/messageboxhandler.cpp
@@ -407,8 +407,8 @@ QMessageBox::StandardButton MessageBoxHandler::showMessageBox(MessageType messag
messageTypeHash.insert(warningType, QLatin1String("warning"));
};
- qDebug() << QString::fromLatin1("Created %1 message box %2: \"%3\", %4").arg(messageTypeHash
- .value(messageType), identifier, title, text);
+ qDebug().nospace() << "Created " << messageTypeHash.value(messageType).toUtf8().constData()
+ << " message box " << identifier << ": " << title << ", " << text;
if (qobject_cast<QApplication*> (qApp) == 0)
return defaultButton;
diff --git a/src/libs/installer/metadatajob.cpp b/src/libs/installer/metadatajob.cpp
index 9082c0367..bce43fa27 100644
--- a/src/libs/installer/metadatajob.cpp
+++ b/src/libs/installer/metadatajob.cpp
@@ -122,7 +122,7 @@ void MetadataJob::xmlTaskFinished()
if (e.type() == AuthenticationRequiredException::Type::Proxy) {
const QNetworkProxy proxy = e.proxy();
ProxyCredentialsDialog proxyCredentials(proxy);
- qDebug() << e.message();
+ qDebug().noquote() << e.message();
if (proxyCredentials.exec() == QDialog::Accepted) {
qDebug() << "Retrying with new credentials ...";
@@ -137,7 +137,7 @@ void MetadataJob::xmlTaskFinished()
emitFinishedWithError(QInstaller::DownloadError, tr("Missing proxy credentials."));
}
} else if (e.type() == AuthenticationRequiredException::Type::Server) {
- qDebug() << e.message();
+ qDebug().noquote() << e.message();
ServerAuthenticationDialog dlg(e.message(), e.taskItem());
if (dlg.exec() == QDialog::Accepted) {
Repository original = e.taskItem().value(TaskRole::UserRole)
@@ -319,8 +319,8 @@ MetadataJob::Status MetadataJob::parseUpdatesXml(const QList<FileTaskResult> &re
QString error;
QDomDocument doc;
if (!doc.setContent(&file, &error)) {
- qDebug() << QString::fromLatin1("Cannot fetch a valid version of Updates.xml from "
- "repository %1: %2").arg(metadata.repository.displayname(), error);
+ qDebug().nospace() << "Cannot fetch a valid version of Updates.xml from repository "
+ << metadata.repository.displayname() << ": " << error;
return XmlDownloadFailure;
}
file.close();
@@ -405,12 +405,12 @@ MetadataJob::Status MetadataJob::parseUpdatesXml(const QList<FileTaskResult> &re
if (ProductKeyCheck::instance()->isValidRepository(newRepository)) {
// store the new repository and the one old it replaces
repositoryUpdates.insertMulti(action, qMakePair(newRepository, oldRepository));
- qDebug() << "Replace repository:" << oldRepository.displayname() << "with:"
+ qDebug() << "Replace repository" << oldRepository.displayname() << "with"
<< newRepository.displayname();
}
} else {
qDebug() << "Invalid additional repositories action set in Updates.xml fetched "
- "from:" << metadata.repository.displayname() << "Line:" << el.lineNumber();
+ "from" << metadata.repository.displayname() << "line:" << el.lineNumber();
}
}
}
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index 1bb800b4a..ddd35b974 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -1701,7 +1701,7 @@ bool PackageManagerCore::killProcess(const QString &absoluteFilePath) const
processPath = QDir::cleanPath(processPath.replace(QLatin1Char('\\'), QLatin1Char('/')));
if (processPath == normalizedPath) {
- qDebug() << QString::fromLatin1("try to kill process: %1(%2)").arg(process.name).arg(process.id);
+ qDebug().nospace() << "try to kill process " << process.name << " (" << process.id << ")";
//to keep the ui responsible use QtConcurrent::run
QFutureWatcher<bool> futureWatcher;
@@ -1715,7 +1715,7 @@ bool PackageManagerCore::killProcess(const QString &absoluteFilePath) const
if (!future.isFinished())
loop.exec();
- qDebug() << QString::fromLatin1("\"%1\" killed!").arg(process.name);
+ qDebug() << process.name << "killed!";
return future.result();
}
}
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index 13fa1d7b0..c252f4a95 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -98,9 +98,9 @@ public:
{
if (!m_operation)
return;
- qDebug() << QString::fromLatin1("%1 %2 operation: %3").arg(state, m_operation->value(
+ qDebug().noquote() << QString::fromLatin1("%1 %2 operation: %3").arg(state, m_operation->value(
QLatin1String("component")).toString(), m_operation->name());
- qDebug() << QString::fromLatin1("\t- arguments: %1").arg(m_operation->arguments()
+ qDebug().noquote() << QString::fromLatin1("\t- arguments: %1").arg(m_operation->arguments()
.join(QLatin1String(", ")));
}
~OperationTracer() {
@@ -235,13 +235,12 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core, q
QScopedPointer<QInstaller::Operation> op(KDUpdater::UpdateOperationFactory::instance()
.create(operation.name, core));
if (op.isNull()) {
- qWarning() << QString::fromLatin1("Failed to load unknown operation %1")
- .arg(operation.name);
+ qWarning() << "Failed to load unknown operation" << operation.name;
continue;
}
if (!op->fromXml(operation.xml)) {
- qWarning() << "Failed to load XML for operation:" << operation.name;
+ qWarning() << "Failed to load XML for operation" << operation.name;
continue;
}
op->setPackageManager(core);
@@ -1072,8 +1071,7 @@ void PackageManagerCorePrivate::writeMaintenanceToolBinaryData(QFileDevice *outp
file.remove(); // clear all possible leftovers
m_core->setValue(QString::fromLatin1("DefaultResourceReplacement"), QString());
} else {
- qWarning() << QString::fromLatin1("Cannot replace default resource with \"%1\".")
- .arg(QDir::toNativeSeparators(newDefaultResource));
+ qWarning() << "Cannot replace default resource with" << QDir::toNativeSeparators(newDefaultResource);
}
}
@@ -1261,17 +1259,17 @@ void PackageManagerCorePrivate::writeMaintenanceTool(OperationList performedOper
if (!replacementBinary.remove()) {
// Is there anything more sensible we can do with this error? I think not. It's not serious
// enough for throwing / aborting the process.
- qDebug() << QString::fromLatin1("Cannot remove installer base binary \"%1\" after updating "
- "the maintenance tool: %2").arg(installerBaseBinary, replacementBinary.errorString());
+ qDebug() << "Cannot remove installer base binary" << installerBaseBinary
+ << "after updating the maintenance tool:" << replacementBinary.errorString();
} else {
- qDebug() << QString::fromLatin1("Removed installer base binary \"%1\" after updating the "
- "maintenance tool.").arg(installerBaseBinary);
+ qDebug() << "Removed installer base binary" << installerBaseBinary
+ << "after updating the maintenance tool.";
}
m_installerBaseBinaryUnreplaced.clear();
} else if (!installerBaseBinary.isEmpty() && !QFileInfo(installerBaseBinary).exists()) {
- qWarning() << QString::fromLatin1("The current maintenance tool could not be "
- "updated. \"%1\" does not exist. Please fix the \"setInstallerBaseBinary(<temp_installer_base_"
- "binary_path>)\" call in your script.").arg(installerBaseBinary);
+ qWarning() << "The current maintenance tool could not be updated." << installerBaseBinary
+ << "does not exist. Please fix the \"setInstallerBaseBinary(<temp_installer_base_"
+ "binary_path>)\" call in your script.";
}
QFile input;
@@ -1281,9 +1279,9 @@ void PackageManagerCorePrivate::writeMaintenanceTool(OperationList performedOper
try {
if (isInstaller()) {
if (QFile::exists(dataFile)) {
- qWarning() << QString::fromLatin1("Found binary data file \"%1\" but "
+ qWarning() << "Found binary data file" << dataFile << "but "
"deliberately not used. Running as installer requires to read the "
- "resources from the application binary.").arg(dataFile);
+ "resources from the application binary.";
}
throw Error();
}
@@ -2230,8 +2228,8 @@ bool PackageManagerCorePrivate::addUpdateResourcesFromRepositories(bool parseChe
QString error;
QDomDocument doc;
if (!doc.setContent(&updatesFile, &error, &line, &column)) {
- qDebug() << QString::fromLatin1("Parse error in file %4: %1 at line %2 col %3").arg(error,
- QString::number(line), QString::number(column), updatesFile.fileName());
+ qDebug().nospace() << "Parse error in file" << updatesFile.fileName()
+ << ": " << error << " at line " << line << " col " << column;
setStatus(PackageManagerCore::Failure, tr("Cannot add temporary update source information."));
return false;
}
diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp
index d25e9f486..116a9e039 100644
--- a/src/libs/installer/packagemanagergui.cpp
+++ b/src/libs/installer/packagemanagergui.cpp
@@ -2610,9 +2610,9 @@ void ReadyForInstallationPage::entering()
// at the moment there is no better way to check this
if (targetVolume.size() == 0 && installVolumeAvailableSize == 0) {
- qDebug() << QString::fromLatin1("Cannot determine available space on device. Volume "
- "descriptor: %1, Mount path: %2. Continue silently.").arg(targetVolume
- .volumeDescriptor(), targetVolume.mountPath());
+ qDebug().nospace() << "Cannot determine available space on device. "
+ "Volume descriptor: " << targetVolume.volumeDescriptor()
+ << ", Mount path: " << targetVolume.mountPath() << ". Continue silently.";
return; // TODO: Shouldn't this also disable the "Next" button?
}
diff --git a/src/libs/installer/progresscoordinator.cpp b/src/libs/installer/progresscoordinator.cpp
index 537285fcd..405b01129 100644
--- a/src/libs/installer/progresscoordinator.cpp
+++ b/src/libs/installer/progresscoordinator.cpp
@@ -107,7 +107,7 @@ void ProgressCoordinator::registerPartProgress(QObject *sender, const char *sign
void ProgressCoordinator::partProgressChanged(double fraction)
{
if (fraction < 0 || fraction > 1) {
- qWarning() << "The fraction is outside from possible value:" << QString::number(fraction);
+ qWarning() << "The fraction is outside from possible value:" << fraction;
return;
}
diff --git a/src/libs/installer/qtpatch.cpp b/src/libs/installer/qtpatch.cpp
index 88020fddb..639756454 100644
--- a/src/libs/installer/qtpatch.cpp
+++ b/src/libs/installer/qtpatch.cpp
@@ -91,8 +91,8 @@ QHash<QString, QByteArray> QtPatch::qmakeValues(const QString &qmakePath, QByteA
if (process.exitStatus() == QProcess::CrashExit) {
qWarning() << qmake.absoluteFilePath() << args
<< "crashed with exit code" << process.exitCode()
- << "standard output: " << output
- << "error output: " << process.readAllStandardError();
+ << "standard output:" << output
+ << "error output:" << process.readAllStandardError();
return qmakeValueHash;
}
qmakeValueHash = readQmakeOutput(output);
@@ -126,7 +126,7 @@ bool QtPatch::patchBinaryFile(const QString &fileName,
openFileForPatching(&file);
if (!file.isOpen()) {
qDebug() << "qpatch: warning: file" << qPrintable(fileName) << "cannot open.";
- qDebug() << qPrintable(file.errorString());
+ qDebug().noquote() << file.errorString();
return false;
}
@@ -174,8 +174,7 @@ bool QtPatch::patchTextFile(const QString &fileName,
QFile file(fileName);
if (!file.open(QFile::ReadOnly)) {
- qDebug() << QString::fromLatin1("Cannot open file \"%1\" for patching: %2").arg(
- fileName, file.errorString());
+ qDebug() << "Cannot open file" << fileName << "for patching:" << file.errorString();
return false;
}
@@ -189,7 +188,7 @@ bool QtPatch::patchTextFile(const QString &fileName,
}
if (!file.open(QFile::WriteOnly | QFile::Truncate)) {
- qDebug() << QString::fromLatin1("File \"%1\" not writable.").arg(fileName);
+ qDebug() << "File" << fileName << "not writable.";
return false;
}
@@ -209,7 +208,6 @@ bool QtPatch::openFileForPatching(QFile *file)
}
return file->openMode() == QFile::ReadWrite;
}
- qDebug() << QString::fromLatin1("File \"%1\" is open, so it cannot be opened again.").arg(
- file->fileName());
+ qDebug() << "File" << file->fileName() << "is open, so it cannot be opened again.";
return false;
}
diff --git a/src/libs/installer/scriptengine_p.h b/src/libs/installer/scriptengine_p.h
index 1b1e408d0..e1ff08b87 100644
--- a/src/libs/installer/scriptengine_p.h
+++ b/src/libs/installer/scriptengine_p.h
@@ -55,7 +55,7 @@ public:
ConsoleProxy() {}
public slots :
- void log(const QString &log) { qDebug() << log; }
+ void log(const QString &log) { qDebug().noquote() << log; }
};
class InstallerProxy : public QObject
diff --git a/src/libs/installer/settings.cpp b/src/libs/installer/settings.cpp
index f46388d2d..94adbf8af 100644
--- a/src/libs/installer/settings.cpp
+++ b/src/libs/installer/settings.cpp
@@ -86,9 +86,10 @@ static void raiseError(QXmlStreamReader &reader, const QString &error, Settings:
} else {
QFile *xmlFile = qobject_cast<QFile*>(reader.device());
if (xmlFile) {
- qWarning() << QString::fromLatin1("Ignoring following settings reader error in %1, line %2, "
- "column %3: %4").arg(xmlFile->fileName()).arg(reader.lineNumber()).arg(reader.columnNumber())
- .arg(error);
+ qWarning().noquote().nospace()
+ << "Ignoring following settings reader error in " << xmlFile->fileName()
+ << ", line " << reader.lineNumber() << ", column " << reader.columnNumber()
+ << ": " << error;
} else {
qWarning("Ignoring following settings reader error: %s", qPrintable(error));
}
diff --git a/src/libs/installer/settingsoperation.cpp b/src/libs/installer/settingsoperation.cpp
index 38aec23b1..97a353f44 100644
--- a/src/libs/installer/settingsoperation.cpp
+++ b/src/libs/installer/settingsoperation.cpp
@@ -183,14 +183,14 @@ bool SettingsOperation::undoOperation()
if (cleanUp) {
QFile settingsFile(path);
if (!settingsFile.remove())
- qWarning() << settingsFile.errorString();
+ qWarning().noquote() << settingsFile.errorString();
if (!value(QLatin1String("createddir")).toString().isEmpty()) {
KDUpdater::MkdirOperation mkDirOperation;
mkDirOperation.setArguments(QStringList() << QFileInfo(path).absolutePath());
mkDirOperation.setValue(QLatin1String("createddir"), value(QLatin1String("createddir")));
if (!mkDirOperation.undoOperation()) {
- qWarning() << mkDirOperation.errorString();
+ qWarning().noquote() << mkDirOperation.errorString();
}
}
}