summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-02-21 17:48:50 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-04-01 10:59:41 (GMT)
commit7101a3fafb40cacb855ee07036ce4baacc5d202b (patch)
tree619cb68cf1dd716a3ee527e103bb4901853e409e
parent2365b2dfd57770875b6eefb165ec27f3bf65dd0c (diff)
downloadQt-7101a3fafb40cacb855ee07036ce4baacc5d202b.zip
Qt-7101a3fafb40cacb855ee07036ce4baacc5d202b.tar.gz
Qt-7101a3fafb40cacb855ee07036ce4baacc5d202b.tar.bz2
Compile with QStringBuilder and QByteArray
Reviewed-by: Denis
-rw-r--r--src/corelib/io/qprocess_unix.cpp4
-rw-r--r--src/corelib/kernel/qtranslator.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeproperty.cpp2
-rw-r--r--src/gui/styles/qstylehelper_p.h1
-rw-r--r--src/gui/text/qzip.cpp2
-rw-r--r--src/gui/util/qcompleter.cpp2
-rw-r--r--src/tools/moc/moc.cpp4
-rw-r--r--src/tools/moc/preprocessor.cpp2
8 files changed, 10 insertions, 9 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index ba61bda..b7505ce 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -493,8 +493,8 @@ static char **_q_dupEnvironment(const QHash<QByteArray, QByteArray> &environment
}
if (needToAddLibraryPath)
- envp[(*envc)++] = ::strdup(QByteArray(libraryPath) + '=' +
- envLibraryPath);
+ envp[(*envc)++] = ::strdup(QByteArray(QByteArray(libraryPath) + '=' +
+ envLibraryPath).constData());
return envp;
}
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index fcb455f..4e9e6ca 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -837,7 +837,7 @@ QString QTranslatorPrivate::do_translate(const char *context, const char *source
numerus = numerusHelper(n, numerusRulesArray, numerusRulesLength);
for (;;) {
- quint32 h = elfHash(QByteArray(sourceText) + comment);
+ quint32 h = elfHash(QByteArray(QByteArray(sourceText) + comment).constData());
const uchar *start = offsetArray;
const uchar *end = start + ((numItems-1) << 3);
diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp
index 0dd0edb..7f74da4 100644
--- a/src/declarative/qml/qdeclarativeproperty.cpp
+++ b/src/declarative/qml/qdeclarativeproperty.cpp
@@ -1029,7 +1029,7 @@ bool QDeclarativePropertyPrivate::writeEnumProperty(const QMetaProperty &prop, i
else
v = QVariant(menum.keyToValue(value.toByteArray()));
} else if (v.userType() != QVariant::Int && v.userType() != QVariant::UInt) {
- int enumMetaTypeId = QMetaType::type(QByteArray(menum.scope()) + "::" + menum.name());
+ int enumMetaTypeId = QMetaType::type(QByteArray(menum.scope() + QByteArray("::") + menum.name()));
if ((enumMetaTypeId == 0) || (v.userType() != enumMetaTypeId) || !v.constData())
return false;
v = QVariant(*reinterpret_cast<const int *>(v.constData()));
diff --git a/src/gui/styles/qstylehelper_p.h b/src/gui/styles/qstylehelper_p.h
index 559f7f7..27587e3 100644
--- a/src/gui/styles/qstylehelper_p.h
+++ b/src/gui/styles/qstylehelper_p.h
@@ -110,6 +110,7 @@ template <typename T>
enum { ExactSize = true };
static int size(const HexString<T> &) { return sizeof(T) * 2; }
static inline void appendTo(const HexString<T> &str, QChar *&out) { str.write(out); }
+ typedef QString ConvertTo;
};
QT_END_NAMESPACE
diff --git a/src/gui/text/qzip.cpp b/src/gui/text/qzip.cpp
index 0f7edae..9f21886 100644
--- a/src/gui/text/qzip.cpp
+++ b/src/gui/text/qzip.cpp
@@ -572,7 +572,7 @@ void QZipWriterPrivate::addEntry(EntryType type, const QString &fileName, const
"directory",
"file ",
"symlink " };
- ZDEBUG() << "adding" << entryTypes[type] <<":" << fileName.toUtf8().data() << (type == 2 ? (" -> " + contents).constData() : "");
+ ZDEBUG() << "adding" << entryTypes[type] <<":" << fileName.toUtf8().data() << (type == 2 ? QByteArray(" -> " + contents).constData() : "");
#endif
if (! (device->isOpen() || device->open(QIODevice::WriteOnly))) {
diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp
index 27684bf..0cb3bbd 100644
--- a/src/gui/util/qcompleter.cpp
+++ b/src/gui/util/qcompleter.cpp
@@ -926,7 +926,7 @@ void QCompleterPrivate::_q_fileSystemModelDirectoryLoaded(const QString &path)
// If we hide the popup because there was no match because the model was not loaded yet,
// we re-start the completion when we get the results
if (hiddenBecauseNoMatch
- && prefix.startsWith(path) && prefix != (path + '/')
+ && prefix.startsWith(path) && prefix != (path + QLatin1Char('/'))
&& widget) {
q->complete();
}
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 5078b28..4a2ba68 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -292,8 +292,8 @@ void Moc::parseFunctionArguments(FunctionDef *def)
arg.rightType += ' ';
arg.rightType += lexem();
}
- arg.normalizedType = normalizeType(arg.type.name + ' ' + arg.rightType);
- arg.typeNameForCast = normalizeType(noRef(arg.type.name) + "(*)" + arg.rightType);
+ arg.normalizedType = normalizeType(QByteArray(arg.type.name + ' ' + arg.rightType));
+ arg.typeNameForCast = normalizeType(QByteArray(noRef(arg.type.name) + "(*)" + arg.rightType));
if (test(EQ))
arg.isDefault = true;
def->arguments += arg;
diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp
index 6410d40..fbea82d 100644
--- a/src/tools/moc/preprocessor.cpp
+++ b/src/tools/moc/preprocessor.cpp
@@ -807,7 +807,7 @@ void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed)
continue;
QByteArray frameworkCandidate = include.left(slashPos);
frameworkCandidate.append(".framework/Headers/");
- fi.setFile(QString::fromLocal8Bit(p.path + '/' + frameworkCandidate), QString::fromLocal8Bit(include.mid(slashPos + 1)));
+ fi.setFile(QString::fromLocal8Bit(QByteArray(p.path + '/' + frameworkCandidate)), QString::fromLocal8Bit(include.mid(slashPos + 1)));
} else {
fi.setFile(QString::fromLocal8Bit(p.path), QString::fromLocal8Bit(include));
}