From 376804db8788bfde1985b9d2bbc14af68e9c9260 Mon Sep 17 00:00:00 2001 From: kh1 Date: Mon, 16 Jan 2012 23:42:54 +0100 Subject: Use qDebug instead of verbose. The message handler now forwards everything to the verbosew riter anyway. Change-Id: I822f86e8f2e2e7690a3b855ed83199d2f41dc480 Reviewed-by: Tim Jenssen --- examples/downloadspeed/main.cpp | 8 +- installerbuilder/binarycreator/binarycreator.cpp | 36 +++---- installerbuilder/common/binaryformat.cpp | 27 ++--- installerbuilder/common/fileutils.cpp | 8 +- installerbuilder/common/repositorygen.cpp | 116 ++++++++++----------- installerbuilder/installerbase/installerbase.cpp | 16 +-- installerbuilder/installerbase/installerbase_p.cpp | 35 ++++--- installerbuilder/installerbase/tabcontroller.cpp | 4 +- .../3rdparty/kdtools/kdupdaterupdatefinder.cpp | 19 ++-- installerbuilder/libinstaller/component.cpp | 10 +- .../libinstaller/createshortcutoperation.cpp | 8 +- .../libinstaller/downloadarchivesjob.cpp | 1 - .../libinstaller/elevatedexecuteoperation.cpp | 20 ++-- .../libinstaller/getrepositoriesmetainfojob.cpp | 5 +- .../libinstaller/getrepositorymetainfojob.cpp | 5 +- installerbuilder/libinstaller/macrelocateqt.cpp | 7 +- .../macreplaceinstallnamesoperation.cpp | 16 ++- installerbuilder/libinstaller/operationrunner.cpp | 4 +- .../libinstaller/packagemanagercore.cpp | 6 +- .../libinstaller/packagemanagercore_p.cpp | 58 +++++------ .../libinstaller/packagemanagergui.cpp | 31 +++--- .../libinstaller/performinstallationform.cpp | 1 - .../libinstaller/progresscoordinator.cpp | 8 +- installerbuilder/libinstaller/qprocesswrapper.cpp | 2 +- installerbuilder/libinstaller/qtpatch.cpp | 28 +++-- installerbuilder/libinstaller/qtpatchoperation.cpp | 6 +- .../registerdocumentationoperation.cpp | 4 +- .../libinstaller/setdemospathonqtoperation.cpp | 8 +- .../libinstaller/setexamplespathonqtoperation.cpp | 8 +- .../setimportspathonqtcoreoperation.cpp | 15 ++- .../libinstaller/setpathonqtcoreoperation.cpp | 15 ++- .../setpluginpathonqtcoreoperation.cpp | 18 ++-- .../updatecreatorsettingsfrom21to22operation.cpp | 12 +-- installerbuilder/libinstaller/updater.cpp | 5 +- tools/extractbinarydata/main.cpp | 6 +- 35 files changed, 268 insertions(+), 308 deletions(-) diff --git a/examples/downloadspeed/main.cpp b/examples/downloadspeed/main.cpp index f4e694c33..2161442aa 100644 --- a/examples/downloadspeed/main.cpp +++ b/examples/downloadspeed/main.cpp @@ -76,12 +76,12 @@ public slots: void downloadSpeed(qint64 speed) { - qDebug() << "Download speed: " << format(speed) + "/sec"; + qDebug() << "Download speed:" << format(speed) + "/sec"; } void downloadProgress(double progress) { - qDebug() << "Progress: " << progress; + qDebug() << "Progress:" << progress; } void estimatedDownloadTime(int time) @@ -112,7 +112,7 @@ public slots: if (s >= 0 && minutes.isEmpty()) seconds = QString::number(s) + (s < 2 ? " second" : " seconds"); - qDebug() << days + hours + minutes + seconds + tr(" remaining."); + qDebug() << days + hours + minutes + seconds + tr("remaining."); } void downloadStatus(const QString &status) @@ -122,7 +122,7 @@ public slots: void downloadProgress(qint64 bytesReceived, qint64 bytesToReceive) { - qDebug() << "Bytes received: " << bytesReceived << ", Bytes to receive: " << bytesToReceive; + qDebug() << "Bytes received:" << bytesReceived << ", Bytes to receive:" << bytesToReceive; } private: diff --git a/installerbuilder/binarycreator/binarycreator.cpp b/installerbuilder/binarycreator/binarycreator.cpp index 786abef09..96a1b2865 100644 --- a/installerbuilder/binarycreator/binarycreator.cpp +++ b/installerbuilder/binarycreator/binarycreator.cpp @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include #include @@ -231,7 +231,7 @@ static int assemble(Input input, const QString &configdir) appendFileData(&out, &exe); const qint64 dataBlockStart = out.pos(); - verbose() << "Data block starts at " << dataBlockStart << std::endl; + qDebug() << "Data block starts at" << dataBlockStart; // append our self created resource file QFile res(input.binaryResourcePath); @@ -263,8 +263,8 @@ static int assemble(Input input, const QString &configdir) input.componentIndexSegment = Range::fromStartAndEnd(compIndexStart, out.pos() - dataBlockStart); - verbose() << "Component index: [" << input.componentIndexSegment.start() << ":" - << input.componentIndexSegment.end() << "]" << std::endl; + qDebug("Component index: [%llu:%llu]", input.componentIndexSegment.start(), + input.componentIndexSegment.end()); appendInt64Range(&out, input.componentIndexSegment); foreach (const Range &range, input.resourcePos) appendInt64Range(&out, range); @@ -297,7 +297,7 @@ static int assemble(Input input, const QString &configdir) bundleBackup.release(); if (createDMG) { - verbose() << "creating a DMG disk image..."; + qDebug() << "creating a DMG disk image..."; // no error handling as this is not fatal const QString mkdmgscript = QDir::temp().absoluteFilePath(QLatin1String("mkdmg.sh")); QFile::copy(QLatin1String(":/resources/mkdmg.sh"), mkdmgscript); @@ -306,7 +306,7 @@ static int assemble(Input input, const QString &configdir) p.start(mkdmgscript, QStringList() << QFileInfo(out.fileName()).baseName() << bundle); p.waitForFinished(); QFile::remove(mkdmgscript); - verbose() << "done." << mkdmgscript << std::endl; + qDebug() << "done." << mkdmgscript; } #endif @@ -449,7 +449,7 @@ static QString createMetaDataDirectory(const PackageInfoVector &packages, const if (next.contains("/.")) // skip files that are in directories starting with a point continue; - verbose() << " Found configuration file: " << next << std::endl; + qDebug() << " Found configuration file: " << next; const QFileInfo sourceFileInfo(next); const QString source = sourceFileInfo.absoluteFilePath(); const QFileInfo targetFileInfo(configCopy, QFileInfo(next).fileName()); @@ -471,7 +471,7 @@ static QString createMetaDataDirectory(const PackageInfoVector &packages, const QDomElement doc = dom.documentElement(); QDomElement privateKey = doc.elementsByTagName(QLatin1String("PrivateKey")).item(0).toElement(); if (!privateKey.isNull()) { - verbose() << " It contains the RSA private key, removing it..."; + qDebug() << " It contains the RSA private key, removing it..."; if (doc.removeChild(privateKey).isNull()) throw Error(QObject::tr("Could not remove the private key from config.xml")); } @@ -514,7 +514,7 @@ static QString createMetaDataDirectory(const PackageInfoVector &packages, const openForWrite(&configXml, configXml.fileName()); QTextStream stream(&configXml); dom.save(stream, 4); - verbose() << " done." << std::endl; + qDebug() << " done."; } } return metapath; @@ -642,7 +642,7 @@ int main(int argc, char **argv) if (configDir.isEmpty()) return printErrorAndUsageAndExit(QObject::tr("Error: No configuration directory selected.")); - verbose() << "Parsed arguments, ok." << std::endl; + qDebug() << "Parsed arguments, ok."; try { const PackageInfoVector packageList = createListOfPackages(components, packagesDirectory, !nodeps); @@ -682,7 +682,7 @@ int main(int argc, char **argv) // now put the packages into the components section of the binary: for (PackageInfoVector::const_iterator it = packages.begin(); it != packages.end(); ++it) { - verbose() << "Creating component info for " << it->name << std::endl; + qDebug() << "Creating component info for" << it->name; Component comp; comp.setName(it->name.toUtf8()); @@ -691,11 +691,11 @@ int main(int argc, char **argv) .entryInfoList(QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files); foreach (const QFileInfo &archive, archives) { const QSharedPointer arch(new Archive(archive.absoluteFilePath())); - verbose() << " Appending " << archive.filePath() << " (" << arch->size() << " bytes)" - << std::endl; + qDebug() << QString::fromLatin1(" Appending %1 (%2 bytes)") + .arg(archive.filePath(), QString::number(arch->size())); comp.appendArchive(arch); if (!privateKey.isEmpty()) { - verbose() << " Appending a RSA signature..." << std::endl; + qDebug() << " Appending a RSA signature..."; const QByteArray signature = crypto.sign(arch.data()); if (signature.isEmpty()) throw Error(QObject::tr("Could not create a RSA signature")); @@ -704,8 +704,8 @@ int main(int argc, char **argv) throw Error(QObject::tr("Created RSA signature could not be verified. Is " "the given public key wrong?")); } - verbose() << " Appending " << archive.fileName() << ".sig (" - << signature.size() << " bytes)" << std::endl; + qDebug() << QString::fromLatin1(" Appending %1.sig (%2 bytes)") + .arg(archive.fileName(), signature.size()); const QSharedPointer sigArch(new Archive(arch->name() + ".sig", signature)); comp.appendArchive(sigArch); } @@ -713,11 +713,11 @@ int main(int argc, char **argv) input.components.insertComponent(comp); } - verbose() << "Creating the binary" << std::endl; + qDebug() << "Creating the binary"; const int result = assemble(input, configDir); // cleanup - verbose() << "Cleaning up..." << std::endl; + qDebug() << "Cleaning up..."; QFile::remove(input.binaryResourcePath); foreach (const QString &resource, input.binaryResources) QFile::remove(resource); diff --git a/installerbuilder/common/binaryformat.cpp b/installerbuilder/common/binaryformat.cpp index a8710ca27..812df0d62 100644 --- a/installerbuilder/common/binaryformat.cpp +++ b/installerbuilder/common/binaryformat.cpp @@ -895,7 +895,7 @@ BinaryContent BinaryContent::readFromBinary(const QString &path) } catch (const Error &error) { // this seems to be an unsupported dat file, try to read from original binary c.m_binaryFile.clear(); - verbose() << error.message(); + qDebug() << error.message(); } } else { c.m_binaryFile.clear(); @@ -925,11 +925,14 @@ BinaryLayout BinaryContent::readBinaryLayout(QIODevice *const file, qint64 cooki layout.indexSize = indexSize + sizeof(qint64); layout.endOfData = file->pos(); - verbose() << "Operations start: "<< layout.operationsStart << "; " << "Operations end: " - << layout.operationsEnd << "; " << "Resource count: " << layout.resourceCount << "; " - << "Data block size: " << layout.dataBlockSize << "; " << "Magic marker: " - << layout.magicMarker << "; " << "Magic cookie: " << layout.magicCookie << "; " - << "Index size: " << layout.indexSize << "; " << "End of data: " << layout.endOfData << std::endl; + qDebug() << "Operations start:" << layout.operationsStart; + qDebug() << "Operations end:" << layout.operationsEnd; + qDebug() << "Resource count:" << layout.resourceCount; + qDebug() << "Data block size:" << layout.dataBlockSize; + qDebug() << "Magic marker:" << layout.magicMarker; + qDebug() << "Magic cookie:" << layout.magicCookie; + qDebug() << "Index size:" << layout.indexSize; + qDebug() << "End of data:" << layout.endOfData; const qint64 resourceOffsetAndLengtSize = 2 * sizeof(qint64); const qint64 dataBlockStart = layout.endOfData - layout.dataBlockSize; @@ -959,7 +962,7 @@ void BinaryContent::readBinaryData(BinaryContent &content, const QSharedPointer< throw Error(QObject::tr("Could not seek to operation list")); const qint64 operationsCount = retrieveInt64(file.data()); - verbose() << "Number of operations: " << operationsCount << std::endl; + qDebug() << "Number of operations:" << operationsCount; for (int i = 0; i < operationsCount; ++i) { const QString name = retrieveString(file.data()); @@ -989,14 +992,14 @@ void BinaryContent::readBinaryData(BinaryContent &content, const QSharedPointer< if (isVerbose()) { const QVector components = content.m_components.components(); - verbose() << "Number of components loaded: " << components.count() << std::endl; + qDebug() << "Number of components loaded:" << components.count(); foreach (const QInstallerCreator::Component &component, components) { const QVector > archives = component.archives(); - verbose() << "Loaded component " << component.name() << " containing " << archives.count() - << " archives:" << std::endl; + qDebug() << "Loaded component" << component.name() << "containing" << archives.count() + << "archives:"; foreach (const QSharedPointer &archive, archives) { - verbose() << " Archive name: " << archive->name() << ", Archive size: " - << archive->size() << " bytes" << std::endl; + qDebug().nospace() << " Archive name:" << archive->name() << ", Archive size:" + << archive->size() << "bytes"; } } } diff --git a/installerbuilder/common/fileutils.cpp b/installerbuilder/common/fileutils.cpp index de7e4e1cf..de13a18fe 100644 --- a/installerbuilder/common/fileutils.cpp +++ b/installerbuilder/common/fileutils.cpp @@ -33,7 +33,6 @@ #include "fileutils.h" #include -#include #include #include @@ -41,6 +40,7 @@ #include #include #include +#include #include @@ -306,7 +306,7 @@ void QInstaller::removeSystemGeneratedFiles(const QString &path) void QInstaller::copyDirectoryContents(const QString &sourceDir, const QString &targetDir) { - verbose() << "Copying " << sourceDir << " to " << targetDir << std::endl; + qDebug() << "Copying" << sourceDir << "to" << targetDir; Q_ASSERT(QFileInfo(sourceDir).isDir()); Q_ASSERT(!QFileInfo(targetDir).exists() || QFileInfo(targetDir).isDir()); if (!QDir().mkpath(targetDir)) @@ -331,7 +331,7 @@ void QInstaller::copyDirectoryContents(const QString &sourceDir, const QString & void QInstaller::moveDirectoryContents(const QString &sourceDir, const QString &targetDir) { - verbose() << "Moving " << sourceDir << " to " << targetDir << std::endl; + qDebug() << "Moving" << sourceDir << "to" << targetDir; Q_ASSERT(QFileInfo(sourceDir).isDir()); Q_ASSERT(!QFileInfo(targetDir).exists() || QFileInfo(targetDir).isDir()); if (!QDir().mkpath(targetDir)) @@ -406,7 +406,7 @@ QString QInstaller::createTemporaryDirectory(const QString &templ) if (!f.open()) throw Error(QObject::tr("Could not create temporary folder for template %1: %2").arg(t, f.errorString())); const QString path = f.fileName() + QLatin1String("meta"); - verbose() << "Creating meta data directory at " << path << std::endl; + qDebug() << "Creating meta data directory at" << path; QInstaller::mkpath(path); return path; diff --git a/installerbuilder/common/repositorygen.cpp b/installerbuilder/common/repositorygen.cpp index 4d85d1329..e71796c6d 100644 --- a/installerbuilder/common/repositorygen.cpp +++ b/installerbuilder/common/repositorygen.cpp @@ -34,7 +34,6 @@ #include #include -#include #include #include @@ -61,24 +60,23 @@ QT_END_NAMESPACE static QVector collectAvailablePackages(const QString &packagesDirectory) { - verbose() << "Collecting information about available packages..." << std::endl; + qDebug() << "Collecting information about available packages..."; QVector< PackageInfo > dict; const QFileInfoList entries = QDir(packagesDirectory) .entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot); for (QFileInfoList::const_iterator it = entries.begin(); it != entries.end(); ++it) { - verbose() << " found subdirectory \"" << it->fileName() << "\""; + qDebug() << QString::fromLatin1(" found subdirectory \"%1\"").arg(it->fileName()); //because the filter is QDir::Dirs - filename means the name of the subdirectory if (it->fileName().contains(QLatin1Char('-'))) { - verbose() << ", but it contains \"-\" which is not allowed, because it is used as the seperator between the component name and the version number internally." - << std::endl; + qDebug() << " , but it contains \"-\" which is not allowed, because it is used as the seperator" + "between the component name and the version number internally."; throw QInstaller::Error(QObject::tr("Component %1 can't contain \"-\"").arg(it->fileName())); } QFile file(QString::fromLatin1("%1/meta/package.xml").arg(it->filePath())); if (!file.exists()) { - verbose() << ", but it contains no package information (meta/package.xml missing)" - << std::endl; + qDebug() << " - but it contains no package information (meta/package.xml missing)"; throw QInstaller::Error(QObject::tr("Component %1 does not contain a package " "description.").arg(it->fileName())); } @@ -90,8 +88,8 @@ static QVector collectAvailablePackages(const QString &packagesDire int errorLine = 0; int errorColumn = 0; if (!doc.setContent(&file, &errorMessage, &errorLine, &errorColumn)) { - verbose() << ", but it's package description is invalid. Error at " << errorLine - << ", " << errorColumn << ": " << errorMessage << std::endl; + qDebug() << QString::fromLatin1(" - but it's package description is invalid. Error at line: %2, column: %3 -> %4").arg( + QString::number(errorLine), QString::number(errorColumn), errorMessage); throw QInstaller::Error(QObject::tr("Component package description for %1 is invalid. " "Error at line: %2, column: %3 -> %4").arg(it->fileName(), QString::number(errorLine), QString::number(errorColumn), errorMessage)); @@ -100,7 +98,6 @@ static QVector collectAvailablePackages(const QString &packagesDire const QString name = doc.firstChildElement(QLatin1String("Package")) .firstChildElement(QLatin1String("Name")).text(); if (name != it->fileName()) { - verbose() << std::endl; throw QInstaller::Error(QObject::tr("Component folder name must match component name: " "\"%1\" in %2/").arg(name, it->fileName())); } @@ -110,7 +107,6 @@ static QVector collectAvailablePackages(const QString &packagesDire info.version = doc.firstChildElement(QLatin1String("Package")). firstChildElement(QLatin1String("Version")).text(); if (!QRegExp(QLatin1String("[0-9]+((\\.|-)[0-9]+)*")).exactMatch(info.version)) { - verbose() << std::endl; throw QInstaller::Error(QObject::tr("Component version for %1 is invalid! %2") .arg(it->fileName(), info.version)); } @@ -120,14 +116,11 @@ static QVector collectAvailablePackages(const QString &packagesDire info.directory = it->filePath(); dict.push_back(info); - verbose() << ", it provides the package " < calculateNeededPackages(const QStringList &component recursion = true; - verbose() << "Trying to find a package for name " << *it << "... "; + qDebug() << "Trying to find a package for name" << *it << "... "; const PackageInfo info = findMatchingPackage(*it, available); if (info.name.isEmpty()) { - verbose() << "Not found :-o" << std::endl; - verbose() << " Couldn't find package for component " << *it << " bailing out..." - << std::endl; + qDebug() << "Not found :-o"; + qDebug() << " Couldn't find package for component " << *it << " bailing out..."; throw Error(QObject::tr("Couldn't find package for component %1").arg(*it)); } - verbose() << "Found." << std::endl; + qDebug() << "Found."; if (!result.contains(info)) { result.push_back(info); @@ -231,10 +223,11 @@ static QVector calculateNeededPackages(const QStringList &component QVector dependencies; if (!info.dependencies.isEmpty()) { - verbose() << " It depends on:" << std::endl; + qDebug() << " It depends on:"; for (QStringList::const_iterator dep = info.dependencies.begin(); - dep != info.dependencies.end(); ++dep) - verbose() << " " << *dep << std::endl; + dep != info.dependencies.end(); ++dep) { + qDebug() << " " << *dep; + } dependencies += calculateNeededPackages(info.dependencies, available); } // append all child items, as this package was requested explicitely @@ -311,7 +304,7 @@ void QInstaller::compressMetaDirectories(const QString &configDir, const QString // if we have a private key, sign the meta.7z file if (!settings.privateKey().isEmpty()) { - verbose() << "Adding a RSA signature to " << finalTarget << std::endl; + qDebug() << "Adding a RSA signature to" << finalTarget; const QByteArray signature = crypto.sign(finalTarget); QFile sigFile(finalTarget + QLatin1String(".sig")); if (!sigFile.open(QIODevice::WriteOnly)) { @@ -330,7 +323,7 @@ void QInstaller::generateMetaDataDirectory(const QString &outDir, const QString QString metapath = outDir; if (QFileInfo(metapath).isRelative()) metapath = QDir::cleanPath(QDir::current().absoluteFilePath(metapath)); - verbose() << "Generating meta data..." << std::endl; + qDebug() << "Generating meta data..."; if (!QFile::exists(metapath)) QInstaller::mkpath(metapath); @@ -357,8 +350,8 @@ void QInstaller::generateMetaDataDirectory(const QString &outDir, const QString for (QVector::const_iterator it = packages.begin(); it != packages.end(); ++it) { const QString packageXmlPath = QString::fromLatin1("%1/meta/package.xml").arg(it->directory); - verbose() << " Generating meta data for package " << it->name << " using " - << packageXmlPath << std::endl;; + qDebug() << QString::fromLatin1(" Generating meta data for package %1 using %2").arg( + it->name, packageXmlPath); // remove existing entry for thes component from existing Updates.xml const QDomNodeList packageNodes = root.childNodes(); @@ -482,15 +475,15 @@ void QInstaller::generateMetaDataDirectory(const QString &outDir, const QString requiresAdminRightsElement.appendChild(doc.createTextNode("true")); } - verbose() << " Copying associated script " << script << " into the meta package..."; + qDebug() << " Copying associated script" << script << "into the meta package..."; QString fromLocation(QString::fromLatin1("%1/meta/%2").arg(it->directory, script)); QString toLocation(QString::fromLatin1("%1/%2/%3").arg(metapath, it->name, script)); if (!QFile::copy(fromLocation, toLocation)) { - verbose() << "failed!" << std::endl; + qDebug() << "failed!"; throw Error(QObject::tr("Could not copy the script (%1) to its target location (%2)") .arg(fromLocation, toLocation)); } else { - verbose() << std::endl; + qDebug() << " done."; } } @@ -510,16 +503,16 @@ void QInstaller::generateMetaDataDirectory(const QString &outDir, const QString } for (QStringList::const_iterator ui = uis.begin(); ui != uis.end(); ++ui) { - verbose() << " Copying associated user interface " << *ui << " into the meta " + qDebug() << " Copying associated user interface " << *ui << " into the meta " "package..."; userinterfaces.push_back(*ui); if (!QFile::copy(QString::fromLatin1("%1/meta/%2").arg(it->directory, *ui), QString::fromLatin1("%1/%2/%3").arg(metapath, it->name, *ui))) { - verbose() << "failed!" << std::endl; + qDebug() << "failed!"; throw Error(QObject::tr("Could not copy the UI file %1 to its target location " "(%2)").arg(*ui, it->name)); } else { - verbose() << std::endl; + qDebug() << "done"; } } } @@ -545,16 +538,16 @@ void QInstaller::generateMetaDataDirectory(const QString &outDir, const QString } for (QStringList::const_iterator qm = qms.begin(); qm != qms.end(); ++qm) { - verbose() << " Copying associated translation " << *qm << " into the meta " + qDebug() << " Copying associated translation " << *qm << " into the meta " "package..."; translations.push_back(*qm); if (!QFile::copy(QString::fromLatin1("%1/meta/%2").arg(it->directory, *qm), QString::fromLatin1("%1/%2/%3").arg(metapath, it->name, *qm))) { - verbose() << "failed!" << std::endl; + qDebug() << "failed!"; throw Error(QObject::tr("Could not copy the translation %1 to its target " "location (%2)").arg(*qm, it->name)); } else { - verbose() << std::endl; + qDebug() << "done"; } } } @@ -578,15 +571,15 @@ void QInstaller::generateMetaDataDirectory(const QString &outDir, const QString "copying license files of %2").arg(licenseFile, it->name)); } - verbose() << " Copying associated license file " << licenseFile << " into " + qDebug() << " Copying associated license file " << licenseFile << " into " "the meta package..."; if (!QFile::copy(sourceFile, QString::fromLatin1("%1/%2/%3") .arg(metapath, it->name, licenseFile))) { - verbose() << "failed!" << std::endl; + qDebug() << "failed!"; throw Error(QObject::tr("Could not copy the license file %1 to its " "target location (%2)").arg(licenseFile, it->name)); } else { - verbose() << std::endl; + qDebug() << "done."; } } } @@ -621,16 +614,18 @@ QVector QInstaller::createListOfPackages(const QStringList &compone //we don't want to have two different dependency checking codes (installer itself and repgen here) //so because they have two different behaviours we deactivate it here for now - verbose() << "Calculating dependencies for selected packages..." << std::endl; + qDebug() << "Calculating dependencies for selected packages..."; QVector needed = calculateNeededPackages(components, availablePackageInfos, addDependencies); - verbose() << "The following packages will be placed in the installer:" << std::endl; - foreach (const PackageInfo &i, needed) { - verbose() << " " << i.name; - if (!i.version.isEmpty()) - verbose() << "-" << i.version; - verbose() << std::endl; - } + qDebug() << "The following packages will be placed in the installer:"; + { + QDebug mergedDebugOutput = qDebug().nospace(); + foreach (const PackageInfo &i, needed) { + mergedDebugOutput << " " << i.name; + if (!i.version.isEmpty()) + mergedDebugOutput << "-" << i.version; + } + } //to write mergedDebugOutput // now just append the virtual parents (not including all their descendants!) // like... if com.nokia.sdk.qt.qtcore was passed, even com.nokia.sdk.qt will show up in the tree @@ -647,8 +642,7 @@ QVector QInstaller::createListOfPackages(const QStringList &compone if (info.name.isEmpty()) info = findMatchingPackage(id, availablePackageInfos); if (!info.name.isEmpty() && !allPackagesHavePrefix(needed, id) && !needed.contains(info)) { - verbose() << "Adding " << info.name << " as it is the virtual parent item of " - << name << std::endl; + qDebug() << QString::fromLatin1("Adding %1 as it is the virtual parent item of %2").arg(info.name, name); needed.push_back(info); } id = id.section(QChar::fromLatin1('.'), 0, -2); @@ -670,7 +664,7 @@ QMap QInstaller::buildPathToVersionMap(const QVector repositories(const QStringList &arguments, const int ind QStringList items = arguments.at(index).split(QLatin1Char(',')); foreach (const QString &item, items) { set.insert(Repository(item, false)); - verbose() << "Adding custom repository:" << item << std::endl; + qDebug() << "Adding custom repository:" << item; } } else { std::cerr << "No repository specified" << std::endl; @@ -229,14 +229,14 @@ int main(int argc, char *argv[]) } if (QInstaller::isVerbose()) { - verbose() << VERSION << std::endl; - verbose() << "Arguments: " << args << std::endl; - verbose() << "Resource tree before loading the in-binary resource: " << std::endl; + qDebug() << VERSION; + qDebug() << "Arguments:" << args; + qDebug() << "Resource tree before loading the in-binary resource:"; QDir dir(QLatin1String(":/")); foreach (const QString &i, dir.entryList()) { const QByteArray ba = i.toUtf8(); - verbose() << " :/" << ba.constData() << std::endl; + qDebug().nospace() << " :/" << ba.constData(); } } @@ -262,15 +262,15 @@ int main(int argc, char *argv[]) } if (QInstaller::isVerbose()) { - verbose() << "Resource tree after loading the in-binary resource: " << std::endl; + qDebug() << "Resource tree after loading the in-binary resource:"; QDir dir = QDir(QLatin1String(":/")); foreach (const QString &i, dir.entryList()) - verbose() << QString::fromLatin1(" :/%1").arg(i) << std::endl; + qDebug() << QString::fromLatin1(" :/%1").arg(i); dir = QDir(QLatin1String(":/metadata/")); foreach (const QString &i, dir.entryList()) - verbose() << QString::fromLatin1(" :/metadata/%1").arg(i) << std::endl; + qDebug() << QString::fromLatin1(" :/metadata/%1").arg(i); } QString controlScript; diff --git a/installerbuilder/installerbase/installerbase_p.cpp b/installerbuilder/installerbase/installerbase_p.cpp index 07d9faf6d..af0555b7a 100644 --- a/installerbuilder/installerbase/installerbase_p.cpp +++ b/installerbuilder/installerbase/installerbase_p.cpp @@ -215,7 +215,7 @@ int InstallerBase::replaceMaintenanceToolBinary(QStringList arguments) url = QLatin1String("file:///") + url.toString(); m_downloader.reset(FileDownloaderFactory::instance().create(url.scheme())); if (m_downloader.isNull()) { - verbose() << tr("Scheme not supported: %1 (%2)").arg(url.scheme(), url.toString()) << std::endl; + qDebug() << QString::fromLatin1("Scheme not supported: %1 (%2)").arg(url.scheme(), url.toString()); return EXIT_FAILURE; } m_downloader->setUrl(url); @@ -239,8 +239,8 @@ int InstallerBase::replaceMaintenanceToolBinary(QStringList arguments) } if (!m_downloader->isDownloaded()) { - verbose() << tr("Could not download file %s: . Error: %s.").arg(m_downloader->url().toString(), - m_downloader->errorString()) << std::endl; + qDebug() << QString::fromLatin1("Could not download file %1: . Error: %2.").arg( + m_downloader->url().toString(), m_downloader->errorString()); return EXIT_FAILURE; } @@ -249,17 +249,20 @@ int InstallerBase::replaceMaintenanceToolBinary(QStringList arguments) if (archive.open(QIODevice::ReadOnly)) { try { Lib7z::extractArchive(&archive, QDir::tempPath()); - if (!archive.remove()) - verbose() << tr("Could not delete file %s: %s.").arg(target, archive.errorString()); + if (!archive.remove()) { + qDebug() << QString::fromLatin1("Could not delete file %1: %2.").arg( + target, archive.errorString()); + } } catch (const Lib7z::SevenZipException& e) { - verbose() << tr("Error while extracting %1: %2.").arg(target, e.message()); + qDebug() << QString::fromLatin1("Error while extracting %1: %2.").arg(target, e.message()); return EXIT_FAILURE; } catch (...) { - verbose() << tr("Unknown exception caught while extracting %1.").arg(target); + qDebug() << QString::fromLatin1("Unknown exception caught while extracting %1.").arg(target); return EXIT_FAILURE; } } else { - verbose() << tr("Could not open %1 for reading: %2.").arg(target, archive.errorString()); + qDebug() << QString::fromLatin1("Could not open %1 for reading: %2.").arg( + target, archive.errorString()); return EXIT_FAILURE; } #ifndef Q_OS_WIN @@ -275,7 +278,7 @@ int InstallerBase::replaceMaintenanceToolBinary(QStringList arguments) writeMaintenanceBinary(arguments.value(0), &installerBase, installerBase.size()); deferredRename(arguments.value(0) + QLatin1String(".new"), arguments.value(0)); } catch (const QInstaller::Error &error) { - verbose() << error.message() << std::endl; + qDebug() << error.message(); return EXIT_FAILURE; } @@ -336,27 +339,27 @@ void InstallerBase::showVersion(const QString &version) void InstallerBase::downloadStarted() { m_downloadFinished = false; - verbose() << tr("Download started! Source: ") << m_downloader->url().toString() << tr(", Target: ") - << m_downloader->downloadedFileName() << std::endl; + qDebug() << QString::fromLatin1("Download started! Source: %1, Target: %2").arg( + m_downloader->url().toString(), m_downloader->downloadedFileName()); } void InstallerBase::downloadFinished() { m_downloadFinished = true; - verbose() << tr("Download finished! Source: ") << m_downloader->url().toString() << tr(", Target: ") - << m_downloader->downloadedFileName() << std::endl; + qDebug() << QString::fromLatin1("Download finished! Source: %1, Target: %2").arg( + m_downloader->url().toString(), m_downloader->downloadedFileName()); } void InstallerBase::downloadProgress(double progress) { - verbose() << tr("Progress: ") << progress << std::endl; + qDebug() << "Progress: " << progress; } void InstallerBase::downloadAborted(const QString &error) { m_downloadFinished = true; - verbose() << tr("Download aborted! Source: ") << m_downloader->url().toString() << tr(", Target: ") - << m_downloader->downloadedFileName() << tr(", Error: ") << error << std::endl; + qDebug() << QString::fromLatin1("Download aborted! Source: %1, Target: %2, Error: %3").arg( + m_downloader->url().toString(), m_downloader->downloadedFileName(), error); } diff --git a/installerbuilder/installerbase/tabcontroller.cpp b/installerbuilder/installerbase/tabcontroller.cpp index 8276e37d1..b0234e93f 100644 --- a/installerbuilder/installerbase/tabcontroller.cpp +++ b/installerbuilder/installerbase/tabcontroller.cpp @@ -34,7 +34,6 @@ #include "installerbasecommons.h" #include "settingsdialog.h" -#include #include #include @@ -119,8 +118,7 @@ int TabController::init() d->m_init = true; // this should called as early as possible, to handle error message boxes for example if (!d->m_controlScript.isEmpty()) { - QInstaller::verbose() << "Non-interactive installation using script: " - << qPrintable(d->m_controlScript) << std::endl; + qDebug() << "Non-interactive installation using script:" << d->m_controlScript; d->m_gui->loadControlScript(d->m_controlScript); QScriptEngine *engine = d->m_gui->controlScriptEngine(); diff --git a/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterupdatefinder.cpp b/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterupdatefinder.cpp index f1e73ef79..a08d481b7 100644 --- a/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterupdatefinder.cpp +++ b/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterupdatefinder.cpp @@ -552,21 +552,22 @@ void UpdateFinder::Private::createUpdateObjects(const UpdateSourceInfo &sourceIn if (info.data.contains(QLatin1String("RequiredCompatLevel")) && info.data.value(QLatin1String("RequiredCompatLevel")).toInt() != application->compatLevel()) { - qDebug() << "Update \"" << info.data.value( QLatin1String( "Name" ) ).toString() << "\" at \"" - << sourceInfo.name << "\"(\"" << sourceInfo.url.toString() << "\") requires a different compat level"; + qDebug().nospace() << "Update \"" << info.data.value( QLatin1String( "Name" ) ).toString() + << "\" at \"" << sourceInfo.name << "\"(\"" << sourceInfo.url.toString() + << "\") requires a different compat level"; continue; // Compatibility level mismatch } // If another update of the same name exists, then use the update coming from // a higher priority. if (!checkForUpdatePriority(sourceInfo, info)) { - qDebug() << "Skipping Update \"" - << info.data.value(QLatin1String("Name")).toString() - << "\" from \"" - << sourceInfo.name - << "\"(\"" - << sourceInfo.url.toString() - << "\") because an update with the same name was found from a higher priority location"; + qDebug().nospace() << "Skipping Update \"" + << info.data.value(QLatin1String("Name")).toString() + << "\" from \"" + << sourceInfo.name + << "\"(\"" + << sourceInfo.url.toString() + << "\") because an update with the same name was found from a higher priority location"; continue; } diff --git a/installerbuilder/libinstaller/component.cpp b/installerbuilder/libinstaller/component.cpp index e64bf24b8..b0284286e 100644 --- a/installerbuilder/libinstaller/component.cpp +++ b/installerbuilder/libinstaller/component.cpp @@ -34,7 +34,6 @@ #include "common/errors.h" #include "common/fileutils.h" -#include "common/utils.h" #include "fsengineclient.h" #include "lib7z_facade.h" #include "packagemanagercore.h" @@ -689,7 +688,7 @@ void Component::addDownloadableArchive(const QString &path) Q_ASSERT(isFromOnlineRepository()); const QString versionPrefix = value(scRemoteVersion); - verbose() << "addDownloadable " << path << std::endl; + qDebug() << "addDownloadable" << path; d->m_downloadableArchives.append(versionPrefix + path); } @@ -935,8 +934,7 @@ bool Component::forcedInstallation() const void Component::setSelected(bool selected) { Q_UNUSED(selected) - verbose() << Q_FUNC_INFO << qPrintable(QString(QLatin1String("on \"%1\" is deprecated!!!")).arg( - d->m_componentName)) << std::endl; + qDebug() << Q_FUNC_INFO << QString::fromLatin1("on \"%1\" is deprecated!!!").arg(d->m_componentName); } void Component::addDependency(const QString &newDependency) @@ -1000,7 +998,7 @@ bool Component::isAutoDependOn(const QSet &componentsToInstall) const if (valueFromScript.isValid()) return valueFromScript.toBool(); - verbose() << "value from script is not valid " << std::endl; + qDebug() << "value from script is not valid"; return false; } @@ -1039,7 +1037,7 @@ bool Component::isDefault() const } if (valueFromScript.isValid()) return valueFromScript.toBool(); - verbose() << "value from script is not valid " << std::endl; + qDebug() << "value from script is not valid"; return false; } diff --git a/installerbuilder/libinstaller/createshortcutoperation.cpp b/installerbuilder/libinstaller/createshortcutoperation.cpp index 95bca56bd..1c7e35039 100644 --- a/installerbuilder/libinstaller/createshortcutoperation.cpp +++ b/installerbuilder/libinstaller/createshortcutoperation.cpp @@ -37,7 +37,6 @@ #include "createshortcutoperation.h" #include "common/errors.h" #include "common/fileutils.h" -#include "common/utils.h" #include #include @@ -192,9 +191,8 @@ bool CreateShortcutOperation::undoOperation() const QString& linkLocation = args.at(1); // first remove the link - if (!deleteFileNowOrLater(linkLocation)) { - verbose() << QString(QLatin1String("Can't delete: %1")).arg(linkLocation) << std::endl; - } + if (!deleteFileNowOrLater(linkLocation)) + qDebug() << "Can't delete:" << linkLocation; const QString linkPath = QFileInfo(linkLocation).absolutePath(); @@ -203,7 +201,7 @@ bool CreateShortcutOperation::undoOperation() QString possibleToDeleteDir = QDir::homePath() + QStringList(pathParts.mid(0, i)).join(QLatin1String("/")); removeSystemGeneratedFiles(possibleToDeleteDir); if (!possibleToDeleteDir.isEmpty() && QDir().rmdir(possibleToDeleteDir)) - verbose() << QString(QLatin1String("deleted directory: %1")).arg(possibleToDeleteDir) << std::endl; + qDebug() << "Deleted directory:" << possibleToDeleteDir; else break; } diff --git a/installerbuilder/libinstaller/downloadarchivesjob.cpp b/installerbuilder/libinstaller/downloadarchivesjob.cpp index f0827dbe3..205443a99 100644 --- a/installerbuilder/libinstaller/downloadarchivesjob.cpp +++ b/installerbuilder/libinstaller/downloadarchivesjob.cpp @@ -33,7 +33,6 @@ #include "downloadarchivesjob.h" #include "common/binaryformatenginehandler.h" -#include "common/utils.h" #include "component.h" #include "cryptosignatureverifier.h" #include "messageboxhandler.h" diff --git a/installerbuilder/libinstaller/elevatedexecuteoperation.cpp b/installerbuilder/libinstaller/elevatedexecuteoperation.cpp index 776a6caf1..a7962c686 100644 --- a/installerbuilder/libinstaller/elevatedexecuteoperation.cpp +++ b/installerbuilder/libinstaller/elevatedexecuteoperation.cpp @@ -33,11 +33,11 @@ #include "elevatedexecuteoperation.h" #include "environment.h" -#include "common/utils.h" #include "qprocesswrapper.h" -#include -#include +#include +#include +#include using namespace QInstaller; @@ -140,8 +140,7 @@ bool ElevatedExecuteOperation::Private::run(const QStringList &arguments) process = new QProcessWrapper(); if (!workingDirectory.isEmpty()) { process->setWorkingDirectory(workingDirectory); - QInstaller::verbose() << " ElevatedExecuteOperation setWorkingDirectory: " << workingDirectory - << std::endl; + qDebug() << "ElevatedExecuteOperation setWorkingDirectory:" << workingDirectory; } QProcessEnvironment penv; @@ -164,16 +163,14 @@ bool ElevatedExecuteOperation::Private::run(const QStringList &arguments) #ifdef Q_OS_WIN if (args.count() == 1) { process->setNativeArguments(args.front()); - QInstaller::verbose() << " ElevatedExecuteOperation setNativeArguments to start: " << args.front() - << std::endl; + qDebug() << "ElevatedExecuteOperation setNativeArguments to start:" << args.front(); process->start(QString(), QStringList()); } else #endif { process->start(args.front(), args.mid(1)); } - QInstaller::verbose() << args.front() << " started, arguments: " << QStringList(args.mid(1)) - .join(QLatin1String(" ")) << std::endl; + qDebug() << 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 @@ -234,12 +231,11 @@ void ElevatedExecuteOperation::Private::readProcessOutput() Q_ASSERT(process); Q_ASSERT(QThread::currentThread() == process->thread()); if (QThread::currentThread() != process->thread()) { - QInstaller::verbose() << Q_FUNC_INFO << QLatin1String(" can only be called from the same thread as " - "the process is.") << std::endl; + qDebug() << Q_FUNC_INFO << "can only be called from the same thread as the process is."; } const QByteArray output = process->readAll(); if (!output.isEmpty()) { - QInstaller::verbose() << QString::fromLocal8Bit(output) << std::endl; + qDebug() << output; emit q->outputTextChanged(QString::fromLocal8Bit(output)); } } diff --git a/installerbuilder/libinstaller/getrepositoriesmetainfojob.cpp b/installerbuilder/libinstaller/getrepositoriesmetainfojob.cpp index 63ceae278..184d26a15 100644 --- a/installerbuilder/libinstaller/getrepositoriesmetainfojob.cpp +++ b/installerbuilder/libinstaller/getrepositoriesmetainfojob.cpp @@ -32,10 +32,11 @@ **************************************************************************/ #include "getrepositoriesmetainfojob.h" -#include "common/utils.h" #include "getrepositorymetainfojob.h" #include "qinstallerglobal.h" +#include + using namespace KDUpdater; using namespace QInstaller; @@ -174,7 +175,7 @@ void GetRepositoriesMetaInfoJob::jobFinished(KDJob *j) if (job->error() == KDJob::Canceled || (job->error() >= KDJob::UserDefinedError && job->error() < QInstaller::UserIgnoreError)) { emit infoMessage(j, job->errorString()); - verbose() << job->errorString() << std::endl; + qDebug() << job->errorString(); emitFinishedWithError(job->error(), job->errorString()); return; } diff --git a/installerbuilder/libinstaller/getrepositorymetainfojob.cpp b/installerbuilder/libinstaller/getrepositorymetainfojob.cpp index f6bc0144b..41171fa87 100644 --- a/installerbuilder/libinstaller/getrepositorymetainfojob.cpp +++ b/installerbuilder/libinstaller/getrepositorymetainfojob.cpp @@ -34,7 +34,6 @@ #include "constants.h" #include "common/errors.h" -#include "common/utils.h" #include "cryptosignatureverifier.h" #include "lib7z_facade.h" #include "messageboxhandler.h" @@ -139,7 +138,7 @@ Repository GetRepositoryMetaInfoJob::repository() const void GetRepositoryMetaInfoJob::setRepository(const Repository &r) { m_repository = r; - verbose() << "Setting repository with URL : " << r.url().toString() << std::endl; + qDebug() << "Setting repository with URL:" << r.url().toString(); } int GetRepositoryMetaInfoJob::silentRetries() const @@ -356,7 +355,7 @@ void GetRepositoryMetaInfoJob::fetchNextMetaInfo() nextVersion = m_packageVersions.takeLast(); } - verbose() << "fetching metadata of " << next << " in version " << nextVersion << std::endl; + qDebug() << "fetching metadata of" << next << "in version" << nextVersion; bool online = true; if (m_repository.url().scheme().isEmpty()) diff --git a/installerbuilder/libinstaller/macrelocateqt.cpp b/installerbuilder/libinstaller/macrelocateqt.cpp index 551935dad..6aac7216e 100644 --- a/installerbuilder/libinstaller/macrelocateqt.cpp +++ b/installerbuilder/libinstaller/macrelocateqt.cpp @@ -31,10 +31,9 @@ ** **************************************************************************/ #include "macrelocateqt.h" - -#include "common/utils.h" #include "macreplaceinstallnamesoperation.h" +#include #include @@ -56,7 +55,7 @@ bool Relocator::apply(const QString &qtInstallDir, const QString &targetDir) m_errorMessage = QLatin1String("targetDir can't be empty"); return false; } - verbose() << "Relocator::apply(" << qtInstallDir << ")" << std::endl; + qDebug() << Q_FUNC_INFO << qtInstallDir; m_errorMessage.clear(); m_installDir.clear(); @@ -74,7 +73,7 @@ bool Relocator::apply(const QString &qtInstallDir, const QString &targetDir) //to get realy only the first subdirectory as an indicator like the old behaviour was till Mobility don't use this qt patch hack indicator = indicator.left(indicator.indexOf(QLatin1String("/"), 1)); - verbose() << "Relocator uses indicator: " << indicator << std::endl; + qDebug() << "Relocator uses indicator:" << indicator; QString replacement = targetDir; diff --git a/installerbuilder/libinstaller/macreplaceinstallnamesoperation.cpp b/installerbuilder/libinstaller/macreplaceinstallnamesoperation.cpp index ad8342b4a..8e7f38626 100644 --- a/installerbuilder/libinstaller/macreplaceinstallnamesoperation.cpp +++ b/installerbuilder/libinstaller/macreplaceinstallnamesoperation.cpp @@ -32,10 +32,10 @@ **************************************************************************/ #include "macreplaceinstallnamesoperation.h" -#include "common/utils.h" #include "qprocesswrapper.h" #include +#include #include @@ -61,7 +61,6 @@ bool MacReplaceInstallNamesOperation::performOperation() // 5. other directory containing frameworks // 6. ... - verbose() << arguments().join(QLatin1String(";")) << std::endl; if (arguments().count() < 3) { setError(InvalidArguments); setErrorString(tr("Invalid arguments in %0: %1 arguments given, 3 expected.").arg(name()) @@ -138,7 +137,7 @@ bool MacReplaceInstallNamesOperation::apply(const QString &indicator, const QStr void MacReplaceInstallNamesOperation::extractExecutableInfo(const QString &fileName, QString &frameworkId, QStringList &frameworks, QString &originalBuildDir) { - verbose() << "Relocator calling otool -l for " << fileName << std::endl; + qDebug() << "Relocator calling otool -l for" << fileName; QProcessWrapper otool; otool.start(QLatin1String("otool"), QStringList() << QLatin1String("-l") << fileName); if (!otool.waitForStarted()) { @@ -190,10 +189,10 @@ void MacReplaceInstallNamesOperation::extractExecutableInfo(const QString &fileN } if (originalBuildDir.endsWith(QLatin1Char('/'))) originalBuildDir.chop(1); - verbose() << "originalBuildDir is: " << originalBuildDir << std::endl; + qDebug() << "originalBuildDir is:" << originalBuildDir; } } - verbose() << "END - Relocator calling otool -l for " << fileName << std::endl; + qDebug() << "END - Relocator calling otool -l for" << fileName; } void MacReplaceInstallNamesOperation::relocateBinary(const QString &fileName) @@ -203,9 +202,8 @@ void MacReplaceInstallNamesOperation::relocateBinary(const QString &fileName) QString originalBuildDir; extractExecutableInfo(fileName, frameworkId, frameworks, originalBuildDir); - verbose() << "got following informations(fileName, frameworkId, frameworks, orginalBuildDir): " << std::endl; - verbose() << fileName << ", " << frameworkId << ", " << frameworks.join(QLatin1String("|")) << ", " - << originalBuildDir << std::endl; + qDebug() << QString::fromLatin1("got following informations(fileName: %1, frameworkId: %2, frameworks: %3," + "orginalBuildDir: %4)").arg(fileName, frameworkId, frameworks.join(QLatin1String("|")), originalBuildDir); QStringList args; if (frameworkId.contains(m_indicator) || QFileInfo(frameworkId).fileName() == frameworkId) { @@ -256,7 +254,7 @@ void MacReplaceInstallNamesOperation::relocateFramework(const QString &directory bool MacReplaceInstallNamesOperation::execCommand(const QString &cmd, const QStringList &args) { - verbose() << "Relocator::execCommand " << cmd << " " << args << std::endl; + qDebug() << Q_FUNC_INFO << cmd << " " << args; QProcessWrapper process; process.start(cmd, args); diff --git a/installerbuilder/libinstaller/operationrunner.cpp b/installerbuilder/libinstaller/operationrunner.cpp index 7fcf45bf0..f15a15528 100644 --- a/installerbuilder/libinstaller/operationrunner.cpp +++ b/installerbuilder/libinstaller/operationrunner.cpp @@ -95,8 +95,8 @@ void OperationRunner::setVerbose(bool verbose) int OperationRunner::runOperation(const QStringList &arguments) { if (!init()) { - verbose() << "Could not init the package manager core - without this not all operations " - << "are working as expected." << std::endl; + qDebug() << "Could not init the package manager core - without this not all operations are working " + "as expected."; } bool isPerformType = arguments.contains(QLatin1String("--runoperation")); diff --git a/installerbuilder/libinstaller/packagemanagercore.cpp b/installerbuilder/libinstaller/packagemanagercore.cpp index 5e03e6fc8..4f2521231 100644 --- a/installerbuilder/libinstaller/packagemanagercore.cpp +++ b/installerbuilder/libinstaller/packagemanagercore.cpp @@ -1485,7 +1485,7 @@ bool PackageManagerCore::run() d->runPackageUpdater(); return true; } catch (const Error &err) { - verbose() << "Caught Installer Error: " << err.message() << std::endl; + qDebug() << "Caught Installer Error:" << err.message(); return false; } } @@ -1514,7 +1514,7 @@ bool PackageManagerCore::updateComponentData(struct Data &data, Component *compo if (isVerbose()) { static QString lastLocalPath; if (lastLocalPath != localPath) - verbose() << "Url is : " << localPath << std::endl; + qDebug() << "Url is:" << localPath; lastLocalPath = localPath; } @@ -1584,7 +1584,7 @@ void PackageManagerCore::storeReplacedComponents(QHash &co // if one component has a replaces which is not existing in the current component list anymore, // just ignore it if (!component) { - qDebug() << componentName << " - Does not exist in the repositories anymore."; + qDebug() << componentName << "- Does not exist in the repositories anymore."; continue; } if (!d->componentsToReplace(data.runMode).contains(componentName)) { diff --git a/installerbuilder/libinstaller/packagemanagercore_p.cpp b/installerbuilder/libinstaller/packagemanagercore_p.cpp index 06dece2cf..f572703c5 100644 --- a/installerbuilder/libinstaller/packagemanagercore_p.cpp +++ b/installerbuilder/libinstaller/packagemanagercore_p.cpp @@ -36,7 +36,6 @@ #include "common/binaryformat.h" #include "common/errors.h" #include "common/fileutils.h" -#include "common/utils.h" #include "component.h" #include "fsengineclient.h" #include "messageboxhandler.h" @@ -384,7 +383,7 @@ void PackageManagerCorePrivate::clearComponentsToInstall() bool PackageManagerCorePrivate::appendComponentsToInstall(const QList &components) { if (components.isEmpty()) { - verbose() << "components list is empty in " << Q_FUNC_INFO << std::endl; + qDebug() << "components list is empty in" << Q_FUNC_INFO; return true; } @@ -401,7 +400,7 @@ bool PackageManagerCorePrivate::appendComponentsToInstall(const QListname())) { QString errorMessage = QString::fromLatin1("Recursion detected component(%1) already added with " "reason: \"%2\"").arg(component->name(), installReason(component)); - verbose() << qPrintable(errorMessage) << std::endl; + qDebug() << qPrintable(errorMessage); m_componentsToInstallError.append(errorMessage); Q_ASSERT_X(!m_toInstallComponentIds.contains(component->name()), Q_FUNC_INFO, qPrintable(errorMessage)); @@ -452,7 +451,7 @@ bool PackageManagerCorePrivate::appendComponentToInstall(Component *component) if (!dependencyComponent) errorMessage = QString::fromLatin1("Can't find missing dependency (%1) for %2."); errorMessage = errorMessage.arg(dependencyComponentName, component->name()); - verbose() << qPrintable(errorMessage) << std::endl; + qDebug() << qPrintable(errorMessage); m_componentsToInstallError.append(errorMessage); Q_ASSERT_X(false, Q_FUNC_INFO, qPrintable(errorMessage)); return false; @@ -463,7 +462,7 @@ bool PackageManagerCorePrivate::appendComponentToInstall(Component *component) if (m_visitedComponents.value(component).contains(dependencyComponent)) { QString errorMessage = QString::fromLatin1("Recursion detected component(%1) already " "added with reason: \"%2\"").arg(component->name(), installReason(component)); - verbose() << qPrintable(errorMessage) << std::endl; + qDebug() << qPrintable(errorMessage); m_componentsToInstallError = errorMessage; Q_ASSERT_X(!m_visitedComponents.value(component).contains(dependencyComponent), Q_FUNC_INFO, qPrintable(errorMessage)); @@ -1015,9 +1014,10 @@ void PackageManagerCorePrivate::registerPathesForUninstallation( void PackageManagerCorePrivate::writeUninstallerBinary(QFile *const input, qint64 size, bool writeBinaryLayout) { - verbose() << "Writing uninstaller: " << (uninstallerName() + QLatin1String(".new")) << std::endl; + QString uninstallerRenamedName = uninstallerName() + QLatin1String(".new"); + qDebug() << "Writing uninstaller:" << uninstallerRenamedName; - KDSaveFile out(uninstallerName() + QLatin1String(".new")); + KDSaveFile out(uninstallerRenamedName); openForWrite(&out, out.fileName()); // throws an exception in case of error if (!input->seek(0)) @@ -1143,7 +1143,7 @@ void PackageManagerCorePrivate::writeUninstaller(OperationList performedOperatio op = createOwnedOperation(QLatin1String("Mkdir")); op->setArguments(QStringList() << (targetAppDirPath + QLatin1String("/../Resources/qt_menu.nib"))); if (!op->performOperation()) { - verbose() << "ERROR in Mkdir operation: " << op->errorString() << std::endl; + qDebug() << "ERROR in Mkdir operation:" << op->errorString(); } op = createOwnedOperation(QLatin1String("CopyDirectory")); @@ -1215,7 +1215,7 @@ void PackageManagerCorePrivate::writeUninstaller(OperationList performedOperatio bool replacementExists = false; const QString installerBaseBinary = m_core->replaceVariables(m_installerBaseBinaryUnreplaced); if (!installerBaseBinary.isEmpty() && QFileInfo(installerBaseBinary).exists()) { - verbose() << "Got a replacement installer base binary: " << installerBaseBinary << std::endl; + qDebug() << "Got a replacement installer base binary:" << installerBaseBinary; QFile replacementBinary(installerBaseBinary); try { @@ -1226,14 +1226,14 @@ void PackageManagerCorePrivate::writeUninstaller(OperationList performedOperatio newBinaryWritten = true; replacementExists = true; } catch (const Error &error) { - verbose() << error.message() << std::endl; + qDebug() << error.message(); } 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. - verbose() << "Could not remove installer base binary (" << installerBaseBinary - << ") after updating the uninstaller: " << replacementBinary.errorString() << std::endl; + qDebug() << QString::fromLatin1("Could not remove installer base binary (%1) after updating " + "the uninstaller: %2").arg(installerBaseBinary, replacementBinary.errorString()); } m_installerBaseBinaryUnreplaced.clear(); } @@ -1292,7 +1292,7 @@ void PackageManagerCorePrivate::writeUninstaller(OperationList performedOperatio if (newBinaryWritten) { const bool restart = replacementExists && isUpdater() && (!statusCanceledOrFailed()); deferredRename(uninstallerName() + QLatin1String(".new"), uninstallerName(), restart); - verbose() << "Maintenance tool restart: " << (restart ? "true." : "false.") << std::endl; + qDebug() << "Maintenance tool restart:" << (restart ? "true." : "false."); } } catch (const Error &err) { setStatus(PackageManagerCore::Failure); @@ -1381,7 +1381,7 @@ void PackageManagerCorePrivate::runInstaller() ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("Preparing the installation...")); const QList componentsToInstall = m_core->orderedComponentsToInstall(); - verbose() << "Install size: " << componentsToInstall.size() << " components" << std::endl; + qDebug() << "Install size:" << componentsToInstall.size() << "components"; if (!adminRightsGained) { foreach (Component *component, m_core->orderedComponentsToInstall()) { @@ -1441,8 +1441,7 @@ void PackageManagerCorePrivate::runInstaller() setStatus(PackageManagerCore::Failure); MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), QLatin1String("installationError"), tr("Error"), err.message()); - verbose() << "ROLLING BACK operations=" << m_performedOperationsCurrentSession.count() - << std::endl; + qDebug() << "ROLLING BACK operations=" << m_performedOperationsCurrentSession.count(); } m_core->rollBackInstallation(); @@ -1477,7 +1476,7 @@ void PackageManagerCorePrivate::runPackageUpdater() adminRightsGained = m_core->gainAdminRights(); const QList componentsToInstall = m_core->orderedComponentsToInstall(); - verbose() << "Install size: " << componentsToInstall.size() << " components " << std::endl; + qDebug() << "Install size:" << componentsToInstall.size() << "components"; bool updateAdminRights = false; if (!adminRightsGained) { @@ -1605,8 +1604,7 @@ void PackageManagerCorePrivate::runPackageUpdater() setStatus(PackageManagerCore::Failure); MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), QLatin1String("installationError"), tr("Error"), err.message()); - verbose() << "ROLLING BACK operations=" << m_performedOperationsCurrentSession.count() - << std::endl; + qDebug() << "ROLLING BACK operations=" << m_performedOperationsCurrentSession.count(); } m_core->rollBackInstallation(); @@ -1659,10 +1657,10 @@ void PackageManagerCorePrivate::runUninstaller() try { QInstaller::removeDirectory(startMenuDir); } catch (const Error &error) { - verbose() << "Could not remove " << startMenuDir << ": " << error.message() << std::endl; + qDebug() << QString::fromLatin1("Could not remove %1: %2").arg(startMenuDir, error.message()); } } else { - verbose() << "Start menu dir not set." << std::endl; + qDebug() << "Start menu dir not set."; } // this will also delete the TargetDir on Windows @@ -1670,7 +1668,7 @@ void PackageManagerCorePrivate::runUninstaller() if (QVariant(m_core->value(scRemoveTargetDir)).toBool()) { // on !Windows, we need to remove TargetDir manually - verbose() << "Complete uninstallation is chosen" << std::endl; + qDebug() << "Complete uninstallation is chosen"; const QString target = targetDir(); if (!target.isEmpty()) { if (updateAdminRights && !adminRightsGained) { @@ -1730,7 +1728,7 @@ void PackageManagerCorePrivate::installComponent(Component *component, double pr bool becameAdmin = false; if (!adminRightsGained && operation->value(QLatin1String("admin")).toBool()) { becameAdmin = m_core->gainAdminRights(); - verbose() << operation->name() << " as admin: " << becameAdmin << std::endl; + qDebug() << operation->name() << "as admin:" << becameAdmin; } connectOperationToInstaller(operation, progressOperationSize); @@ -1742,9 +1740,9 @@ void PackageManagerCorePrivate::installComponent(Component *component, double pr bool ignoreError = false; bool ok = PackageManagerCorePrivate::performOperationThreaded(operation); while (!ok && !ignoreError && m_core->status() != PackageManagerCore::Canceled) { - verbose() << QString(QLatin1String("operation '%1' with arguments: '%2' failed: %3")) + qDebug() << QString::fromLatin1("Operation '%1' with arguments: '%2' failed: %3") .arg(operation->name(), operation->arguments().join(QLatin1String("; ")), - operation->errorString()) << std::endl;; + operation->errorString()); const QMessageBox::StandardButton button = MessageBoxHandler::warning(MessageBoxHandler::currentBestSuitParent(), QLatin1String("installationErrorWithRetry"), tr("Installer Error"), @@ -1909,7 +1907,7 @@ void PackageManagerCorePrivate::runUndoOperations(const OperationList &undoOpera becameAdmin = m_core->gainAdminRights(); connectOperationToInstaller(undoOperation, progressSize); - verbose() << "undo operation=" << undoOperation->name() << std::endl; + qDebug() << "undo operation=" << undoOperation->name(); performOperationThreaded(undoOperation, PackageManagerCorePrivate::Undo); const QString componentName = undoOperation->value(QLatin1String("component")).toString(); @@ -2083,7 +2081,7 @@ bool PackageManagerCorePrivate::addUpdateResourcesFromRepositories(bool parseChe try { openForRead(&updatesFile, updatesFile.fileName()); } catch(const Error &e) { - verbose() << tr("Error opening Updates.xml: ") << e.message() << std::endl; + qDebug() << "Error opening Updates.xml:" << e.message(); setStatus(PackageManagerCore::Failure, tr("Could not add temporary update source information.")); return false; } @@ -2093,8 +2091,8 @@ bool PackageManagerCorePrivate::addUpdateResourcesFromRepositories(bool parseChe QString error; QDomDocument doc; if (!doc.setContent(&updatesFile, &error, &line, &column)) { - verbose() << tr("Parse error in File %4 : %1 at line %2 col %3").arg(error, - QString::number(line), QString::number(column), updatesFile.fileName()) << std::endl; + qDebug() << QString::fromLatin1("Parse error in File %4 : %1 at line %2 col %3").arg(error, + QString::number(line), QString::number(column), updatesFile.fileName()); setStatus(PackageManagerCore::Failure, tr("Could not add temporary update source information.")); return false; } @@ -2165,7 +2163,7 @@ bool PackageManagerCorePrivate::appendComponentToUninstall(Component *component) bool PackageManagerCorePrivate::appendComponentsToUninstall(const QList &components) { if (components.isEmpty()) { - verbose() << "components list is empty in " << Q_FUNC_INFO << std::endl; + qDebug() << "components list is empty in" << Q_FUNC_INFO; return true; } diff --git a/installerbuilder/libinstaller/packagemanagergui.cpp b/installerbuilder/libinstaller/packagemanagergui.cpp index 4c07dea36..21bdab0ce 100644 --- a/installerbuilder/libinstaller/packagemanagergui.cpp +++ b/installerbuilder/libinstaller/packagemanagergui.cpp @@ -316,7 +316,7 @@ void PackageManagerGui::clickButton(int wb, int delay) QTimer::singleShot(delay, b, SLOT(click())); } else { // TODO: we should probably abort immediately here (faulty test script) - verbose() << "Button " << wb << " not found!" << std::endl; + qDebug() << "Button" << wb << "not found!"; } } @@ -378,7 +378,7 @@ void PackageManagerGui::loadControlScript(const QString &scriptPath) d->m_controlScript = comp; d->m_controlScript.construct(); - verbose() << "Loaded control script " << qPrintable(scriptPath) << std::endl; + qDebug() << "Loaded control script" << scriptPath; } void PackageManagerGui::slotCurrentPageChanged(int id) @@ -392,12 +392,11 @@ void PackageManagerGui::callControlScriptMethod(const QString &methodName) QScriptValue method = d->m_controlScript.property(QLatin1String("prototype")).property(methodName); if (!method.isValid()) { - verbose() << "Control script callback " << qPrintable(methodName) << " does not exist." - << std::endl; + qDebug() << "Control script callback" << methodName << "does not exist."; return; } - verbose() << "Calling control script callback " << qPrintable(methodName) << std::endl; + qDebug() << "Calling control script callback" << methodName; method.call(d->m_controlScript); @@ -519,7 +518,7 @@ QWidget *PackageManagerGui::pageWidgetByObjectName(const QString &name) const return p; } } - verbose() << "No page found for object name " << name << std::endl; + qDebug() << "No page found for object name" << name; return 0; } @@ -578,7 +577,7 @@ void PackageManagerGui::setModified(bool value) void PackageManagerGui::showFinishedPage() { - verbose() << "SHOW FINISHED PAGE" << std::endl; + qDebug() << "SHOW FINISHED PAGE"; if (d->m_autoSwitchPage) next(); else @@ -1436,7 +1435,7 @@ StartMenuDirectoryPage::StartMenuDirectoryPage(PackageManagerCore *core) QStringList dirs = dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); if (core->value(QLatin1String("AllUsers")) == QLatin1String("true")) { - verbose() << "AllUsers set. Using HKEY_LOCAL_MACHINE" << std::endl; + qDebug() << "AllUsers set. Using HKEY_LOCAL_MACHINE"; QSettings system(QLatin1String("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\" "Explorer\\Shell Folders"), QSettings::NativeFormat); startMenuPath = system.value(QLatin1String("Common Programs"), QString()).toString(); @@ -1446,8 +1445,8 @@ StartMenuDirectoryPage::StartMenuDirectoryPage(PackageManagerCore *core) dirs += dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); } - verbose() << "StartMenuPath: \t" << startMenuPath << std::endl; - verbose() << "DesktopDir: \t" << core->value(QLatin1String("DesktopDir")) << std::endl; + qDebug() << "StartMenuPath: \t" << startMenuPath; + qDebug() << "DesktopDir: \t" << core->value(QLatin1String("DesktopDir")); m_listWidget = new QListWidget(this); if (!dirs.isEmpty()) { @@ -1587,8 +1586,8 @@ void ReadyForInstallationPage::entering() // there is no better way atm to check this if (vol.size() == 0 && vol.availableSpace() == 0) { - verbose() << "Could not determine available space on device " << target << ". Continue silently." - << std::endl; + qDebug() << QString::fromLatin1("Could not determine available space on device %1. Continue silently." + ).arg(target); return; } @@ -1603,8 +1602,8 @@ void ReadyForInstallationPage::entering() const bool tempInstFailure = tempOnSameVolume && available < realRequiredSpace + realRequiredTempSpace; - verbose() << "Disk space check on " << target << ": required: " << required - << ", available: " << available << ", size: " << vol.size() << std::endl; + qDebug() << QString::fromLatin1("Disk space check on %1: required: %2, available: %3, size: %4").arg( + target, QString::number(required), QString::number(available), QString::number(vol.size())); QString tempString; if (tempAvailable < realRequiredTempSpace || tempInstFailure) { @@ -1852,8 +1851,6 @@ FinishedPage::FinishedPage(PackageManagerCore *core) void FinishedPage::entering() { - verbose() << "FINISHED ENTERING: " << std::endl; - if (m_commitButton) { disconnect(m_commitButton, SIGNAL(clicked()), this, SLOT(handleFinishClicked())); m_commitButton = 0; @@ -1927,7 +1924,7 @@ void FinishedPage::handleFinishClicked() if (!m_runItCheckBox->isChecked() || program.isEmpty()) return; - verbose() << "STARTING " << program << std::endl; + qDebug() << "starting" << program; QProcess::startDetached(program); } diff --git a/installerbuilder/libinstaller/performinstallationform.cpp b/installerbuilder/libinstaller/performinstallationform.cpp index 7d367d85a..1bb71c130 100644 --- a/installerbuilder/libinstaller/performinstallationform.cpp +++ b/installerbuilder/libinstaller/performinstallationform.cpp @@ -35,7 +35,6 @@ #include "lazyplaintextedit.h" #include "progresscoordinator.h" -#include #include #include diff --git a/installerbuilder/libinstaller/progresscoordinator.cpp b/installerbuilder/libinstaller/progresscoordinator.cpp index 041689224..4237a768b 100644 --- a/installerbuilder/libinstaller/progresscoordinator.cpp +++ b/installerbuilder/libinstaller/progresscoordinator.cpp @@ -120,11 +120,11 @@ void ProgressCoordinator::partProgressChanged(double fraction) //Q_ASSERT(newCurrentCompletePercentage >= 0); //Q_ASSERT(newCurrentCompletePercentage <= 100); if (newCurrentCompletePercentage < 0) { - qDebug() << newCurrentCompletePercentage << " is smaller then 0 - this should happen max once"; + qDebug() << newCurrentCompletePercentage << "is smaller then 0 - this should happen max once"; newCurrentCompletePercentage = 0; } if (newCurrentCompletePercentage > 100) { - qDebug() << newCurrentCompletePercentage << " is bigger then 100 - this should happen max once"; + qDebug() << newCurrentCompletePercentage << "is bigger then 100 - this should happen max once"; newCurrentCompletePercentage = 100; } @@ -152,12 +152,12 @@ void ProgressCoordinator::partProgressChanged(double fraction) //Q_ASSERT(newCurrentCompletePercentage >= 0); //Q_ASSERT(newCurrentCompletePercentage <= 100); if (newCurrentCompletePercentage < 0) { - qDebug() << newCurrentCompletePercentage << " is smaller then 0 - this should happen max once"; + qDebug() << newCurrentCompletePercentage << "is smaller then 0 - this should happen max once"; newCurrentCompletePercentage = 0; } if (newCurrentCompletePercentage > 100) { - qDebug() << newCurrentCompletePercentage << " is bigger then 100 - this should happen max once"; + qDebug() << newCurrentCompletePercentage << "is bigger then 100 - this should happen max once"; newCurrentCompletePercentage = 100; } diff --git a/installerbuilder/libinstaller/qprocesswrapper.cpp b/installerbuilder/libinstaller/qprocesswrapper.cpp index 2d93c2842..739f96d8a 100644 --- a/installerbuilder/libinstaller/qprocesswrapper.cpp +++ b/installerbuilder/libinstaller/qprocesswrapper.cpp @@ -183,7 +183,7 @@ bool startDetached(const QString &program, const QStringList &args, const QStrin bool QProcessWrapper::startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory, qint64 *pid) { - qDebug() << Q_FUNC_INFO; + qDebug() << Q_FUNC_INFO << program << arguments; QProcessWrapper w; if (w.d->createSocket()) { const QPair result = callRemoteMethod >(w.d->stream, diff --git a/installerbuilder/libinstaller/qtpatch.cpp b/installerbuilder/libinstaller/qtpatch.cpp index 6fabe22a8..9bebe9ed6 100644 --- a/installerbuilder/libinstaller/qtpatch.cpp +++ b/installerbuilder/libinstaller/qtpatch.cpp @@ -32,8 +32,6 @@ **************************************************************************/ #include "qtpatch.h" -#include "common/utils.h" - #include #include #include @@ -41,7 +39,7 @@ #include #include #include -#include +#include #include #include @@ -101,7 +99,7 @@ QHash QtPatch::qmakeValues(const QString &qmakePath, QByteA process.start(qmake.absoluteFilePath(), args, QIODevice::ReadOnly); if (process.waitForFinished(2000)) { if (process.exitStatus() == QProcess::CrashExit) { - QInstaller::verbose() << qmakePath << " was crashed" << std::endl; + qDebug() << qmakePath << "was crashed"; return qmakeValueHash; } QByteArray output = process.readAllStandardOutput(); @@ -123,13 +121,13 @@ QHash QtPatch::qmakeValues(const QString &qmakePath, QByteA uiDetachedWait(waitTimeInMilliSeconds); } if (process.state() > QProcess::NotRunning ) { - QInstaller::verbose() << "qmake process is still running, need to kill it." << std::endl; + qDebug() << "qmake process is still running, need to kill it."; process.kill(); } } if (qmakeValueHash.isEmpty()) - QInstaller::verbose() << "Can't get any query output from qmake." << std::endl; + qDebug() << "Can't get any query output from qmake."; return qmakeValueHash; } @@ -139,14 +137,14 @@ bool QtPatch::patchBinaryFile(const QString &fileName, { QFile file(fileName); if (!file.exists()) { - QInstaller::verbose() << "qpatch: warning: file `" << qPrintable(fileName) << "' not found" << std::endl; + qDebug() << "qpatch: warning: file" << fileName << "not found"; return false; } openFileForPatching(&file); if (!file.isOpen()) { - QInstaller::verbose() << "qpatch: warning: file `" << qPrintable(fileName) << "' can not open." << std::endl; - QInstaller::verbose() << qPrintable(file.errorString()) << std::endl; + qDebug() << "qpatch: warning: file" << qPrintable(fileName) << "can not open."; + qDebug() << qPrintable(file.errorString()); return false; } @@ -162,7 +160,7 @@ bool QtPatch::patchBinaryFile(QIODevice *device, const QByteArray &newQtPath) { if (!(device->openMode() == QIODevice::ReadWrite)) { - QInstaller::verbose() << "qpatch: warning: This function needs an open device for writing." << std::endl; + qDebug() << "qpatch: warning: This function needs an open device for writing."; return false; } const QByteArray source = device->readAll(); @@ -194,9 +192,8 @@ bool QtPatch::patchTextFile(const QString &fileName, QFile file(fileName); if (!file.open(QFile::ReadOnly)) { - QInstaller::verbose() << "qpatch: warning: Open the file '" - << qPrintable(fileName) << "' stopped: " - << qPrintable(file.errorString()) << std::endl; + qDebug() << QString::fromLatin1("qpatch: warning: Open the file '%1' stopped: %2").arg( + fileName, file.errorString()); return false; } @@ -210,7 +207,7 @@ bool QtPatch::patchTextFile(const QString &fileName, } if (!file.open(QFile::WriteOnly | QFile::Truncate)) { - QInstaller::verbose() << "qpatch: error: file `" << qPrintable(fileName) << "' not writable" << std::endl; + qDebug() << QString::fromLatin1("qpatch: error: file '%1' not writable").arg(fileName); return false; } @@ -230,6 +227,7 @@ bool QtPatch::openFileForPatching(QFile *file) } return file->openMode() == QFile::ReadWrite; } - QInstaller::verbose() << "qpatch: error: File `" << qPrintable(file->fileName()) << "' is open, so it can not open it again." << std::endl; + qDebug() << QString::fromLatin1("qpatch: error: File '%1 is open, so it can not open it again.").arg( + file->fileName()); return false; } diff --git a/installerbuilder/libinstaller/qtpatchoperation.cpp b/installerbuilder/libinstaller/qtpatchoperation.cpp index 1cd5c3538..5f78b52c7 100644 --- a/installerbuilder/libinstaller/qtpatchoperation.cpp +++ b/installerbuilder/libinstaller/qtpatchoperation.cpp @@ -37,7 +37,6 @@ #endif #include "constants.h" -#include "common/utils.h" #include "packagemanagercore.h" #include @@ -45,7 +44,7 @@ #include #include #include -#include +#include using namespace QInstaller; @@ -250,8 +249,7 @@ bool QtPatchOperation::performOperation() it.next(); bool isPatched = QtPatch::patchBinaryFile(&file, it.key(), it.value()); if (!isPatched) { - QInstaller::verbose() << "qpatch: warning: file '" << qPrintable(fileName) - << "' could not patched" << std::endl; + qDebug() << QString::fromLatin1("qpatch: warning: file '%1' could not patched").arg(fileName); } } } //foreach (QString fileName, filesToPatch) diff --git a/installerbuilder/libinstaller/registerdocumentationoperation.cpp b/installerbuilder/libinstaller/registerdocumentationoperation.cpp index a45e218bd..a0ec54f1b 100644 --- a/installerbuilder/libinstaller/registerdocumentationoperation.cpp +++ b/installerbuilder/libinstaller/registerdocumentationoperation.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include using namespace QInstaller; @@ -98,7 +98,7 @@ bool RegisterDocumentationOperation::performOperation() if (!settingsDir.exists()) settingsDir.mkpath(settingsDir.absolutePath()); const QString collectionFile = settingsDir.absolutePath() + QLatin1String("/helpcollection.qhc"); - qDebug() << "collectionFile: " << collectionFile; + qDebug() << "collectionFile:" << collectionFile; if (!QFileInfo(helpFile).exists()) { setError(UserDefinedError); diff --git a/installerbuilder/libinstaller/setdemospathonqtoperation.cpp b/installerbuilder/libinstaller/setdemospathonqtoperation.cpp index 19018b189..3d484d800 100644 --- a/installerbuilder/libinstaller/setdemospathonqtoperation.cpp +++ b/installerbuilder/libinstaller/setdemospathonqtoperation.cpp @@ -33,10 +33,10 @@ #include "setdemospathonqtoperation.h" #include "qtpatch.h" -#include "common/utils.h" #include #include +#include using namespace QInstaller; @@ -82,8 +82,7 @@ bool SetDemosPathOnQtOperation::performOperation() QByteArray oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_DEMOS")); bool oldQtPathFromQMakeIsEmpty = oldValue.isEmpty(); if (oldQtPathFromQMakeIsEmpty) { - verbose() << "qpatch: warning: It was not able to get the old values from " << qPrintable(qmakePath) - << std::endl; + qDebug() << "qpatch: warning: It was not able to get the old values from" << qmakePath; } if (255 < newValue.size()) { @@ -104,8 +103,7 @@ bool SetDemosPathOnQtOperation::performOperation() bool isPatched = QtPatch::patchBinaryFile(qmakePath, oldValue, newValue); if (!isPatched) { - QInstaller::verbose() << "qpatch: warning: could not patched the demo path in " - << qPrintable(qmakePath) << std::endl; + qDebug() << "qpatch: warning: could not patched the demo path in" << qmakePath; } return true; diff --git a/installerbuilder/libinstaller/setexamplespathonqtoperation.cpp b/installerbuilder/libinstaller/setexamplespathonqtoperation.cpp index cdd42d8a7..5821ac838 100644 --- a/installerbuilder/libinstaller/setexamplespathonqtoperation.cpp +++ b/installerbuilder/libinstaller/setexamplespathonqtoperation.cpp @@ -32,11 +32,11 @@ **************************************************************************/ #include "setexamplespathonqtoperation.h" -#include "common/utils.h" #include "qtpatch.h" #include #include +#include using namespace QInstaller; @@ -82,8 +82,7 @@ bool SetExamplesPathOnQtOperation::performOperation() QByteArray oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_EXAMPLES")); bool oldQtPathFromQMakeIsEmpty = oldValue.isEmpty(); if (oldQtPathFromQMakeIsEmpty) { - verbose() << "qpatch: warning: It was not able to get the old values from " << qPrintable(qmakePath) - << std::endl; + qDebug() << "qpatch: warning: It was not able to get the old values from" << qmakePath; } if (255 < newValue.size()) { @@ -105,8 +104,7 @@ bool SetExamplesPathOnQtOperation::performOperation() bool isPatched = QtPatch::patchBinaryFile(qmakePath, oldValue, newValue); if (!isPatched) { - QInstaller::verbose() << "qpatch: warning: could not patched the example path in " - << qPrintable(qmakePath) << std::endl; + qDebug() << "qpatch: warning: could not patched the example path in" << qmakePath; } return true; diff --git a/installerbuilder/libinstaller/setimportspathonqtcoreoperation.cpp b/installerbuilder/libinstaller/setimportspathonqtcoreoperation.cpp index 284b6f65d..90337174f 100644 --- a/installerbuilder/libinstaller/setimportspathonqtcoreoperation.cpp +++ b/installerbuilder/libinstaller/setimportspathonqtcoreoperation.cpp @@ -32,11 +32,11 @@ **************************************************************************/ #include "setimportspathonqtcoreoperation.h" -#include "common/utils.h" #include "qtpatch.h" #include #include +#include using namespace QInstaller; @@ -46,7 +46,7 @@ namespace { QFileInfo fileInfo(binaryPath); if (!fileInfo.exists()) { - verbose() << "qpatch: warning: file `" << qPrintable(binaryPath) << "' not found" << std::endl; + qDebug() << QString::fromLatin1("qpatch: warning: file '%1' not found").arg(binaryPath); return QByteArray(); } @@ -59,9 +59,9 @@ namespace { } Q_ASSERT(file.isOpen()); if (!file.isOpen()) { - verbose() << "qpatch: warning: file `" << qPrintable(binaryPath) << "' can not open as ReadOnly." - << std::endl; - verbose() << file.errorString() << std::endl; + qDebug() << QString::fromLatin1("qpatch: warning: file '%1' can not open as ReadOnly.").arg( + binaryPath); + qDebug() << file.errorString(); return QByteArray(); } @@ -107,7 +107,7 @@ bool SetImportsPathOnQtCoreOperation::performOperation() const QByteArray newValue = QDir::toNativeSeparators(args.at(1)).toUtf8(); if (255 < newValue.size()) { - verbose() << "qpatch: error: newQtDir needs to be less than 255 characters." << std::endl; + qDebug() << "qpatch: error: newQtDir needs to be less than 255 characters."; return false; } QStringList libraryFiles; @@ -126,8 +126,7 @@ bool SetImportsPathOnQtCoreOperation::performOperation() bool isPatched = QtPatch::patchBinaryFile(coreLibrary, oldValue, adjutedNewValue); if (!isPatched) { - QInstaller::verbose() << "qpatch: warning: could not patched the imports path in " - << qPrintable(coreLibrary) << std::endl; + qDebug() << "qpatch: warning: could not patched the imports path in" << coreLibrary; } } } diff --git a/installerbuilder/libinstaller/setpathonqtcoreoperation.cpp b/installerbuilder/libinstaller/setpathonqtcoreoperation.cpp index c0a88d032..8ea4eaa5e 100644 --- a/installerbuilder/libinstaller/setpathonqtcoreoperation.cpp +++ b/installerbuilder/libinstaller/setpathonqtcoreoperation.cpp @@ -31,11 +31,11 @@ **************************************************************************/ #include "setpathonqtcoreoperation.h" -#include "common/utils.h" #include "qtpatch.h" #include #include +#include using namespace QInstaller; @@ -45,11 +45,10 @@ namespace { QFileInfo fileInfo(binaryPath); if (!fileInfo.exists()) { - verbose() << "qpatch: warning: file '" << qPrintable(binaryPath) << "' not found" << std::endl; + qDebug() << "qpatch: warning: file '" << binaryPath << "' not found"; return QByteArray(); } - QFile file(binaryPath); int readOpenCount = 0; while (!file.open(QFile::ReadOnly) && readOpenCount < 20000) { @@ -58,9 +57,8 @@ namespace { } Q_ASSERT(file.isOpen()); if (!file.isOpen()) { - verbose() << "qpatch: warning: file '" << qPrintable(binaryPath) << "' can not open as ReadOnly." - << std::endl; - verbose() << file.errorString() << std::endl; + qDebug() << "qpatch: warning: file '" << binaryPath << "' can not open as ReadOnly."; + qDebug() << file.errorString(); return QByteArray(); } @@ -131,7 +129,7 @@ bool SetPathOnQtCoreOperation::performOperation() } if (255 < newValue.size()) { - verbose() << "qpatch: error: newQtDir needs to be less than 255 characters." << std::endl; + qDebug() << "qpatch: error: newQtDir needs to be less than 255 characters."; return false; } QStringList libraryFiles; @@ -151,8 +149,7 @@ bool SetPathOnQtCoreOperation::performOperation() bool isPatched = QtPatch::patchBinaryFile(coreLibrary, oldValue, adjutedNewValue); if (!isPatched) { - QInstaller::verbose() << "qpatch: warning: could not patched the plugin path in " - << qPrintable(coreLibrary) << std::endl; + qDebug() << "qpatch: warning: could not patched the plugin path in" << coreLibrary; } } } diff --git a/installerbuilder/libinstaller/setpluginpathonqtcoreoperation.cpp b/installerbuilder/libinstaller/setpluginpathonqtcoreoperation.cpp index 88c4376fe..d6ad59a73 100644 --- a/installerbuilder/libinstaller/setpluginpathonqtcoreoperation.cpp +++ b/installerbuilder/libinstaller/setpluginpathonqtcoreoperation.cpp @@ -32,11 +32,11 @@ **************************************************************************/ #include "setpluginpathonqtcoreoperation.h" -#include "common/utils.h" #include "qtpatch.h" #include #include +#include using namespace QInstaller; @@ -46,7 +46,7 @@ namespace { QFileInfo fileInfo(binaryPath); if (!fileInfo.exists()) { - verbose() << "qpatch: warning: file '" << qPrintable(binaryPath) << "' not found" << std::endl; + qDebug() << QString::fromLatin1("qpatch: warning: file '%1' not found").arg(binaryPath); return QByteArray(); } @@ -58,9 +58,9 @@ namespace { } Q_ASSERT(file.isOpen()); if (!file.isOpen()) { - verbose() << "qpatch: warning: file '" << qPrintable(binaryPath) << "' can not open as ReadOnly." - << std::endl; - verbose() << file.errorString() << std::endl; + qDebug() << QString::fromLatin1("qpatch: warning: file '%1' can not open as ReadOnly.").arg( + binaryPath); + qDebug() << file.errorString(); return QByteArray(); } @@ -106,7 +106,7 @@ bool SetPluginPathOnQtCoreOperation::performOperation() const QByteArray newValue = QDir::toNativeSeparators(args.at(1)).toUtf8(); if (255 < newValue.size()) { - verbose() << "qpatch: error: newQtDir needs to be less than 255 characters." << std::endl; + qDebug() << "qpatch: error: newQtDir needs to be less than 255 characters."; return false; } QStringList libraryFiles; @@ -124,10 +124,8 @@ bool SetPluginPathOnQtCoreOperation::performOperation() QByteArray adjutedNewValue = QByteArray("qt_plugpath=%1").replace("%1", newValue); bool isPatched = QtPatch::patchBinaryFile(coreLibrary, oldValue, adjutedNewValue); - if (!isPatched) { - QInstaller::verbose() << "qpatch: warning: could not patched the plugin path in " - << qPrintable(coreLibrary) << std::endl; - } + if (!isPatched) + qDebug() << "qpatch: warning: could not patched the plugin path in" << coreLibrary; } } diff --git a/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.cpp b/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.cpp index 6e3ec8f21..9c4a17948 100644 --- a/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.cpp +++ b/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.cpp @@ -73,13 +73,13 @@ bool removeInstallerRegisteredQtVersions(QSettings &settings, const QStringList qDebug() << Q_FUNC_INFO << settings.fileName(); settings.beginGroup(QLatin1String(QtVersionsSectionName)); int qtVersionSizeValue = settings.value(QLatin1String("size")).toInt(); - qDebug() << QLatin1String("qtVersionSizeValue: ") << qtVersionSizeValue; + qDebug() << "qtVersionSizeValue:" << qtVersionSizeValue; //read all settings for Qt Versions QHash oldSettingsAsHash; foreach (const QString &key, settings.allKeys()) oldSettingsAsHash.insert(key, settings.value(key)); - qDebug() << QLatin1String("settings.allKeys(): ") << settings.allKeys(); + qDebug() << "settings.allKeys():" << settings.allKeys(); //get the installer added Qt Version settings ids QList toRemoveIds; @@ -96,7 +96,7 @@ bool removeInstallerRegisteredQtVersions(QSettings &settings, const QStringList } } } - qDebug() << QLatin1String("toRemoveIds: ") << toRemoveIds; + qDebug() << "toRemoveIds:" << toRemoveIds; //now write only the other Qt Versions to QtCreator settings it.toFront(); @@ -118,12 +118,8 @@ bool removeInstallerRegisteredQtVersions(QSettings &settings, const QStringList } QString newKey = QString::number(qtVersionIdMapper.value(numberAtTheBeginning)) + restOfTheKey; if (newKey.endsWith(QLatin1String("Id"))) { - qDebug() << QLatin1String("settings.setValue(newKey, qtVersionIdMapper.value(numberAtTheBeginning)): ") - << newKey << QLatin1String("||") << qtVersionIdMapper.value(numberAtTheBeginning); settings.setValue(newKey, qtVersionIdMapper.value(numberAtTheBeginning)); } else { - qDebug() << QLatin1String("settings.setValue(newKey, it.value()): ") - << newKey << QLatin1String("||") << it.value(); settings.setValue(newKey, it.value()); } } @@ -132,8 +128,6 @@ bool removeInstallerRegisteredQtVersions(QSettings &settings, const QStringList settings.setValue(QLatin1String("size"), qtVersionIdMapper.count()); settings.endGroup(); //QtVersionsSectionName - qDebug() << QLatin1String("qtVersionIdMapper.count(): ") << qtVersionIdMapper.count(); - qDebug() << QLatin1String("qtVersionSizeValue - toRemoveIds.count(): ") << qtVersionSizeValue - toRemoveIds.count(); if (qtVersionIdMapper.count() != qtVersionSizeValue - toRemoveIds.count()) { return false; } diff --git a/installerbuilder/libinstaller/updater.cpp b/installerbuilder/libinstaller/updater.cpp index 2e4b54e97..7b37521da 100644 --- a/installerbuilder/libinstaller/updater.cpp +++ b/installerbuilder/libinstaller/updater.cpp @@ -38,6 +38,7 @@ #include "init.h" #include "packagemanagercore.h" +#include #include #include @@ -62,7 +63,7 @@ bool Updater::checkForUpdates() content.registerEmbeddedQResources(); if (content.magicmaker() == MagicInstallerMarker) { - verbose() << tr("Impossible to use an installer to check for updates!") << std::endl; + qDebug() << "Impossible to use an installer to check for updates!"; return false; } @@ -76,7 +77,7 @@ bool Updater::checkForUpdates() const QList components = core.updaterComponents(); if (components.isEmpty()) { - verbose() << tr("There are currently no updates available.") << std::endl; + qDebug() << "There are currently no updates available."; return false; } diff --git a/tools/extractbinarydata/main.cpp b/tools/extractbinarydata/main.cpp index 460cd47c0..957864d3d 100644 --- a/tools/extractbinarydata/main.cpp +++ b/tools/extractbinarydata/main.cpp @@ -143,7 +143,7 @@ int main(int argc, char **argv) openForRead(&installerBase, installerBase.fileName()); writeMaintenanceBinary(arguments.at(1), &installerBase, installerBase.size()); } catch (const Error &error) { - verbose() << error.message() << std::endl; + qDebug() << error.message(); return EXIT_FAILURE; } @@ -154,7 +154,7 @@ int main(int argc, char **argv) openForRead(&input, input.fileName()); layout = BinaryContent::readBinaryLayout(&input, findMagicCookie(&input, MagicCookie)); } catch (const Error &error) { - verbose() << error.message() << std::endl; + qDebug() << error.message(); return EXIT_FAILURE; } @@ -179,7 +179,7 @@ int main(int argc, char **argv) file.close(); input.close(); } catch (const Error &error) { - verbose() << error.message() << std::endl; + qDebug() << error.message(); return EXIT_FAILURE; } } -- cgit v1.2.3