Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.5' into HEAD
Browse files Browse the repository at this point in the history
Change-Id: I487a4b7c05687a10c498ac219c31367d4db6fbc0
  • Loading branch information
Simon Hausmann committed May 4, 2015
2 parents af851c2 + eb82959 commit 7f8719e
Show file tree
Hide file tree
Showing 45 changed files with 829 additions and 412 deletions.
2 changes: 0 additions & 2 deletions mkspecs/common/clang.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ QMAKE_LINK_SHLIB = $$QMAKE_CXX
CONFIG += clang_pch_style
QMAKE_PCH_OUTPUT_EXT = .pch

QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g
QMAKE_CFLAGS_ISYSTEM = -isystem
QMAKE_CFLAGS_PRECOMPILE = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CFLAGS_USE_PRECOMPILE = -Xclang -include-pch -Xclang ${QMAKE_PCH_OUTPUT}
QMAKE_CFLAGS_LTCG = -flto
QMAKE_CFLAGS_DISABLE_LTCG = -fno-lto

QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
Expand Down
4 changes: 0 additions & 4 deletions mkspecs/common/g++-base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@ QMAKE_CC = gcc
QMAKE_LINK_C = $$QMAKE_CC
QMAKE_LINK_C_SHLIB = $$QMAKE_CC

QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g

QMAKE_CXX = g++

QMAKE_LINK = $$QMAKE_CXX
QMAKE_LINK_SHLIB = $$QMAKE_CXX

QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO

QMAKE_PCH_OUTPUT_EXT = .gch

QMAKE_CFLAGS_PRECOMPILE = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
Expand Down
3 changes: 3 additions & 0 deletions mkspecs/common/gcc-base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ QMAKE_CFLAGS_DEPS += -M
QMAKE_CFLAGS_WARN_ON += -Wall -W
QMAKE_CFLAGS_WARN_OFF += -w
QMAKE_CFLAGS_RELEASE += $$QMAKE_CFLAGS_OPTIMIZE
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g
QMAKE_CFLAGS_DEBUG += -g
QMAKE_CFLAGS_SHLIB += -fPIC
QMAKE_CFLAGS_STATIC_LIB += -fPIC
Expand All @@ -57,6 +58,7 @@ QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS
QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB
Expand All @@ -73,6 +75,7 @@ QMAKE_LFLAGS +=
QMAKE_LFLAGS_DEBUG +=
QMAKE_LFLAGS_APP +=
QMAKE_LFLAGS_RELEASE +=
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO +=
QMAKE_LFLAGS_EXCEPTIONS_OFF +=
QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG -fuse-linker-plugin

Expand Down
9 changes: 8 additions & 1 deletion mkspecs/features/qt_module.prf
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,14 @@ mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) {
# Set the CFBundleIdentifier prefix for Qt frameworks
QMAKE_TARGET_BUNDLE_PREFIX = org.qt-project
#QMAKE_FRAMEWORK_VERSION = 4.0
CONFIG += lib_bundle sliced_bundle qt_framework
CONFIG += sliced_bundle qt_framework
qt_no_install_library {
CONFIG += bundle
QMAKE_BUNDLE_EXTENSION = .framework
QMAKE_INFO_PLIST = $$QMAKESPEC/Info.plist.lib
} else {
CONFIG += lib_bundle
}
CONFIG -= qt_install_headers #no need to install these as well
!debug_and_release|!build_all|CONFIG(release, debug|release) {
FRAMEWORK_HEADERS.version = Versions
Expand Down
6 changes: 3 additions & 3 deletions mkspecs/features/qt_module_pris.prf
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
module_rundep = "QT.$${MODULE_ID}.run_depends = $$replace(QT_PRIVATE, -private$, _private)"
else: \
module_rundep =
equals(TEMPLATE, aux): \
module_build_type = no_link
else:static: \
static: \
module_build_type = staticlib
else:mac:contains(QT_CONFIG, qt_framework): \
module_build_type = lib_bundle
else: \
module_build_type =
equals(TEMPLATE, aux): \
module_build_type += no_link
internal_module: \
module_build_type += internal_module
ltcg: \
Expand Down
20 changes: 13 additions & 7 deletions qmake/generators/unix/unixmake2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,20 +614,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\n\t" << var("QMAKE_POST_LINK");
t << endl << endl;
} else if(!project->isEmpty("QMAKE_BUNDLE")) {
QString currentLink = destdir_r + "Versions/Current";
QString currentLink_f = escapeDependencyPath(currentLink);
bundledFiles << currentLink << destdir_r + "$(TARGET)";
bundledFiles << destdir_r + "$(TARGET)";
t << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0) $(DESTDIR)$(TARGET0)\n\t"
<< var("QMAKE_LINK_SHLIB_CMD") << "\n\t"
<< mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGETD)`\"", false) << "\n\t"
<< "-$(MOVE) $(TARGET) $(DESTDIR)$(TARGETD)\n\t"
<< mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGET0)`\"", false) << "\n\t"
<< varGlue("QMAKE_LN_SHLIB", "-", " ",
" Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t"
<< "-$(DEL_FILE) " << currentLink_f << "\n\t"
<< varGlue("QMAKE_LN_SHLIB","-"," ", " " + project->first("QMAKE_FRAMEWORK_VERSION") +
' ' + currentLink_f) << "\n\t";
" Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
t << endl << endl;
Expand Down Expand Up @@ -937,6 +932,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< mkdir_p_asstring(bundle_dir) << "\n\t"
<< "@$(SYMLINK) " << escapeFilePath(symIt.value()) << ' ' << bundle_dir_f << endl;
}
if (!project->first("QMAKE_FRAMEWORK_VERSION").isEmpty()) {
QString currentLink = bundle_dir + "Versions/Current";
QString currentLink_f = escapeDependencyPath(currentLink);
bundledFiles << currentLink;
alldeps << currentLink;
t << currentLink_f << ": $(MAKEFILE)\n\t"
<< mkdir_p_asstring(bundle_dir + "Versions") << "\n\t"
<< "@-$(DEL_FILE) " << currentLink_f << "\n\t"
<< "@$(SYMLINK) " << project->first("QMAKE_FRAMEWORK_VERSION")
<< ' ' << currentLink_f << endl;
}
}

t << endl << "all: " << deps
Expand Down
4 changes: 4 additions & 0 deletions src/corelib/io/qiodevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,10 @@ QByteArray QIODevice::readAll()
// Size is unknown, read incrementally.
qint64 readResult;
do {
if (quint64(readBytes) + QIODEVICE_BUFFERSIZE > QByteArray::MaxSize) {
// If resize would fail, don't read more, return what we have.
break;
}
result.resize(readBytes + QIODEVICE_BUFFERSIZE);
readResult = read(result.data() + readBytes, QIODEVICE_BUFFERSIZE);
if (readResult > 0 || readBytes == 0)
Expand Down
6 changes: 3 additions & 3 deletions src/corelib/io/qtextstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,9 @@ bool QTextStreamPrivate::fillReadBuffer(qint64 maxBytes)
bytesRead = device->read(buf, sizeof(buf));
}

if (bytesRead <= 0)
return false;

#ifndef QT_NO_TEXTCODEC
// codec auto detection, explicitly defaults to locale encoding if the
// codec has been set to 0.
Expand All @@ -470,9 +473,6 @@ bool QTextStreamPrivate::fillReadBuffer(qint64 maxBytes)
qt_prettyDebug(buf, qMin(32,int(bytesRead)) , int(bytesRead)).constData(), int(sizeof(buf)), int(bytesRead));
#endif

if (bytesRead <= 0)
return false;

int oldReadBufferSize = readBuffer.size();
#ifndef QT_NO_TEXTCODEC
// convert to unicode
Expand Down
10 changes: 5 additions & 5 deletions src/corelib/itemmodels/qsortfilterproxymodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2577,8 +2577,8 @@ void QSortFilterProxyModel::invalidateFilter()

/*!
Returns \c true if the value of the item referred to by the given
index \a left is less than the value of the item referred to by
the given index \a right, otherwise returns \c false.
index \a source_left is less than the value of the item referred to by
the given index \a source_right, otherwise returns \c false.
This function is used as the < operator when sorting, and handles
the following QVariant types:
Expand Down Expand Up @@ -2612,11 +2612,11 @@ void QSortFilterProxyModel::invalidateFilter()
\sa sortRole, sortCaseSensitivity, dynamicSortFilter
*/
bool QSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
bool QSortFilterProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
{
Q_D(const QSortFilterProxyModel);
QVariant l = (left.model() ? left.model()->data(left, d->sort_role) : QVariant());
QVariant r = (right.model() ? right.model()->data(right, d->sort_role) : QVariant());
QVariant l = (source_left.model() ? source_left.model()->data(source_left, d->sort_role) : QVariant());
QVariant r = (source_right.model() ? source_right.model()->data(source_right, d->sort_role) : QVariant());
switch (l.userType()) {
case QVariant::Invalid:
return (r.type() != QVariant::Invalid);
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/itemmodels/qsortfilterproxymodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public Q_SLOTS:
protected:
virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
virtual bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const;
virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
virtual bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const;

void filterChanged();
void invalidateFilter();
Expand Down
17 changes: 16 additions & 1 deletion src/corelib/kernel/qmimedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,22 @@ QByteArray QMimeData::data(const QString &mimeType) const
void QMimeData::setData(const QString &mimeType, const QByteArray &data)
{
Q_D(QMimeData);
d->setData(mimeType, QVariant(data));

if (mimeType == QLatin1String("text/uri-list")) {
QByteArray ba = data;
if (ba.endsWith('\0'))
ba.chop(1);
QList<QByteArray> urls = ba.split('\n');
QList<QVariant> list;
for (int i = 0; i < urls.size(); ++i) {
QByteArray ba = urls.at(i).trimmed();
if (!ba.isEmpty())
list.append(QUrl::fromEncoded(ba));
}
d->setData(mimeType, list);
} else {
d->setData(mimeType, QVariant(data));
}
}

/*!
Expand Down
30 changes: 22 additions & 8 deletions src/corelib/statemachine/qstatemachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,8 @@ function removeConflictingTransitions(enabledTransitions):
filteredTransitions.add(t1)
return filteredTransitions
Note: the implementation below does not build the transitionsToRemove, but removes them in-place.
*/
void QStateMachinePrivate::removeConflictingTransitions(QList<QAbstractTransition*> &enabledTransitions)
{
Expand All @@ -492,24 +494,36 @@ void QStateMachinePrivate::removeConflictingTransitions(QList<QAbstractTransitio

foreach (QAbstractTransition *t1, enabledTransitions) {
bool t1Preempted = false;
QVarLengthArray<QAbstractTransition *> transitionsToRemove;
QSet<QAbstractState*> exitSetT1 = computeExitSet_Unordered(QList<QAbstractTransition*>() << t1);
foreach (QAbstractTransition *t2, filteredTransitions) {
QList<QAbstractTransition*>::iterator t2It = filteredTransitions.begin();
while (t2It != filteredTransitions.end()) {
QAbstractTransition *t2 = *t2It;
if (t1 == t2) {
// Special case: someone added the same transition object to a state twice. In this
// case, t2 (which is already in the list) "preempts" t1.
t1Preempted = true;
break;
}

QSet<QAbstractState*> exitSetT2 = computeExitSet_Unordered(QList<QAbstractTransition*>() << t2);
if (!exitSetT1.intersect(exitSetT2).isEmpty()) {
if (exitSetT1.intersect(exitSetT2).isEmpty()) {
// No conflict, no cry. Next patient please.
++t2It;
} else {
// Houston, we have a conflict. Check which transition can be removed.
if (isDescendant(t1->sourceState(), t2->sourceState())) {
transitionsToRemove.append(t2);
// t1 preempts t2, so we can remove t2
t2It = filteredTransitions.erase(t2It);
} else {
// t2 preempts t1, so there's no use in looking further and we don't need to add
// t1 to the list.
t1Preempted = true;
break;
}
}
}
if (!t1Preempted) {
foreach (QAbstractTransition *t3, transitionsToRemove)
filteredTransitions.removeAll(t3);
if (!t1Preempted)
filteredTransitions.append(t1);
}
}

enabledTransitions = filteredTransitions;
Expand Down
3 changes: 2 additions & 1 deletion src/corelib/tools/qregularexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2657,7 +2657,8 @@ static const char *pcreCompileErrorCodes[] =
QT_TRANSLATE_NOOP("QRegularExpression", "parentheses are too deeply nested"),
QT_TRANSLATE_NOOP("QRegularExpression", "invalid range in character class"),
QT_TRANSLATE_NOOP("QRegularExpression", "group name must start with a non-digit"),
QT_TRANSLATE_NOOP("QRegularExpression", "parentheses are too deeply nested (stack check)")
QT_TRANSLATE_NOOP("QRegularExpression", "parentheses are too deeply nested (stack check)"),
QT_TRANSLATE_NOOP("QRegularExpression", "digits missing in \\x{} or \\o{}")
};
#endif // #if 0

Expand Down
Loading

0 comments on commit 7f8719e

Please sign in to comment.