summaryrefslogtreecommitdiffstats
path: root/src/tools/rcc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rcc')
-rw-r--r--src/tools/rcc/main.cpp15
-rw-r--r--src/tools/rcc/rcc.cpp5
2 files changed, 12 insertions, 8 deletions
diff --git a/src/tools/rcc/main.cpp b/src/tools/rcc/main.cpp
index d09d36c659..fba47b74c3 100644
--- a/src/tools/rcc/main.cpp
+++ b/src/tools/rcc/main.cpp
@@ -32,6 +32,7 @@
#include <qdir.h>
#include <qfile.h>
#include <qfileinfo.h>
+#include <qhashfunctions.h>
#include <qtextstream.h>
#include <qatomic.h>
#include <qglobal.h>
@@ -276,7 +277,8 @@ int runRcc(int argc, char *argv[])
} else {
out.setFileName(outFilename);
if (!out.open(mode)) {
- const QString msg = QString::fromLatin1("Unable to open %1 for writing: %2\n").arg(outFilename).arg(out.errorString());
+ const QString msg = QString::fromLatin1("Unable to open %1 for writing: %2\n")
+ .arg(outFilename, out.errorString());
errorDevice.write(msg.toUtf8());
return 1;
}
@@ -297,7 +299,7 @@ int runRcc(int argc, char *argv[])
temp.setFileName(tempFilename);
if (!temp.open(QIODevice::ReadOnly)) {
const QString msg = QString::fromUtf8("Unable to open temporary file %1 for reading: %2\n")
- .arg(outFilename).arg(out.errorString());
+ .arg(outFilename, out.errorString());
errorDevice.write(msg.toUtf8());
return 1;
}
@@ -311,16 +313,17 @@ int runRcc(int argc, char *argv[])
return 0;
}
-Q_CORE_EXPORT extern QBasicAtomicInt qt_qhash_seed; // from qhash.cpp
-
QT_END_NAMESPACE
int main(int argc, char *argv[])
{
// rcc uses a QHash to store files in the resource system.
// we must force a certain hash order when testing or tst_rcc will fail, see QTBUG-25078
- if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QT_RCC_TEST") && !qt_qhash_seed.testAndSetRelaxed(-1, 0)))
- qFatal("Cannot force QHash seed for testing as requested");
+ if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QT_RCC_TEST"))) {
+ qSetGlobalQHashSeed(0);
+ if (qGlobalQHashSeed() != 0)
+ qFatal("Cannot force QHash seed for testing as requested");
+ }
return QT_PREPEND_NAMESPACE(runRcc)(argc, argv);
}
diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp
index 26dacc48ec..84fe6ef5c7 100644
--- a/src/tools/rcc/rcc.cpp
+++ b/src/tools/rcc/rcc.cpp
@@ -73,7 +73,7 @@ void RCCResourceLibrary::writeByteArray(const QByteArray &other)
static inline QString msgOpenReadFailed(const QString &fname, const QString &why)
{
- return QString::fromLatin1("Unable to open %1 for reading: %2\n").arg(fname).arg(why);
+ return QString::fromLatin1("Unable to open %1 for reading: %2\n").arg(fname, why);
}
@@ -502,7 +502,8 @@ bool RCCResourceLibrary::interpretResourceFile(QIODevice *inputDevice,
QFileInfo file(absFileName);
if (!file.exists()) {
m_failedResources.push_back(absFileName);
- const QString msg = QString::fromLatin1("RCC: Error in '%1': Cannot find file '%2'\n").arg(fname).arg(fileName);
+ const QString msg = QString::fromLatin1("RCC: Error in '%1': Cannot find file '%2'\n")
+ .arg(fname, fileName);
m_errorDevice->write(msg.toUtf8());
if (ignoreErrors)
continue;