diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/binarycreator/binarycreator.cpp | 2 | ||||
-rw-r--r-- | tools/binarycreator/rcc/rcc.cpp | 12 | ||||
-rw-r--r-- | tools/devtool/binarydump.cpp | 2 | ||||
-rw-r--r-- | tools/devtool/main.cpp | 16 | ||||
-rw-r--r-- | tools/repocompare/repositorymanager.cpp | 6 |
5 files changed, 24 insertions, 14 deletions
diff --git a/tools/binarycreator/binarycreator.cpp b/tools/binarycreator/binarycreator.cpp index 3ce7db3f2..5de4ff745 100644 --- a/tools/binarycreator/binarycreator.cpp +++ b/tools/binarycreator/binarycreator.cpp @@ -546,7 +546,7 @@ QT_END_NAMESPACE static int runRcc(const QStringList &args) { const int argc = args.count(); - QVector<char*> argv(argc, 0); + QVector<char*> argv(argc, nullptr); for (int i = 0; i < argc; ++i) argv[i] = qstrdup(qPrintable(args[i])); diff --git a/tools/binarycreator/rcc/rcc.cpp b/tools/binarycreator/rcc/rcc.cpp index 2361e43e0..10b7cbc4f 100644 --- a/tools/binarycreator/rcc/rcc.cpp +++ b/tools/binarycreator/rcc/rcc.cpp @@ -126,7 +126,7 @@ RCCFileInfo::RCCFileInfo(const QString &name, const QFileInfo &fileInfo, m_language = language; m_country = country; m_flags = flags; - m_parent = 0; + m_parent = nullptr; m_nameOffset = 0; m_dataOffset = 0; m_childOffset = 0; @@ -325,7 +325,7 @@ RCCResourceLibrary::Strings::Strings() : } RCCResourceLibrary::RCCResourceLibrary() - : m_root(0), + : m_root(nullptr), m_format(C_Code), m_verbose(false), m_compressLevel(CONSTANT_COMPRESSLEVEL_DEFAULT), @@ -334,7 +334,7 @@ RCCResourceLibrary::RCCResourceLibrary() m_namesOffset(0), m_dataOffset(0), m_useNameSpace(CONSTANT_USENAMESPACE), - m_errorDevice(0) + m_errorDevice(nullptr) { m_out.reserve(30 * 1000 * 1000); } @@ -550,7 +550,7 @@ bool RCCResourceLibrary::interpretResourceFile(QIODevice *inputDevice, return false; } - if (m_root == 0) { + if (m_root == nullptr) { const QString msg = QString::fromUtf8("RCC: Warning: No resources in '%1'.\n").arg(fname); m_errorDevice->write(msg.toUtf8()); if (!ignoreErrors && m_format == Binary) { @@ -606,9 +606,9 @@ void RCCResourceLibrary::reset() { if (m_root) { delete m_root; - m_root = 0; + m_root = nullptr; } - m_errorDevice = 0; + m_errorDevice = nullptr; m_failedResources.clear(); } diff --git a/tools/devtool/binarydump.cpp b/tools/devtool/binarydump.cpp index ad5093837..bd8e9053c 100644 --- a/tools/devtool/binarydump.cpp +++ b/tools/devtool/binarydump.cpp @@ -54,7 +54,7 @@ int BinaryDump::dump(const QInstaller::ResourceCollectionManager &manager, const } } - QInstaller::CopyDirectoryOperation copyMetadata(0); + QInstaller::CopyDirectoryOperation copyMetadata(nullptr); copyMetadata.setArguments(QStringList() << QLatin1String(":/") << (targetDir.path() + QLatin1Char('/'))); // Add "/" at the end to make operation work. if (!copyMetadata.performOperation()) { diff --git a/tools/devtool/main.cpp b/tools/devtool/main.cpp index e0b31695c..d75ab4e81 100644 --- a/tools/devtool/main.cpp +++ b/tools/devtool/main.cpp @@ -165,8 +165,16 @@ int main(int argc, char *argv[]) QString bundlePath; QString path = QFileInfo(arguments.first()).absoluteFilePath(); - if (QInstaller::isInBundle(path, &bundlePath)) + if (QInstaller::isInBundle(path, &bundlePath)) { path = QDir(bundlePath).filePath(QLatin1String("Contents/Resources/installer.dat")); + } +#ifndef Q_OS_OSX + QFileInfo fi = QFileInfo(path); + bundlePath = path; + QString tmp = QDir(fi.path()).filePath(QLatin1String("installer.dat")); + if (QFileInfo::exists(tmp)) + path = tmp; +#endif int result = EXIT_FAILURE; QVector<QByteArray> resourceMappings; @@ -184,8 +192,10 @@ int main(int argc, char *argv[]) if (layout.magicMarker == QInstaller::BinaryContent::MagicUninstallerMarker) { QFileInfo fi(path); - if (QInstaller::isInBundle(fi.absoluteFilePath(), &bundlePath)) - fi.setFile(bundlePath); + + QInstaller::isInBundle(fi.absoluteFilePath(), &bundlePath); + fi.setFile(bundlePath); + path = fi.absolutePath() + QLatin1Char('/') + fi.baseName() + QLatin1String(".dat"); tmp.close(); diff --git a/tools/repocompare/repositorymanager.cpp b/tools/repocompare/repositorymanager.cpp index 7d24b9620..3fb863eaf 100644 --- a/tools/repocompare/repositorymanager.cpp +++ b/tools/repocompare/repositorymanager.cpp @@ -71,7 +71,7 @@ void RepositoryManager::setProductionRepository(const QString &repo) { QUrl url(repo); if (!url.isValid()) { - QMessageBox::critical(0, QLatin1String("Error"), QLatin1String("Specified URL is not valid")); + QMessageBox::critical(nullptr, QLatin1String("Error"), QLatin1String("Specified URL is not valid")); return; } @@ -83,7 +83,7 @@ void RepositoryManager::setUpdateRepository(const QString &repo) { QUrl url(repo); if (!url.isValid()) { - QMessageBox::critical(0, QLatin1String("Error"), QLatin1String("Specified URL is not valid")); + QMessageBox::critical(nullptr, QLatin1String("Error"), QLatin1String("Specified URL is not valid")); return; } @@ -181,7 +181,7 @@ void RepositoryManager::writeUpdateFile(const QString &fileName) { QFile file(fileName); if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate)) { - QMessageBox::critical(0, QLatin1String("Error"), + QMessageBox::critical(nullptr, QLatin1String("Error"), QString::fromLatin1("Cannot open file \"%1\" for writing: %2").arg( QDir::toNativeSeparators(fileName), file.errorString())); return; |