summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-09-25 11:05:11 +0200
committerSergio Ahumada <sergio.ahumada@digia.com>2013-09-25 11:06:54 +0200
commit3e346b869c998b5fd5897e0b14c2f583dd0caa3b (patch)
tree0a7effd3fe0cf13e0494d677437d6e7469995050 /src/corelib
parent7c35824e6b855d134f51d46a0da8aaa900cd0b2e (diff)
parent0b1e30aee41cbbe487cd072268cf784f8b09bcdf (diff)
Merge branch 'stable' into dev
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/animation/qvariantanimation.cpp4
-rw-r--r--src/corelib/codecs/qeuckrcodec.cpp6
-rw-r--r--src/corelib/global/qfeatures.h8
-rw-r--r--src/corelib/global/qlogging.cpp4
-rw-r--r--src/corelib/io/qurlidna.cpp9
-rw-r--r--src/corelib/tools/qchar.cpp4
-rw-r--r--src/corelib/tools/qdatetime.cpp2
-rw-r--r--src/corelib/tools/qregexp.cpp2
-rw-r--r--src/corelib/tools/qtimezone.cpp8
-rw-r--r--src/corelib/tools/tools.pri2
10 files changed, 34 insertions, 15 deletions
diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp
index a6d013b11a..a23a6a7cda 100644
--- a/src/corelib/animation/qvariantanimation.cpp
+++ b/src/corelib/animation/qvariantanimation.cpp
@@ -310,8 +310,8 @@ void QVariantAnimationPrivate::setCurrentValueForProgress(const qreal progress)
QVariant QVariantAnimationPrivate::valueAt(qreal step) const
{
QVariantAnimation::KeyValues::const_iterator result =
- qBinaryFind(keyValues.begin(), keyValues.end(), qMakePair(step, QVariant()), animationValueLessThan);
- if (result != keyValues.constEnd())
+ std::lower_bound(keyValues.constBegin(), keyValues.constEnd(), qMakePair(step, QVariant()), animationValueLessThan);
+ if (result != keyValues.constEnd() && !animationValueLessThan(qMakePair(step, QVariant()), *result))
return result->second;
return QVariant();
diff --git a/src/corelib/codecs/qeuckrcodec.cpp b/src/corelib/codecs/qeuckrcodec.cpp
index 20ba1e85d6..873b782378 100644
--- a/src/corelib/codecs/qeuckrcodec.cpp
+++ b/src/corelib/codecs/qeuckrcodec.cpp
@@ -70,6 +70,8 @@
#include "qeuckrcodec_p.h"
#include "cp949codetbl_p.h"
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_BIG_CODECS
@@ -3383,8 +3385,8 @@ QByteArray QCP949Codec::convertFromUnicode(const QChar *uc, int len, ConverterSt
*cursor++ = (j >> 8) | 0x80;
*cursor++ = (j & 0xff) | 0x80;
} else {
- const unsigned short *ptr = qBinaryFind(cp949_icode_to_unicode, cp949_icode_to_unicode + 8822, ch);
- if (ptr == cp949_icode_to_unicode + 8822) {
+ const unsigned short *ptr = std::lower_bound(cp949_icode_to_unicode, cp949_icode_to_unicode + 8822, ch);
+ if (ptr == cp949_icode_to_unicode + 8822 || ch < *ptr) {
// Error
*cursor++ = replacement;
++invalid;
diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h
index 2cadea59c1..ba84dd109e 100644
--- a/src/corelib/global/qfeatures.h
+++ b/src/corelib/global/qfeatures.h
@@ -115,6 +115,9 @@
// Image Text
//#define QT_NO_IMAGE_TEXT
+// QKeySequenceEdit
+//#define QT_NO_KEYSEQUENCEEDIT
+
// QLCDNumber
//#define QT_NO_LCDNUMBER
@@ -306,6 +309,11 @@
#define QT_NO_IMAGEFORMATPLUGIN
#endif
+// QKeySequenceEdit
+#if !defined(QT_NO_KEYSEQUENCEEDIT) && (defined(QT_NO_SHORTCUT))
+#define QT_NO_KEYSEQUENCEEDIT
+#endif
+
// QLocalServer
#if !defined(QT_NO_LOCALSERVER) && (defined(QT_NO_TEMPORARYFILE))
#define QT_NO_LOCALSERVER
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 1cd11ad667..4d564b09c3 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -184,14 +184,14 @@ static void qEmergencyOut(QtMsgType msgType, const char *msg, va_list ap) Q_DECL
OutputDebugStringW(emergency_bufL);
# else
if (qWinLogToStderr()) {
- fprintf(stderr, "%s", emergency_buf);
+ fprintf(stderr, "%s\n", emergency_buf);
fflush(stderr);
} else {
OutputDebugStringA(emergency_buf);
}
# endif
#else
- fprintf(stderr, "%s", emergency_buf);
+ fprintf(stderr, "%s\n", emergency_buf);
fflush(stderr);
#endif
diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp
index e959faccd2..ee95e590f9 100644
--- a/src/corelib/io/qurlidna.cpp
+++ b/src/corelib/io/qurlidna.cpp
@@ -42,6 +42,7 @@
#include "qurl_p.h"
#include <QtCore/qstringlist.h>
+#include <algorithm>
QT_BEGIN_NAMESPACE
@@ -1461,10 +1462,10 @@ static void mapToLowerCase(QString *str, int from)
++i;
}
}
- const NameprepCaseFoldingEntry *entry = qBinaryFind(NameprepCaseFolding,
- NameprepCaseFolding + N,
- uc);
- if ((entry - NameprepCaseFolding) != N) {
+ const NameprepCaseFoldingEntry *entry = std::lower_bound(NameprepCaseFolding,
+ NameprepCaseFolding + N,
+ uc);
+ if ((entry != NameprepCaseFolding + N) && !(uc < *entry)) {
int l = 1;
while (l < 4 && entry->mapping[l])
++l;
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp
index ff17a52a75..d99bba93ee 100644
--- a/src/corelib/tools/qchar.cpp
+++ b/src/corelib/tools/qchar.cpp
@@ -1680,6 +1680,8 @@ struct UCS2Pair {
ushort u2;
};
+inline bool operator<(const UCS2Pair &ligature1, const UCS2Pair &ligature2)
+{ return ligature1.u1 < ligature2.u1; }
inline bool operator<(ushort u1, const UCS2Pair &ligature)
{ return u1 < ligature.u1; }
inline bool operator<(const UCS2Pair &ligature, ushort u1)
@@ -1690,6 +1692,8 @@ struct UCS2SurrogatePair {
UCS2Pair p2;
};
+inline bool operator<(const UCS2SurrogatePair &ligature1, const UCS2SurrogatePair &ligature2)
+{ return QChar::surrogateToUcs4(ligature1.p1.u1, ligature1.p1.u2) < QChar::surrogateToUcs4(ligature2.p1.u1, ligature2.p1.u2); }
inline bool operator<(uint u1, const UCS2SurrogatePair &ligature)
{ return u1 < QChar::surrogateToUcs4(ligature.p1.u1, ligature.p1.u2); }
inline bool operator<(const UCS2SurrogatePair &ligature, uint u1)
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index ac9639385a..d64d929d5a 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -4898,7 +4898,7 @@ QDebug operator<<(QDebug dbg, const QDateTime &date)
break;
case Qt::TimeZone:
#ifndef QT_BOOTSTRAPPED
- spec = QStringLiteral(" Qt::TimeZone ") + date.timeZone().id();
+ spec = QStringLiteral(" Qt::TimeZone ") + QString::fromLatin1(date.timeZone().id());
break;
#endif // QT_BOOTSTRAPPED
case Qt::LocalTime:
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index c0cd419c53..ef2dba5700 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -2883,6 +2883,8 @@ static const struct CategoriesRangeMapEntry {
{ "YijingHexagramSymbols", 0x4DC0, 0x4DFF }
};
+inline bool operator<(const CategoriesRangeMapEntry &entry1, const CategoriesRangeMapEntry &entry2)
+{ return qstrcmp(entry1.name, entry2.name) < 0; }
inline bool operator<(const char *name, const CategoriesRangeMapEntry &entry)
{ return qstrcmp(name, entry.name) < 0; }
inline bool operator<(const CategoriesRangeMapEntry &entry, const char *name)
diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp
index f5f2b28b88..cdd0aba102 100644
--- a/src/corelib/tools/qtimezone.cpp
+++ b/src/corelib/tools/qtimezone.cpp
@@ -47,6 +47,8 @@
#include <qdebug.h>
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
// Create default time zone using appropriate backend
@@ -781,7 +783,7 @@ QList<QByteArray> QTimeZone::availableTimeZoneIds()
QSet<QByteArray> set = QUtcTimeZonePrivate().availableTimeZoneIds()
+ global_tz->backend->availableTimeZoneIds();
QList<QByteArray> list = set.toList();
- qSort(list);
+ std::sort(list.begin(), list.end());
return list;
}
@@ -801,7 +803,7 @@ QList<QByteArray> QTimeZone::availableTimeZoneIds(QLocale::Country country)
QSet<QByteArray> set = QUtcTimeZonePrivate().availableTimeZoneIds(country)
+ global_tz->backend->availableTimeZoneIds(country);
QList<QByteArray> list = set.toList();
- qSort(list);
+ std::sort(list.begin(), list.end());
return list;
}
@@ -817,7 +819,7 @@ QList<QByteArray> QTimeZone::availableTimeZoneIds(int offsetSeconds)
QSet<QByteArray> set = QUtcTimeZonePrivate().availableTimeZoneIds(offsetSeconds)
+ global_tz->backend->availableTimeZoneIds(offsetSeconds);
QList<QByteArray> list = set.toList();
- qSort(list);
+ std::sort(list.begin(), list.end());
return list;
}
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index e38bea3181..e043a4cd15 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -120,7 +120,7 @@ SOURCES += \
tools/qstring_mac.mm
}
else:blackberry {
- SOURCES += tools/qelapsedtimer_unix.cpp tools/qlocale_blackberry.cpp
+ SOURCES += tools/qelapsedtimer_unix.cpp tools/qlocale_blackberry.cpp tools/qtimezoneprivate_tz.cpp
HEADERS += tools/qlocale_blackberry.h
}
else:unix:SOURCES += tools/qelapsedtimer_unix.cpp tools/qlocale_unix.cpp tools/qtimezoneprivate_tz.cpp