summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-22 11:46:44 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-22 11:46:44 (GMT)
commitf1293735a4e828ec08931a2aa85ba96405ac3f76 (patch)
tree2b1a1c2e3eeb36fe4dfb549585e67039fa5b2db5
parent69b1784edb6dd82f26100d0e539bfa8a65bdd35d (diff)
parentfae5e14b5ac5fed5922e5193d0f40c29bd1e0289 (diff)
downloadQt-f1293735a4e828ec08931a2aa85ba96405ac3f76.zip
Qt-f1293735a4e828ec08931a2aa85ba96405ac3f76.tar.gz
Qt-f1293735a4e828ec08931a2aa85ba96405ac3f76.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Compilation fix for AIX Fix build on Mac OS X Fix compilation Fix compilation on Windows Copy useBackendOptimization setting when QStaticText is detached Compilation on symbian Enable QT_USE_FAST_CONCATENATION by default for compiling Qt Compile with QT_USE_FAST_OPERATOR_PLUS QStringBuilder: Do not resize if not required. QStringBuilder: reduce the size of the generated code
-rw-r--r--src/3rdparty/libpng/png.h2
-rw-r--r--src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp4
-rw-r--r--src/corelib/global/qlibraryinfo.cpp2
-rw-r--r--src/corelib/io/qurl.cpp2
-rw-r--r--src/corelib/tools/qlocale_symbian.cpp6
-rw-r--r--src/corelib/tools/qstring.h10
-rw-r--r--src/corelib/tools/qstringbuilder.h40
-rw-r--r--src/gui/text/qstatictext.cpp2
-rw-r--r--src/qbase.pri1
-rw-r--r--src/qt3support/text/q3textedit.cpp2
-rw-r--r--tools/assistant/lib/qhelpdbreader.cpp2
12 files changed, 58 insertions, 17 deletions
diff --git a/src/3rdparty/libpng/png.h b/src/3rdparty/libpng/png.h
index 14e3416..5ea2b0d 100644
--- a/src/3rdparty/libpng/png.h
+++ b/src/3rdparty/libpng/png.h
@@ -386,7 +386,7 @@
#include "zlib.h"
#endif
-#ifdef AIX
+#ifdef _AIX
#define jmpbuf __jmpbuf
#endif
diff --git a/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp b/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp
index 79fc51e..5c87fe6 100644
--- a/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp
+++ b/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp
@@ -368,7 +368,7 @@ static inline void handleElementNamespaces(Element* newElement, const QXmlStream
for (int i = 0; i < ns.count(); ++i) {
const QXmlStreamNamespaceDeclaration &decl = ns[i];
String namespaceURI = decl.namespaceUri();
- String namespaceQName = decl.prefix().isEmpty() ? String("xmlns") : String("xmlns:") + decl.prefix();
+ String namespaceQName = decl.prefix().isEmpty() ? String("xmlns") : String("xmlns:") + String(decl.prefix());
newElement->setAttributeNS("http://www.w3.org/2000/xmlns/", namespaceQName, namespaceURI, ec);
if (ec) // exception setting attributes
return;
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index 7a1bfd5..5fbc876 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -179,7 +179,7 @@ void InspectorClientQt::populateSetting(const String& key, InspectorController::
return;
}
- QString settingKey(settingStoragePrefix + key);
+ QString settingKey(settingStoragePrefix + QString(key));
QString storedValueType = qsettings.value(settingKey + settingStorageTypeSuffix).toString();
QVariant storedValue = qsettings.value(settingKey);
storedValue.convert(QVariant::nameToType(storedValueType.toAscii().data()));
@@ -196,7 +196,7 @@ void InspectorClientQt::storeSetting(const String& key, const InspectorControlle
}
QVariant valueToStore = settingToVariant(setting);
- QString settingKey(settingStoragePrefix + key);
+ QString settingKey(settingStoragePrefix + QString(key));
qsettings.setValue(settingKey, valueToStore);
qsettings.setValue(settingKey + settingStorageTypeSuffix, QVariant::typeToName(valueToStore.type()));
}
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index a9ea44a..d5041c9 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -439,7 +439,7 @@ QLibraryInfo::location(LibraryLocation loc)
QCFType<CFURLRef> urlRef = CFBundleCopyBundleURL(bundleRef);
if (urlRef) {
QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
- return QDir::cleanPath(path + QLatin1String("/Contents/") + ret);
+ return QDir::cleanPath(QString(path) + QLatin1String("/Contents/") + ret);
}
}
#endif
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 076cc33..0290fb8 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -6348,7 +6348,7 @@ QUrl QUrl::fromUserInput(const QString &userInput)
return QUrl::fromLocalFile(trimmedString);
QUrl url = QUrl::fromEncoded(trimmedString.toUtf8(), QUrl::TolerantMode);
- QUrl urlPrepended = QUrl::fromEncoded((QLatin1String("http://") + trimmedString).toUtf8(), QUrl::TolerantMode);
+ QUrl urlPrepended = QUrl::fromEncoded("http://" + trimmedString.toUtf8(), QUrl::TolerantMode);
// Check the most common case of a valid url with scheme and host
// We check if the port would be valid by adding the scheme to handle the case host:port
diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp
index b1a7caa..58e3ba8 100644
--- a/src/corelib/tools/qlocale_symbian.cpp
+++ b/src/corelib/tools/qlocale_symbian.cpp
@@ -841,7 +841,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
return symbianTimeFormat();
case DateTimeFormatLong:
case DateTimeFormatShort:
- return symbianDateFormat( (type == DateTimeFormatShort) ) + QLatin1Char(' ') + symbianTimeFormat();
+ return QString(symbianDateFormat( (type == DateTimeFormatShort) ) + QLatin1Char(' ') + symbianTimeFormat());
case DateToStringShort:
case DateToStringLong:
return symbianDateToString(in.toDate(), (type == DateToStringShort) );
@@ -851,8 +851,8 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
case DateTimeToStringShort:
case DateTimeToStringLong: {
const QDateTime dt = in.toDateTime();
- return symbianDateToString(dt.date(), (type == DateTimeToStringShort) )
- + QLatin1Char(' ') + symbianTimeToString(dt.time());
+ return QString(symbianDateToString(dt.date(), (type == DateTimeToStringShort) )
+ + QLatin1Char(' ') + symbianTimeToString(dt.time()));
}
case MeasurementSystem:
return static_cast<int>(symbianMeasurementSystem());
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 8de3c7d..a59c0bd 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -73,6 +73,16 @@ typedef std::basic_string<wchar_t> QStdWString;
#error qstring.h must be included before any header file that defines truncate
#endif
+#if defined(Q_CC_GNU) && (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
+//There is a bug in GCC 4.0 that tries to instantiate template of annonymous enum
+# ifdef QT_USE_FAST_OPERATOR_PLUS
+# undef QT_USE_FAST_OPERATOR_PLUS
+# endif
+# ifdef QT_USE_FAST_CONCATENATION
+# undef QT_USE_FAST_CONCATENATION
+# endif
+#endif
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index 74661c2..9fe3fd7 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -100,14 +100,18 @@ public:
operator QString() const
{
- QString s(QConcatenable< QStringBuilder<A, B> >::size(*this),
- Qt::Uninitialized);
+ const uint size = QConcatenable< QStringBuilder<A, B> >::size(*this);
+ QString s(size, Qt::Uninitialized);
QChar *d = s.data();
+ const QChar * const start = d;
QConcatenable< QStringBuilder<A, B> >::appendTo(*this, d);
- // this resize is necessary since we allocate a bit too much
- // when dealing with variable sized 8-bit encodings
- s.resize(d - s.data());
+
+ if (!QConcatenable< QStringBuilder<A, B> >::ExactSize && size != d - start) {
+ // this resize is necessary since we allocate a bit too much
+ // when dealing with variable sized 8-bit encodings
+ s.resize(d - start);
+ }
return s;
}
QByteArray toLatin1() const { return QString(*this).toLatin1(); }
@@ -116,10 +120,24 @@ public:
const B &b;
};
+template <>
+class QStringBuilder <QString, QString>
+{
+ public:
+ QStringBuilder(const QString &a_, const QString &b_) : a(a_), b(b_) {}
+
+ operator QString() const
+ { QString r(a); r += b; return r; }
+ QByteArray toLatin1() const { return QString(*this).toLatin1(); }
+
+ const QString &a;
+ const QString &b;
+};
template <> struct QConcatenable<char> : private QAbstractConcatenable
{
typedef char type;
+ enum { ExactSize = true };
static int size(const char) { return 1; }
static inline void appendTo(const char c, QChar *&out)
{
@@ -130,6 +148,7 @@ template <> struct QConcatenable<char> : private QAbstractConcatenable
template <> struct QConcatenable<QLatin1Char>
{
typedef QLatin1Char type;
+ enum { ExactSize = true };
static int size(const QLatin1Char) { return 1; }
static inline void appendTo(const QLatin1Char c, QChar *&out)
{
@@ -140,6 +159,7 @@ template <> struct QConcatenable<QLatin1Char>
template <> struct QConcatenable<QChar>
{
typedef QChar type;
+ enum { ExactSize = true };
static int size(const QChar) { return 1; }
static inline void appendTo(const QChar c, QChar *&out)
{
@@ -150,6 +170,7 @@ template <> struct QConcatenable<QChar>
template <> struct QConcatenable<QCharRef>
{
typedef QCharRef type;
+ enum { ExactSize = true };
static int size(const QCharRef &) { return 1; }
static inline void appendTo(const QCharRef &c, QChar *&out)
{
@@ -160,6 +181,7 @@ template <> struct QConcatenable<QCharRef>
template <> struct QConcatenable<QLatin1String>
{
typedef QLatin1String type;
+ enum { ExactSize = true };
static int size(const QLatin1String &a) { return qstrlen(a.latin1()); }
static inline void appendTo(const QLatin1String &a, QChar *&out)
{
@@ -172,6 +194,7 @@ template <> struct QConcatenable<QLatin1String>
template <> struct QConcatenable<QLatin1Literal>
{
typedef QLatin1Literal type;
+ enum { ExactSize = true };
static int size(const QLatin1Literal &a) { return a.size(); }
static inline void appendTo(const QLatin1Literal &a, QChar *&out)
{
@@ -183,6 +206,7 @@ template <> struct QConcatenable<QLatin1Literal>
template <> struct QConcatenable<QString>
{
typedef QString type;
+ enum { ExactSize = true };
static int size(const QString &a) { return a.size(); }
static inline void appendTo(const QString &a, QChar *&out)
{
@@ -195,6 +219,7 @@ template <> struct QConcatenable<QString>
template <> struct QConcatenable<QStringRef>
{
typedef QStringRef type;
+ enum { ExactSize = true };
static int size(const QStringRef &a) { return a.size(); }
static inline void appendTo(QStringRef a, QChar *&out)
{
@@ -208,6 +233,7 @@ template <> struct QConcatenable<QStringRef>
template <int N> struct QConcatenable<char[N]> : private QAbstractConcatenable
{
typedef char type[N];
+ enum { ExactSize = false };
static int size(const char[N])
{
return N - 1;
@@ -221,6 +247,7 @@ template <int N> struct QConcatenable<char[N]> : private QAbstractConcatenable
template <int N> struct QConcatenable<const char[N]> : private QAbstractConcatenable
{
typedef const char type[N];
+ enum { ExactSize = false };
static int size(const char[N]) { return N - 1; }
static inline void appendTo(const char a[N], QChar *&out)
{
@@ -231,6 +258,7 @@ template <int N> struct QConcatenable<const char[N]> : private QAbstractConcaten
template <> struct QConcatenable<const char *> : private QAbstractConcatenable
{
typedef char const *type;
+ enum { ExactSize = false };
static int size(const char *a) { return qstrlen(a); }
static inline void appendTo(const char *a, QChar *&out)
{
@@ -241,6 +269,7 @@ template <> struct QConcatenable<const char *> : private QAbstractConcatenable
template <> struct QConcatenable<QByteArray> : private QAbstractConcatenable
{
typedef QByteArray type;
+ enum { ExactSize = false };
static int size(const QByteArray &ba) { return qstrnlen(ba.constData(), ba.size()); }
static inline void appendTo(const QByteArray &ba, QChar *&out)
{
@@ -253,6 +282,7 @@ template <typename A, typename B>
struct QConcatenable< QStringBuilder<A, B> >
{
typedef QStringBuilder<A, B> type;
+ enum { ExactSize = QConcatenable<A>::ExactSize && QConcatenable<B>::ExactSize };
static int size(const type &p)
{
return QConcatenable<A>::size(p.a) + QConcatenable<B>::size(p.b);
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index a7138b9..952d998 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -356,7 +356,7 @@ QStaticTextPrivate::QStaticTextPrivate()
QStaticTextPrivate::QStaticTextPrivate(const QStaticTextPrivate &other)
: text(other.text), font(other.font), maximumSize(other.maximumSize), matrix(other.matrix),
items(0), itemCount(0), glyphPool(0), positionPool(0), needsClipRect(false),
- useBackendOptimizations(false), textFormat(other.textFormat)
+ useBackendOptimizations(other.useBackendOptimizations), textFormat(other.textFormat)
{
ref = 1;
}
diff --git a/src/qbase.pri b/src/qbase.pri
index ef5d9e5..835ed0e 100644
--- a/src/qbase.pri
+++ b/src/qbase.pri
@@ -157,6 +157,7 @@ contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE
DEFINES *= QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS
contains(QT_CONFIG, qt3support):DEFINES *= QT3_SUPPORT
DEFINES *= QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code
+DEFINES *= QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION
TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end
diff --git a/src/qt3support/text/q3textedit.cpp b/src/qt3support/text/q3textedit.cpp
index 7f51bea..d4f75ed 100644
--- a/src/qt3support/text/q3textedit.cpp
+++ b/src/qt3support/text/q3textedit.cpp
@@ -6238,7 +6238,7 @@ void Q3TextEdit::optimParseTags(QString * line, int lineNo, int indexOffset)
} else {
tmp = tagStack.isEmpty() ? 0 : tagStack.pop();
if (!tmp) {
- if (((QLatin1Char('/') + cur->tag) == tag->tag) ||
+ if ((QString(QLatin1Char('/') + cur->tag) == tag->tag) ||
(tag->tag == QLatin1String("/font") && cur->tag.left(4) == QLatin1String("font"))) {
// set up the left and parent of this tag
tag->leftTag = cur;
diff --git a/tools/assistant/lib/qhelpdbreader.cpp b/tools/assistant/lib/qhelpdbreader.cpp
index 6dd949a..5c0f595 100644
--- a/tools/assistant/lib/qhelpdbreader.cpp
+++ b/tools/assistant/lib/qhelpdbreader.cpp
@@ -205,7 +205,7 @@ QByteArray QHelpDBReader::fileData(const QString &virtualFolder,
"NamespaceTable d WHERE a.Id=b.FileId AND (b.Name=? OR b.Name=?) AND b.FolderId=c.Id "
"AND c.Name=? AND c.NamespaceId=d.Id AND d.Name=?"));
m_query->bindValue(0, filePath);
- m_query->bindValue(1, QLatin1String("./") + filePath);
+ m_query->bindValue(1, QString(QLatin1String("./") + filePath));
m_query->bindValue(2, virtualFolder);
m_query->bindValue(3, m_namespace);
m_query->exec();