summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qlibraryinfo.cpp4
-rw-r--r--src/corelib/io/qtemporarydir.cpp5
-rw-r--r--src/corelib/io/qurl_mac.mm8
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp6
-rw-r--r--src/corelib/kernel/qtcore_eval.cpp6
-rw-r--r--src/corelib/xml/qxmlstream.cpp41
-rw-r--r--src/corelib/xml/qxmlstream_p.h12
7 files changed, 49 insertions, 33 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 4f9f54cde8..d592032c1f 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
** Copyright (C) 2014 Intel Corporation
** Contact: http://www.qt-project.org/legal
**
@@ -604,7 +604,7 @@ extern "C" void qt_core_boilerplate();
void qt_core_boilerplate()
{
printf("This is the QtCore library version " QT_BUILD_STR "\n"
- "Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n"
+ "Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).\n"
"Contact: http://www.qt-project.org/legal\n"
"\n"
"Build date: %s\n"
diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp
index 5e0def74ee..5f0c500183 100644
--- a/src/corelib/io/qtemporarydir.cpp
+++ b/src/corelib/io/qtemporarydir.cpp
@@ -128,8 +128,11 @@ static char *q_mkdtemp(char *templateName)
QFile::ReadOwner |
QFile::WriteOwner |
QFile::ExeOwner, error);
- if (error.error() != 0)
+ if (error.error() != 0) {
+ if (!QFileSystemEngine::removeDirectory(fileSystemEntry, false))
+ qWarning() << "Unable to remove unused directory" << templateNameStr;
continue;
+ }
return templateName;
}
}
diff --git a/src/corelib/io/qurl_mac.mm b/src/corelib/io/qurl_mac.mm
index c235365ad8..4468bf0f2b 100644
--- a/src/corelib/io/qurl_mac.mm
+++ b/src/corelib/io/qurl_mac.mm
@@ -54,7 +54,13 @@ QUrl QUrl::fromCFURL(CFURLRef url)
CFURLRef QUrl::toCFURL() const
{
- return CFURLCreateWithString(0, toString(FullyEncoded).toCFString(), 0);
+ CFURLRef url = 0;
+ CFStringRef str = toString(FullyEncoded).toCFString();
+ if (str) {
+ url = CFURLCreateWithString(0, str, 0);
+ CFRelease(str);
+ }
+ return url;
}
QUrl QUrl::fromNSURL(const NSURL *url)
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index 0b2b0e4188..b01c9db418 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -1196,7 +1196,11 @@ void QSortFilterProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &sourc
parents << q->mapFromSource(source_parent);
emit q->layoutAboutToBeChanged(parents, QAbstractItemModel::VerticalSortHint);
QModelIndexPairList source_indexes = store_persistent_indexes();
- sort_source_rows(m->source_rows, source_parent);
+ remove_source_items(m->proxy_rows, m->source_rows, source_rows_resort,
+ source_parent, Qt::Vertical, false);
+ sort_source_rows(source_rows_resort, source_parent);
+ insert_source_items(m->proxy_rows, m->source_rows, source_rows_resort,
+ source_parent, Qt::Vertical, false);
update_persistent_indexes(source_indexes);
emit q->layoutChanged(parents, QAbstractItemModel::VerticalSortHint);
// Make sure we also emit dataChanged for the rows
diff --git a/src/corelib/kernel/qtcore_eval.cpp b/src/corelib/kernel/qtcore_eval.cpp
index eb1019534c..2ee8c20bc3 100644
--- a/src/corelib/kernel/qtcore_eval.cpp
+++ b/src/corelib/kernel/qtcore_eval.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE
static const char boilerplate_supported_but_time_limited[] =
"\nQt %1 Evaluation License\n"
- "Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).\n"
+ "Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).\n"
"This trial version may only be used for evaluation purposes\n"
"and will shut down after 120 minutes.\n"
"Registered to:\n"
@@ -57,7 +57,7 @@ static const char boilerplate_supported_but_time_limited[] =
static const char boilerplate_supported[] =
"\nQt %1 Evaluation License\n"
- "Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).\n"
+ "Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).\n"
"This trial version may only be used for evaluation purposes\n"
"Registered to:\n"
" Licensee: %2\n\n"
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index e4ee71f0b1..ad10c63686 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -64,6 +64,8 @@ QT_BEGIN_NAMESPACE
#include "qxmlstream_p.h"
+enum { StreamEOF = ~0U };
+
/*!
\enum QXmlStreamReader::TokenType
@@ -903,7 +905,7 @@ inline uint QXmlStreamReaderPrivate::filterCarriageReturn()
++readBufferPos;
return peekc;
}
- if (peekc == 0) {
+ if (peekc == StreamEOF) {
putChar('\r');
return 0;
}
@@ -912,13 +914,13 @@ inline uint QXmlStreamReaderPrivate::filterCarriageReturn()
/*!
\internal
- If the end of the file is encountered, 0 is returned.
+ If the end of the file is encountered, ~0 is returned.
*/
inline uint QXmlStreamReaderPrivate::getChar()
{
uint c;
if (putStack.size()) {
- c = atEnd ? 0 : putStack.pop();
+ c = atEnd ? StreamEOF : putStack.pop();
} else {
if (readBufferPos < readBuffer.size())
c = readBuffer.at(readBufferPos++).unicode();
@@ -937,7 +939,7 @@ inline uint QXmlStreamReaderPrivate::peekChar()
} else if (readBufferPos < readBuffer.size()) {
c = readBuffer.at(readBufferPos).unicode();
} else {
- if ((c = getChar_helper()))
+ if ((c = getChar_helper()) != StreamEOF)
--readBufferPos;
}
@@ -961,7 +963,8 @@ bool QXmlStreamReaderPrivate::scanUntil(const char *str, short tokenToInject)
int pos = textBuffer.size();
int oldLineNumber = lineNumber;
- while (uint c = getChar()) {
+ uint c;
+ while ((c = getChar()) != StreamEOF) {
/* First, we do the validation & normalization. */
switch (c) {
case '\r':
@@ -1007,9 +1010,9 @@ bool QXmlStreamReaderPrivate::scanString(const char *str, short tokenToInject, b
{
int n = 0;
while (str[n]) {
- ushort c = getChar();
+ uint c = getChar();
if (c != ushort(str[n])) {
- if (c)
+ if (c != StreamEOF)
putChar(c);
while (n--) {
putChar(ushort(str[n]));
@@ -1137,7 +1140,7 @@ inline int QXmlStreamReaderPrivate::fastScanLiteralContent()
{
int n = 0;
uint c;
- while ((c = getChar())) {
+ while ((c = getChar()) != StreamEOF) {
switch (ushort(c)) {
case 0xfffe:
case 0xffff:
@@ -1182,8 +1185,8 @@ inline int QXmlStreamReaderPrivate::fastScanLiteralContent()
inline int QXmlStreamReaderPrivate::fastScanSpace()
{
int n = 0;
- ushort c;
- while ((c = getChar())) {
+ uint c;
+ while ((c = getChar()) != StreamEOF) {
switch (c) {
case '\r':
if ((c = filterCarriageReturn()) == 0)
@@ -1216,7 +1219,7 @@ inline int QXmlStreamReaderPrivate::fastScanContentCharList()
{
int n = 0;
uint c;
- while ((c = getChar())) {
+ while ((c = getChar()) != StreamEOF) {
switch (ushort(c)) {
case 0xfffe:
case 0xffff:
@@ -1279,8 +1282,8 @@ inline int QXmlStreamReaderPrivate::fastScanContentCharList()
inline int QXmlStreamReaderPrivate::fastScanName(int *prefix)
{
int n = 0;
- ushort c;
- while ((c = getChar())) {
+ uint c;
+ while ((c = getChar()) != StreamEOF) {
switch (c) {
case '\n':
case ' ':
@@ -1396,7 +1399,7 @@ inline int QXmlStreamReaderPrivate::fastScanNMTOKEN()
{
int n = 0;
uint c;
- while ((c = getChar())) {
+ while ((c = getChar()) != StreamEOF) {
if (fastDetermineNameChar(c) == NotName) {
putChar(c);
return n;
@@ -1452,7 +1455,7 @@ void QXmlStreamReaderPrivate::putReplacementInAttributeValue(const QString &s)
}
}
-ushort QXmlStreamReaderPrivate::getChar_helper()
+uint QXmlStreamReaderPrivate::getChar_helper()
{
const int BUFFER_SIZE = 8192;
characterOffset += readBufferPos;
@@ -1476,7 +1479,7 @@ ushort QXmlStreamReaderPrivate::getChar_helper()
}
if (!nbytesread) {
atEnd = true;
- return 0;
+ return StreamEOF;
}
#ifndef QT_NO_TEXTCODEC
@@ -1484,7 +1487,7 @@ ushort QXmlStreamReaderPrivate::getChar_helper()
if (nbytesread < 4) { // the 4 is to cover 0xef 0xbb 0xbf plus
// one extra for the utf8 codec
atEnd = true;
- return 0;
+ return StreamEOF;
}
int mib = 106; // UTF-8
@@ -1517,7 +1520,7 @@ ushort QXmlStreamReaderPrivate::getChar_helper()
if(lockEncoding && decoder->hasFailure()) {
raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content."));
readBuffer.clear();
- return 0;
+ return StreamEOF;
}
#else
readBuffer = QString::fromLatin1(rawReadBuffer.data(), nbytesread);
@@ -1531,7 +1534,7 @@ ushort QXmlStreamReaderPrivate::getChar_helper()
}
atEnd = true;
- return 0;
+ return StreamEOF;
}
QStringRef QXmlStreamReaderPrivate::namespaceForPrefix(const QStringRef &prefix)
diff --git a/src/corelib/xml/qxmlstream_p.h b/src/corelib/xml/qxmlstream_p.h
index 7ff65e1718..087d64fce8 100644
--- a/src/corelib/xml/qxmlstream_p.h
+++ b/src/corelib/xml/qxmlstream_p.h
@@ -944,7 +944,7 @@ public:
short token;
- ushort token_char;
+ uint token_char;
uint filterCarriageReturn();
inline uint getChar();
@@ -955,7 +955,7 @@ public:
void putStringLiteral(const QString &s);
void putReplacement(const QString &s);
void putReplacementInAttributeValue(const QString &s);
- ushort getChar_helper();
+ uint getChar_helper();
bool scanUntil(const char *str, short tokenToInject = -1);
bool scanString(const char *str, short tokenToInject, bool requireSpace = true);
@@ -1068,7 +1068,7 @@ bool QXmlStreamReaderPrivate::parse()
documentVersion.clear();
documentEncoding.clear();
#ifndef QT_NO_TEXTCODEC
- if (decoder->hasFailure()) {
+ if (decoder && decoder->hasFailure()) {
raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content."));
readBuffer.clear();
return false;
@@ -1099,8 +1099,8 @@ bool QXmlStreamReaderPrivate::parse()
if (token == -1 && - TERMINAL_COUNT != action_index[act]) {
uint cu = getChar();
token = NOTOKEN;
- token_char = cu;
- if (cu & 0xff0000) {
+ token_char = cu == ~0U ? cu : ushort(cu);
+ if ((cu != ~0U) && (cu & 0xff0000)) {
token = cu >> 16;
} else switch (token_char) {
case 0xfffe:
@@ -1119,7 +1119,7 @@ bool QXmlStreamReaderPrivate::parse()
break;
}
// fall through
- case '\0': {
+ case ~0U: {
token = EOF_SYMBOL;
if (!tagsDone && !inParseEntity) {
int a = t_action(act, token);