summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraavit <qt-info@nokia.com>2011-11-02 08:25:56 (GMT)
committeraavit <qt-info@nokia.com>2011-11-02 08:25:56 (GMT)
commit582dec4b753b84cc69eb140290ceff346bce76b9 (patch)
tree5655a148070fd4aa1fb4728b404d31f72f9e02be /src
parent257824bc7b2416e0b66d98423e25525da9141d1f (diff)
parent621431fe5128c6d61095dc6cf92d8b34c4c4284b (diff)
downloadQt-582dec4b753b84cc69eb140290ceff346bce76b9.zip
Qt-582dec4b753b84cc69eb140290ceff346bce76b9.tar.gz
Qt-582dec4b753b84cc69eb140290ceff346bce76b9.tar.bz2
Merge remote-tracking branch 'qt-mainline/4.8'
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp2
-rw-r--r--src/3rdparty/webkit/Source/WebKit/qt/docs/webkitsnippets/webelement/main.cpp2
-rw-r--r--src/corelib/io/qfile.cpp5
-rw-r--r--src/corelib/io/qiodevice.cpp6
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp26
-rw-r--r--src/corelib/kernel/qobject.cpp5
-rw-r--r--src/corelib/kernel/qpointer.cpp2
-rw-r--r--src/corelib/kernel/qtranslator.cpp40
-rw-r--r--src/corelib/tools/qline.cpp9
-rw-r--r--src/corelib/tools/qlist.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp43
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp29
-rw-r--r--src/declarative/qml/qdeclarativedirparser.cpp40
-rw-r--r--src/declarative/qml/qdeclarativedirparser_p.h6
-rw-r--r--src/declarative/qml/qdeclarativeimport.cpp112
-rw-r--r--src/declarative/qml/qdeclarativeimport_p.h2
-rw-r--r--src/declarative/qml/qdeclarativetypeloader.cpp94
-rw-r--r--src/declarative/qml/qdeclarativetypeloader_p.h9
-rw-r--r--src/declarative/util/qdeclarativepropertychanges.cpp5
-rw-r--r--src/gui/dialogs/dialogs.pri6
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h1
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp37
-rw-r--r--src/gui/kernel/qapplication.cpp28
-rw-r--r--src/gui/kernel/qapplication.h4
-rw-r--r--src/gui/kernel/qapplication_p.h3
-rw-r--r--src/gui/kernel/qapplication_s60.cpp180
-rw-r--r--src/gui/kernel/qt_s60_p.h19
-rw-r--r--src/gui/kernel/qwidget_s60.cpp6
-rw-r--r--src/gui/painting/qgraphicssystemex_symbian.cpp6
-rw-r--r--src/gui/painting/qpainter.cpp22
-rw-r--r--src/gui/styles/qs60style_p.h4
-rw-r--r--src/gui/styles/qs60style_s60.cpp10
-rw-r--r--src/gui/styles/styles.pri6
-rw-r--r--src/gui/util/util.pri6
-rw-r--r--src/gui/widgets/qlabel.cpp2
-rw-r--r--src/imports/folderlistmodel/folderlistmodel.pro4
-rw-r--r--src/imports/gestures/gestures.pro4
-rw-r--r--src/imports/particles/particles.pro4
-rw-r--r--src/imports/shaders/shaders.pro2
-rw-r--r--src/network/access/qftp.cpp4
-rw-r--r--src/network/access/qnetworkaccessbackend.cpp4
-rw-r--r--src/network/access/qnetworkdiskcache.cpp6
-rw-r--r--src/network/ssl/qssl.cpp2
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp2
-rw-r--r--src/opengl/qgl.cpp8
-rw-r--r--src/opengl/qgl_egl.cpp11
-rw-r--r--src/opengl/qgl_p.h3
-rw-r--r--src/opengl/qgl_symbian.cpp18
-rw-r--r--src/plugins/bearer/symbian/symbian.pri6
-rw-r--r--src/plugins/phonon/mmf/mmf.pro12
-rw-r--r--src/s60installs/bwins/QtGuiu.def8
-rw-r--r--src/s60installs/eabi/QtGuiu.def7
52 files changed, 671 insertions, 215 deletions
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
index 3410782..7f4bb0c 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
@@ -1293,7 +1293,7 @@ HB_Bool HB_OpenTypePosition(HB_ShaperItem *item, int availableGlyphs, HB_Bool do
// (int)(positions[i].x_pos >> 6), (int)(positions[i].y_pos >> 6),
// positions[i].back, positions[i].new_advance);
- HB_Fixed adjustment = (item->item.bidiLevel % 2) ? -positions[i].x_advance : positions[i].x_advance;
+ HB_Fixed adjustment = positions[i].x_advance;
if (!(face->current_flags & HB_ShaperFlag_UseDesignMetrics))
adjustment = HB_FIXED_ROUND(adjustment);
diff --git a/src/3rdparty/webkit/Source/WebKit/qt/docs/webkitsnippets/webelement/main.cpp b/src/3rdparty/webkit/Source/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
index b1781a6..59c124c 100644
--- a/src/3rdparty/webkit/Source/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
+++ b/src/3rdparty/webkit/Source/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
@@ -57,7 +57,7 @@ static void findButtonAndClick()
*/
QWebElement button = document.findFirst("input[type=submit]");
- button.evaluateJavaScript("click()");
+ button.evaluateJavaScript("this.click()");
//! [Calling a DOM element method]
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index d08574d..cdee7ce 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -918,6 +918,7 @@ QFile::copy(const QString &newName)
#endif
if (error) {
out.close();
+ close();
d->setError(QFile::CopyError, tr("Cannot open for output"));
} else {
char block[4096];
@@ -928,6 +929,7 @@ QFile::copy(const QString &newName)
break;
totalRead += in;
if(in != out.write(block, in)) {
+ close();
d->setError(QFile::CopyError, tr("Failure to write block"));
error = true;
break;
@@ -941,6 +943,7 @@ QFile::copy(const QString &newName)
}
if (!error && !out.rename(newName)) {
error = true;
+ close();
d->setError(QFile::CopyError, tr("Cannot create %1 for output").arg(newName));
}
#ifdef QT_NO_TEMPORARYFILE
@@ -951,10 +954,10 @@ QFile::copy(const QString &newName)
out.setAutoRemove(false);
#endif
}
- close();
}
if(!error) {
QFile::setPermissions(newName, permissions());
+ close();
unsetError();
return true;
}
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index dae4e82..56fff90 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -468,11 +468,17 @@ void QIODevice::setOpenMode(OpenMode openMode)
otherwise the \l Text flag is removed. This feature is useful for classes
that provide custom end-of-line handling on a QIODevice.
+ The IO device should be opened before calling this function.
+
\sa open(), setOpenMode()
*/
void QIODevice::setTextModeEnabled(bool enabled)
{
Q_D(QIODevice);
+ if (!isOpen()) {
+ qWarning("QIODevice::setTextModeEnabled: The device is not open");
+ return;
+ }
if (enabled)
d->openMode |= Text;
else
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index b216075..fca2feb 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -60,6 +60,24 @@ QT_BEGIN_NAMESPACE
#define WAKE_UP_PRIORITY CActive::EPriorityStandard
#define TIMER_PRIORITY CActive::EPriorityHigh
+class Incrementer {
+ int &variable;
+public:
+ inline Incrementer(int &variable) : variable(variable)
+ { ++variable; }
+ inline ~Incrementer()
+ { --variable; }
+};
+
+class Decrementer {
+ int &variable;
+public:
+ inline Decrementer(int &variable) : variable(variable)
+ { --variable; }
+ inline ~Decrementer()
+ { ++variable; }
+};
+
static inline int qt_pipe_write(int socket, const char *data, qint64 len)
{
return ::write(socket, data, len);
@@ -951,6 +969,8 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
#endif
while (1) {
+ //native active object callbacks are logically part of the event loop, so inc nesting level
+ Incrementer inc(d->threadData->loopLevel);
if (block) {
// This is where Qt will spend most of its time.
CActiveScheduler::Current()->WaitForAnyRequest();
@@ -1045,6 +1065,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
void QEventDispatcherSymbian::timerFired(int timerId)
{
+ Q_D(QAbstractEventDispatcher);
QHash<int, SymbianTimerInfoPtr>::iterator i = m_timerList.find(timerId);
if (i == m_timerList.end()) {
// The timer has been deleted. Ignore this event.
@@ -1063,6 +1084,8 @@ void QEventDispatcherSymbian::timerFired(int timerId)
m_insideTimerEvent = true;
QTimerEvent event(timerInfo->timerId);
+ //undo the added nesting level around RunIfReady, since Qt's event system also nests
+ Decrementer dec(d->threadData->loopLevel);
QCoreApplication::sendEvent(timerInfo->receiver, &event);
m_insideTimerEvent = oldInsideTimerEventValue;
@@ -1073,6 +1096,7 @@ void QEventDispatcherSymbian::timerFired(int timerId)
void QEventDispatcherSymbian::wakeUpWasCalled()
{
+ Q_D(QAbstractEventDispatcher);
// The reactivation should happen in RunL, right before the call to this function.
// This is because m_wakeUpDone is the "signal" that the object can be completed
// once more.
@@ -1082,6 +1106,8 @@ void QEventDispatcherSymbian::wakeUpWasCalled()
// the sendPostedEvents was done, but before the object was ready to be completed
// again. This could deadlock the application if there are no other posted events.
m_wakeUpDone.fetchAndStoreOrdered(0);
+ //undo the added nesting level around RunIfReady, since Qt's event system also nests
+ Decrementer dec(d->threadData->loopLevel);
sendPostedEvents();
}
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 5d6e4d7..1f716bc 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -163,14 +163,15 @@ QObjectPrivate::~QObjectPrivate()
{
if (pendTimer) {
// unregister pending timers
- if (threadData->eventDispatcher)
+ if (threadData && threadData->eventDispatcher)
threadData->eventDispatcher->unregisterTimers(q_ptr);
}
if (postedEvents)
QCoreApplication::removePostedEvents(q_ptr, 0);
- threadData->deref();
+ if (threadData)
+ threadData->deref();
delete static_cast<QAbstractDynamicMetaObject*>(metaObject);
#ifdef QT_JAMBI_BUILD
diff --git a/src/corelib/kernel/qpointer.cpp b/src/corelib/kernel/qpointer.cpp
index c7fcf4f..87e903f 100644
--- a/src/corelib/kernel/qpointer.cpp
+++ b/src/corelib/kernel/qpointer.cpp
@@ -97,7 +97,7 @@
Note that class \c T must inherit QObject, or a compilation or
link error will result.
- \sa QSharedPointer, QObject, QObjectCleanupHandler
+ \sa QSharedPointer, QWeakPointer, QObject, QObjectCleanupHandler
*/
/*!
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index d255422..dfc90e8 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -51,6 +51,7 @@
#include "qcoreapplication.h"
#include "qcoreapplication_p.h"
#include "qdatastream.h"
+#include "qdir.h"
#include "qfile.h"
#include "qmap.h"
#include "qalgorithms.h"
@@ -63,6 +64,10 @@
#include "private/qcore_unix_p.h"
#endif
+#ifdef Q_OS_SYMBIAN
+#include "private/qcore_symbian_p.h"
+#endif
+
// most of the headers below are already included in qplatformdefs.h
// also this lacks Large File support but that's probably irrelevant
#if defined(QT_USE_MMAP)
@@ -405,11 +410,24 @@ bool QTranslator::load(const QString & filename, const QString & directory,
QString prefix;
if (QFileInfo(filename).isRelative()) {
+#ifdef Q_OS_SYMBIAN
+ if (directory.isEmpty())
+ prefix = QCoreApplication::applicationDirPath();
+ else
+ prefix = QFileInfo(directory).absoluteFilePath(); //TFindFile doesn't like dirty paths
+ if (prefix.length() > 2 && prefix.at(1) == QLatin1Char(':') && prefix.at(0).isLetter())
+ prefix[0] = QLatin1Char('Y');
+#else
prefix = directory;
- if (prefix.length() && !prefix.endsWith(QLatin1Char('/')))
- prefix += QLatin1Char('/');
+#endif
+ if (prefix.length() && !prefix.endsWith(QLatin1Char('/')))
+ prefix += QLatin1Char('/');
}
+#ifdef Q_OS_SYMBIAN
+ QString nativePrefix = QDir::toNativeSeparators(prefix);
+#endif
+
QString fname = filename;
QString realname;
QString delims;
@@ -418,6 +436,24 @@ bool QTranslator::load(const QString & filename, const QString & directory,
for (;;) {
QFileInfo fi;
+#ifdef Q_OS_SYMBIAN
+ //search for translations on other drives, e.g. Qt may be in Z, while app is in C
+ //note this uses symbian search rules, i.e. y:->a:, followed by z:
+ TFindFile finder(qt_s60GetRFs());
+ QString fname2 = fname + (suffix.isNull() ? QString::fromLatin1(".qm") : suffix);
+ TInt err = finder.FindByDir(
+ qt_QString2TPtrC(fname2),
+ qt_QString2TPtrC(nativePrefix));
+ if (err != KErrNone)
+ err = finder.FindByDir(qt_QString2TPtrC(fname), qt_QString2TPtrC(nativePrefix));
+ if (err == KErrNone) {
+ fi.setFile(qt_TDesC2QString(finder.File()));
+ realname = fi.canonicalFilePath();
+ if (fi.isReadable() && fi.isFile())
+ break;
+ }
+#endif
+
realname = prefix + fname + (suffix.isNull() ? QString::fromLatin1(".qm") : suffix);
fi.setFile(realname);
if (fi.isReadable() && fi.isFile())
diff --git a/src/corelib/tools/qline.cpp b/src/corelib/tools/qline.cpp
index 9c7c243..7e3dd34 100644
--- a/src/corelib/tools/qline.cpp
+++ b/src/corelib/tools/qline.cpp
@@ -488,7 +488,8 @@ bool QLineF::isNull() const
/*!
\fn qreal QLineF::dx() const
- Returns the horizontal component of the line's vector.
+ Returns the horizontal component of the line's vector.
+ Return value is positive if x2() >= x1() and negative if x2() < x1().
\sa dy(), pointAt()
*/
@@ -497,6 +498,7 @@ bool QLineF::isNull() const
\fn qreal QLineF::dy() const
Returns the vertical component of the line's vector.
+ Return value is positive if y2() >= y1() and negative if y2() < y1().
\sa dx(), pointAt()
*/
@@ -506,7 +508,8 @@ bool QLineF::isNull() const
Sets the length of the line to the given \a length. QLineF will
move the end point - p2() - of the line to give the line its new length.
-
+ If the given \a length is negative the angle() is also changed.
+
If the line is a null line, the length will remain zero regardless
of the length specified.
@@ -762,7 +765,7 @@ QLineF::IntersectType QLineF::intersect(const QLineF &l, QPointF *intersectionPo
\since 4.4
- Returns the angle (in degrees) from this line to the given \a
+ Returns the angle (in positive degrees) from this line to the given \a
line, taking the direction of the lines into account. If the lines
do not intersect within their range, it is the intersection point of
the extended lines that serves as origin (see
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 18bfe24..2e95ef8 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -469,8 +469,8 @@ void **QListData::erase(void **xi)
\snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 0
Qt includes a QStringList class that inherits QList\<QString\>
- and adds a few convenience functions, such as QStringList::join()
- and QStringList::find(). (QString::split() creates QStringLists
+ and adds a convenience function QStringList::join().
+ (QString::split() creates QStringLists
from strings.)
QList stores a list of items. The default constructor creates an
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index a7d593a..16518f4 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -1083,25 +1083,29 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
tempPosition -= bias;
}
FxGridItem *topItem = snapItemAt(tempPosition+highlightStart);
+ if (!topItem && strictHighlightRange && currentItem) {
+ // StrictlyEnforceRange always keeps an item in range
+ updateHighlight();
+ topItem = currentItem;
+ }
FxGridItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
+ if (!bottomItem && strictHighlightRange && currentItem) {
+ // StrictlyEnforceRange always keeps an item in range
+ updateHighlight();
+ bottomItem = currentItem;
+ }
qreal pos;
- if (topItem && bottomItem && strictHighlightRange) {
- qreal topPos = qMin(topItem->rowPos() - highlightStart, -maxExtent);
- qreal bottomPos = qMax(bottomItem->rowPos() - highlightEnd, -minExtent);
- pos = qAbs(data.move + topPos) < qAbs(data.move + bottomPos) ? topPos : bottomPos;
- } else if (topItem) {
- qreal headerPos = 0;
- if (header)
- headerPos = isRightToLeftTopToBottom() ? header->rowPos() + cellWidth - headerSize() : header->rowPos();
- if (topItem->index == 0 && header && tempPosition+highlightStart < headerPos+headerSize()/2 && !strictHighlightRange) {
- pos = isRightToLeftTopToBottom() ? - headerPos + highlightStart - size() : headerPos - highlightStart;
+ bool isInBounds = -position() > maxExtent && -position() <= minExtent;
+ if (topItem && (isInBounds || strictHighlightRange)) {
+ if (topItem->index == 0 && header && tempPosition+highlightStart < header->rowPos()+headerSize()/2 && !strictHighlightRange) {
+ pos = isRightToLeftTopToBottom() ? - header->rowPos() + highlightStart - size() : header->rowPos() - highlightStart;
} else {
if (isRightToLeftTopToBottom())
pos = qMax(qMin(-topItem->rowPos() + highlightStart - size(), -maxExtent), -minExtent);
else
pos = qMax(qMin(topItem->rowPos() - highlightStart, -maxExtent), -minExtent);
}
- } else if (bottomItem) {
+ } else if (bottomItem && isInBounds) {
if (isRightToLeftTopToBottom())
pos = qMax(qMin(-bottomItem->rowPos() + highlightEnd - size(), -maxExtent), -minExtent);
else
@@ -2247,9 +2251,10 @@ qreal QDeclarativeGridView::minXExtent() const
qreal extent = -d->startPosition();
qreal highlightStart;
qreal highlightEnd;
- qreal endPositionFirstItem;
+ qreal endPositionFirstItem = 0;
if (d->isRightToLeftTopToBottom()) {
- endPositionFirstItem = d->rowPosAt(d->model->count()-1);
+ if (d->model && d->model->count())
+ endPositionFirstItem = d->rowPosAt(d->model->count()-1);
highlightStart = d->highlightRangeStartValid
? d->highlightRangeStart - (d->lastPosition()-endPositionFirstItem)
: d->size() - (d->lastPosition()-endPositionFirstItem);
@@ -2264,7 +2269,7 @@ qreal QDeclarativeGridView::minXExtent() const
extent += d->header->item->width();
}
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
- extent += highlightStart;
+ extent += d->isRightToLeftTopToBottom() ? -highlightStart : highlightStart;
extent = qMax(extent, -(endPositionFirstItem - highlightEnd));
}
return extent;
@@ -2850,6 +2855,11 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
addedVisible = true;
}
FxGridItem *item = d->createItem(modelIndex + i);
+ if (!item) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
d->visibleItems.insert(index, item);
item->setPosition(colPos, rowPos);
added.append(item);
@@ -3040,6 +3050,11 @@ void QDeclarativeGridView::itemsMoved(int from, int to, int count)
FxGridItem *movedItem = moved.take(item->index);
if (!movedItem)
movedItem = d->createItem(item->index);
+ if (!movedItem) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
it = d->visibleItems.insert(it, movedItem);
if (it == d->visibleItems.begin() && firstItem)
movedItem->setPosition(firstItem->colPos(), firstItem->rowPos());
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 44d6a1a..7b4dc5c 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -1326,10 +1326,20 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
tempPosition -= bias;
}
FxListItem *topItem = snapItemAt(tempPosition+highlightStart);
+ if (!topItem && strictHighlightRange && currentItem) {
+ // StrictlyEnforceRange always keeps an item in range
+ updateHighlight();
+ topItem = currentItem;
+ }
FxListItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
+ if (!bottomItem && strictHighlightRange && currentItem) {
+ // StrictlyEnforceRange always keeps an item in range
+ updateHighlight();
+ bottomItem = currentItem;
+ }
qreal pos;
bool isInBounds = -position() > maxExtent && -position() <= minExtent;
- if (topItem && isInBounds) {
+ if (topItem && (isInBounds || strictHighlightRange)) {
if (topItem->index == 0 && header && tempPosition+highlightStart < header->position()+header->size()/2 && !strictHighlightRange) {
pos = isRightToLeft() ? - header->position() + highlightStart - size() : header->position() - highlightStart;
} else {
@@ -2754,7 +2764,7 @@ qreal QDeclarativeListView::minXExtent() const
d->minExtent += d->header->size();
}
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
- d->minExtent += highlightStart;
+ d->minExtent += d->isRightToLeft() ? -highlightStart : highlightStart;
d->minExtent = qMax(d->minExtent, -(endPositionFirstItem - highlightEnd + 1));
}
d->minExtentDirty = false;
@@ -3275,6 +3285,11 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
addedVisible = true;
}
FxListItem *item = d->createItem(modelIndex + i);
+ if (!item) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
d->visibleItems.insert(insertionIdx, item);
pos -= item->size() + d->spacing;
item->setPosition(pos);
@@ -3305,6 +3320,11 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
addedVisible = true;
}
FxListItem *item = d->createItem(modelIndex + i);
+ if (!item) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
d->visibleItems.insert(index, item);
item->setPosition(pos);
added.append(item);
@@ -3508,6 +3528,11 @@ void QDeclarativeListView::itemsMoved(int from, int to, int count)
FxListItem *movedItem = moved.take(item->index);
if (!movedItem)
movedItem = d->createItem(item->index);
+ if (!movedItem) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
if (item->index <= firstVisible->index)
moveBy -= movedItem->size();
it = d->visibleItems.insert(it, movedItem);
diff --git a/src/declarative/qml/qdeclarativedirparser.cpp b/src/declarative/qml/qdeclarativedirparser.cpp
index 1d4db40..74ebda2 100644
--- a/src/declarative/qml/qdeclarativedirparser.cpp
+++ b/src/declarative/qml/qdeclarativedirparser.cpp
@@ -41,8 +41,10 @@
#include "private/qdeclarativedirparser_p.h"
#include "qdeclarativeerror.h"
+#include <private/qdeclarativeglobal_p.h>
#include <QtCore/QTextStream>
+#include <QtCore/QFile>
#include <QtCore/QtDebug>
QT_BEGIN_NAMESPACE
@@ -66,6 +68,16 @@ void QDeclarativeDirParser::setUrl(const QUrl &url)
_url = url;
}
+QString QDeclarativeDirParser::fileSource() const
+{
+ return _filePathSouce;
+}
+
+void QDeclarativeDirParser::setFileSource(const QString &filePath)
+{
+ _filePathSouce = filePath;
+}
+
QString QDeclarativeDirParser::source() const
{
return _source;
@@ -92,6 +104,23 @@ bool QDeclarativeDirParser::parse()
_plugins.clear();
_components.clear();
+ if (_source.isEmpty() && !_filePathSouce.isEmpty()) {
+ QFile file(_filePathSouce);
+ if (!QDeclarative_isFileCaseCorrect(_filePathSouce)) {
+ QDeclarativeError error;
+ error.setDescription(QString::fromUtf8("cannot load module \"$$URI$$\": File name case mismatch for \"%1\"").arg(_filePathSouce));
+ _errors.prepend(error);
+ return false;
+ } else if (file.open(QFile::ReadOnly)) {
+ _source = QString::fromUtf8(file.readAll());
+ } else {
+ QDeclarativeError error;
+ error.setDescription(QString::fromUtf8("module \"$$URI$$\" definition \"%1\" not readable").arg(_filePathSouce));
+ _errors.prepend(error);
+ return false;
+ }
+ }
+
QTextStream stream(&_source);
int lineNumber = 0;
@@ -224,9 +253,16 @@ bool QDeclarativeDirParser::hasError() const
return false;
}
-QList<QDeclarativeError> QDeclarativeDirParser::errors() const
+QList<QDeclarativeError> QDeclarativeDirParser::errors(const QString &uri) const
{
- return _errors;
+ QList<QDeclarativeError> errors = _errors;
+ for (int i = 0; i < errors.size(); ++i) {
+ QDeclarativeError &e = errors[i];
+ QString description = e.description();
+ description.replace(QLatin1String("$$URI$$"), uri);
+ e.setDescription(description);
+ }
+ return errors;
}
QList<QDeclarativeDirParser::Plugin> QDeclarativeDirParser::plugins() const
diff --git a/src/declarative/qml/qdeclarativedirparser_p.h b/src/declarative/qml/qdeclarativedirparser_p.h
index d40833a..273a2c7 100644
--- a/src/declarative/qml/qdeclarativedirparser_p.h
+++ b/src/declarative/qml/qdeclarativedirparser_p.h
@@ -73,11 +73,14 @@ public:
QString source() const;
void setSource(const QString &source);
+ QString fileSource() const;
+ void setFileSource(const QString &filePath);
+
bool isParsed() const;
bool parse();
bool hasError() const;
- QList<QDeclarativeError> errors() const;
+ QList<QDeclarativeError> errors(const QString &uri) const;
struct Plugin
{
@@ -129,6 +132,7 @@ private:
QList<QDeclarativeError> _errors;
QUrl _url;
QString _source;
+ QString _filePathSouce;
QList<Component> _components;
QList<Plugin> _plugins;
#ifdef QT_CREATOR
diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp
index c2f0086..21413ce 100644
--- a/src/declarative/qml/qdeclarativeimport.cpp
+++ b/src/declarative/qml/qdeclarativeimport.cpp
@@ -80,16 +80,16 @@ public:
QList<QDeclarativeDirComponents> qmlDirComponents;
- bool find_helper(int i, const QByteArray& type, int *vmajor, int *vminor,
+ bool find_helper(QDeclarativeTypeLoader *typeLoader, int i, const QByteArray& type, int *vmajor, int *vminor,
QDeclarativeType** type_return, QUrl* url_return,
QUrl *base = 0, bool *typeRecursionDetected = 0);
- bool find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
+ bool find(QDeclarativeTypeLoader *typeLoader, const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
QUrl* url_return, QUrl *base = 0, QString *errorString = 0);
};
class QDeclarativeImportsPrivate {
public:
- QDeclarativeImportsPrivate();
+ QDeclarativeImportsPrivate(QDeclarativeTypeLoader *loader);
~QDeclarativeImportsPrivate();
bool importExtension(const QString &absoluteFilePath, const QString &uri,
@@ -112,6 +112,7 @@ public:
QSet<QString> qmlDirFilesForWhichPluginsHaveBeenLoaded;
QDeclarativeImportedNamespace unqualifiedset;
QHash<QString,QDeclarativeImportedNamespace* > set;
+ QDeclarativeTypeLoader *typeLoader;
};
/*!
@@ -135,9 +136,12 @@ QDeclarativeImports::operator =(const QDeclarativeImports &copy)
return *this;
}
-QDeclarativeImports::QDeclarativeImports()
-: d(new QDeclarativeImportsPrivate)
-{
+QDeclarativeImports::QDeclarativeImports()
+ : d(new QDeclarativeImportsPrivate(0)){
+}
+
+QDeclarativeImports::QDeclarativeImports(QDeclarativeTypeLoader *typeLoader)
+ : d(new QDeclarativeImportsPrivate(typeLoader)){
}
QDeclarativeImports::~QDeclarativeImports()
@@ -269,10 +273,11 @@ bool QDeclarativeImports::resolveType(QDeclarativeImportedNamespace* ns, const Q
QDeclarativeType** type_return, QUrl* url_return,
int *vmaj, int *vmin) const
{
- return ns->find(type,vmaj,vmin,type_return,url_return);
+ Q_ASSERT(d->typeLoader);
+ return ns->find(d->typeLoader,type,vmaj,vmin,type_return,url_return);
}
-bool QDeclarativeImportedNamespace::find_helper(int i, const QByteArray& type, int *vmajor, int *vminor,
+bool QDeclarativeImportedNamespace::find_helper(QDeclarativeTypeLoader *typeLoader, int i, const QByteArray& type, int *vmajor, int *vminor,
QDeclarativeType** type_return, QUrl* url_return,
QUrl *base, bool *typeRecursionDetected)
{
@@ -292,7 +297,6 @@ bool QDeclarativeImportedNamespace::find_helper(int i, const QByteArray& type, i
return true;
}
- QUrl url = QUrl(urls.at(i) + QLatin1Char('/') + QString::fromUtf8(type) + QLatin1String(".qml"));
QDeclarativeDirComponents qmldircomponents = qmlDirComponents.at(i);
bool typeWasDeclaredInQmldir = false;
@@ -304,6 +308,7 @@ bool QDeclarativeImportedNamespace::find_helper(int i, const QByteArray& type, i
// importing version -1 means import ALL versions
if ((vmaj == -1) || (c.majorVersion < vmaj || (c.majorVersion == vmaj && vmin >= c.minorVersion))) {
+ QUrl url = QUrl(urls.at(i) + QLatin1Char('/') + QString::fromUtf8(type) + QLatin1String(".qml"));
QUrl candidate = url.resolved(QUrl(c.fileName));
if (c.internal && base) {
if (base->resolved(QUrl(c.fileName)) != candidate)
@@ -324,8 +329,9 @@ bool QDeclarativeImportedNamespace::find_helper(int i, const QByteArray& type, i
if (!typeWasDeclaredInQmldir && !isLibrary.at(i)) {
// XXX search non-files too! (eg. zip files, see QT-524)
- QFileInfo f(QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url));
- if (f.exists()) {
+ QUrl url = QUrl(urls.at(i) + QLatin1Char('/') + QString::fromUtf8(type) + QLatin1String(".qml"));
+ QString file = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url);
+ if (!typeLoader->absoluteFilePath(file).isEmpty()) {
if (base && *base == url) { // no recursion
if (typeRecursionDetected)
*typeRecursionDetected = true;
@@ -339,9 +345,8 @@ bool QDeclarativeImportedNamespace::find_helper(int i, const QByteArray& type, i
return false;
}
-QDeclarativeImportsPrivate::QDeclarativeImportsPrivate()
-: ref(1)
-{
+QDeclarativeImportsPrivate::QDeclarativeImportsPrivate(QDeclarativeTypeLoader *loader)
+ : ref(1), typeLoader(loader){
}
QDeclarativeImportsPrivate::~QDeclarativeImportsPrivate()
@@ -354,33 +359,22 @@ bool QDeclarativeImportsPrivate::importExtension(const QString &absoluteFilePath
QDeclarativeImportDatabase *database,
QDeclarativeDirComponents* components, QString *errorString)
{
- QFile file(absoluteFilePath);
- QString filecontent;
- if (!QDeclarative_isFileCaseCorrect(absoluteFilePath)) {
- if (errorString)
- *errorString = QDeclarativeImportDatabase::tr("cannot load module \"%1\": File name case mismatch for \"%2\"").arg(uri).arg(absoluteFilePath);
- return false;
- } else if (file.open(QFile::ReadOnly)) {
- filecontent = QString::fromUtf8(file.readAll());
- if (qmlImportTrace())
- qDebug().nospace() << "QDeclarativeImports(" << qPrintable(base.toString()) << "::importExtension: "
- << "loaded " << absoluteFilePath;
- } else {
- if (errorString)
- *errorString = QDeclarativeImportDatabase::tr("module \"%1\" definition \"%2\" not readable").arg(uri).arg(absoluteFilePath);
+ Q_ASSERT(typeLoader);
+ const QDeclarativeDirParser *qmldirParser = typeLoader->qmlDirParser(absoluteFilePath);
+ if (qmldirParser->hasError()) {
+ if (errorString) {
+ const QList<QDeclarativeError> qmldirErrors = qmldirParser->errors(uri);
+ for (int i = 0; i < qmldirErrors.size(); ++i)
+ *errorString += qmldirErrors.at(i).description();
+ }
return false;
}
- QDir dir = QFileInfo(file).dir();
-
- QDeclarativeDirParser qmldirParser;
- qmldirParser.setSource(filecontent);
- qmldirParser.parse();
if (! qmlDirFilesForWhichPluginsHaveBeenLoaded.contains(absoluteFilePath)) {
qmlDirFilesForWhichPluginsHaveBeenLoaded.insert(absoluteFilePath);
-
- foreach (const QDeclarativeDirParser::Plugin &plugin, qmldirParser.plugins()) {
+ QDir dir = QFileInfo(absoluteFilePath).dir();
+ foreach (const QDeclarativeDirParser::Plugin &plugin, qmldirParser->plugins()) {
QString resolvedFilePath = database->resolvePlugin(dir, plugin.path, plugin.name);
#if defined(QT_LIBINFIX) && defined(Q_OS_SYMBIAN)
@@ -405,7 +399,7 @@ bool QDeclarativeImportsPrivate::importExtension(const QString &absoluteFilePath
}
if (components)
- *components = qmldirParser.components();
+ *components = qmldirParser->components();
return true;
}
@@ -446,6 +440,7 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp
QDeclarativeScriptParser::Import::Type importType,
QDeclarativeImportDatabase *database, QString *errorString)
{
+ Q_ASSERT(typeLoader);
QDeclarativeDirComponents qmldircomponents = qmldircomponentsnetwork;
QString uri = uri_arg;
QDeclarativeImportedNamespace *s;
@@ -463,20 +458,20 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp
url.replace(QLatin1Char('.'), QLatin1Char('/'));
bool found = false;
QString dir;
-
+ QString qmldir;
// step 1: search for extension with fully encoded version number
if (vmaj >= 0 && vmin >= 0) {
foreach (const QString &p, database->fileImportPath) {
dir = p+QLatin1Char('/')+url;
+ qmldir = dir+QString(QLatin1String(".%1.%2")).arg(vmaj).arg(vmin)+QLatin1String("/qmldir");
- QFileInfo fi(dir+QString(QLatin1String(".%1.%2")).arg(vmaj).arg(vmin)+QLatin1String("/qmldir"));
- const QString absoluteFilePath = fi.absoluteFilePath();
-
- if (fi.isFile()) {
+ QString absoluteFilePath = typeLoader->absoluteFilePath(qmldir);
+ if (!absoluteFilePath.isEmpty()) {
found = true;
- url = QUrl::fromLocalFile(fi.absolutePath()).toString();
+ QString absolutePath = absoluteFilePath.left(absoluteFilePath.lastIndexOf(QLatin1Char('/')));
+ url = QUrl::fromLocalFile(absolutePath).toString();
uri = resolvedUri(dir, database);
if (!importExtension(absoluteFilePath, uri, database, &qmldircomponents, errorString))
return false;
@@ -488,14 +483,14 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp
if (vmaj >= 0 && vmin >= 0) {
foreach (const QString &p, database->fileImportPath) {
dir = p+QLatin1Char('/')+url;
+ qmldir = dir+QString(QLatin1String(".%1")).arg(vmaj)+QLatin1String("/qmldir");
- QFileInfo fi(dir+QString(QLatin1String(".%1")).arg(vmaj)+QLatin1String("/qmldir"));
- const QString absoluteFilePath = fi.absoluteFilePath();
-
- if (fi.isFile()) {
+ QString absoluteFilePath = typeLoader->absoluteFilePath(qmldir);
+ if (!absoluteFilePath.isEmpty()) {
found = true;
- url = QUrl::fromLocalFile(fi.absolutePath()).toString();
+ QString absolutePath = absoluteFilePath.left(absoluteFilePath.lastIndexOf(QLatin1Char('/')));
+ url = QUrl::fromLocalFile(absolutePath).toString();
uri = resolvedUri(dir, database);
if (!importExtension(absoluteFilePath, uri, database, &qmldircomponents, errorString))
return false;
@@ -508,14 +503,14 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp
foreach (const QString &p, database->fileImportPath) {
dir = p+QLatin1Char('/')+url;
+ qmldir = dir+QLatin1String("/qmldir");
- QFileInfo fi(dir+QLatin1String("/qmldir"));
- const QString absoluteFilePath = fi.absoluteFilePath();
-
- if (fi.isFile()) {
+ QString absoluteFilePath = typeLoader->absoluteFilePath(qmldir);
+ if (!absoluteFilePath.isEmpty()) {
found = true;
- url = QUrl::fromLocalFile(fi.absolutePath()).toString();
+ QString absolutePath = absoluteFilePath.left(absoluteFilePath.lastIndexOf(QLatin1Char('/')));
+ url = QUrl::fromLocalFile(absolutePath).toString();
uri = resolvedUri(dir, database);
if (!importExtension(absoluteFilePath, uri, database, &qmldircomponents, errorString))
return false;
@@ -553,7 +548,7 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp
uri = resolvedUri(QDeclarativeEnginePrivate::urlToLocalFileOrQrc(base.resolved(QUrl(uri))), database);
if (uri.endsWith(QLatin1Char('/')))
uri.chop(1);
- if (QFile::exists(localFileOrQrc)) {
+ if (!typeLoader->absoluteFilePath(localFileOrQrc).isEmpty()) {
if (!importExtension(localFileOrQrc,uri,database,&qmldircomponents,errorString))
return false;
}
@@ -616,6 +611,7 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp
bool QDeclarativeImportsPrivate::find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
QUrl* url_return, QString *errorString)
{
+ Q_ASSERT(typeLoader);
QDeclarativeImportedNamespace *s = 0;
int slash = type.indexOf('/');
if (slash >= 0) {
@@ -637,7 +633,7 @@ bool QDeclarativeImportsPrivate::find(const QByteArray& type, int *vmajor, int *
}
QByteArray unqualifiedtype = slash < 0 ? type : type.mid(slash+1); // common-case opt (QString::mid works fine, but slower)
if (s) {
- if (s->find(unqualifiedtype,vmajor,vminor,type_return,url_return, &base, errorString))
+ if (s->find(typeLoader, unqualifiedtype,vmajor,vminor,type_return,url_return, &base, errorString))
return true;
if (s->urls.count() == 1 && !s->isLibrary[0] && url_return && s != &unqualifiedset) {
// qualified, and only 1 url
@@ -654,16 +650,16 @@ QDeclarativeImportedNamespace *QDeclarativeImportsPrivate::findNamespace(const Q
return set.value(type);
}
-bool QDeclarativeImportedNamespace::find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
+bool QDeclarativeImportedNamespace::find(QDeclarativeTypeLoader *typeLoader, const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
QUrl* url_return, QUrl *base, QString *errorString)
{
bool typeRecursionDetected = false;
for (int i=0; i<urls.count(); ++i) {
- if (find_helper(i, type, vmajor, vminor, type_return, url_return, base, &typeRecursionDetected)) {
+ if (find_helper(typeLoader, i, type, vmajor, vminor, type_return, url_return, base, &typeRecursionDetected)) {
if (qmlCheckTypes()) {
// check for type clashes
for (int j = i+1; j<urls.count(); ++j) {
- if (find_helper(j, type, vmajor, vminor, 0, 0, base)) {
+ if (find_helper(typeLoader, j, type, vmajor, vminor, 0, 0, base)) {
if (errorString) {
QString u1 = urls.at(i);
QString u2 = urls.at(j);
@@ -1042,7 +1038,7 @@ bool QDeclarativeImportDatabase::importPlugin(const QString &filePath, const QSt
if (!engineInitialized || !typesRegistered) {
if (!QDeclarative_isFileCaseCorrect(absoluteFilePath)) {
if (errorString)
- *errorString = tr("File name case mismatch for \"%2\"").arg(absoluteFilePath);
+ *errorString = tr("File name case mismatch for \"%1\"").arg(absoluteFilePath);
return false;
}
QPluginLoader loader(absoluteFilePath);
diff --git a/src/declarative/qml/qdeclarativeimport_p.h b/src/declarative/qml/qdeclarativeimport_p.h
index 319e76c..d2ae9cc 100644
--- a/src/declarative/qml/qdeclarativeimport_p.h
+++ b/src/declarative/qml/qdeclarativeimport_p.h
@@ -68,11 +68,13 @@ class QDir;
class QDeclarativeImportedNamespace;
class QDeclarativeImportsPrivate;
class QDeclarativeImportDatabase;
+class QDeclarativeTypeLoader;
class QDeclarativeImports
{
public:
QDeclarativeImports();
+ QDeclarativeImports(QDeclarativeTypeLoader *);
QDeclarativeImports(const QDeclarativeImports &);
~QDeclarativeImports();
QDeclarativeImports &operator=(const QDeclarativeImports &);
diff --git a/src/declarative/qml/qdeclarativetypeloader.cpp b/src/declarative/qml/qdeclarativetypeloader.cpp
index 82197dc..0d8119f 100644
--- a/src/declarative/qml/qdeclarativetypeloader.cpp
+++ b/src/declarative/qml/qdeclarativetypeloader.cpp
@@ -50,10 +50,37 @@
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtCore/qdebug.h>
#include <QtCore/qdir.h>
+#include <QtCore/qdiriterator.h>
#include <QtCore/qfile.h>
QT_BEGIN_NAMESPACE
+/*
+Returns the set of QML files in path (qmldir, *.qml, *.js). The caller
+is responsible for deleting the returned data.
+*/
+static QSet<QString> *qmlFilesInDirectory(const QString &path)
+{
+ QDirIterator dir(path, QDir::Files);
+ if (!dir.hasNext())
+ return 0;
+ QSet<QString> *files = new QSet<QString>;
+ while (dir.hasNext()) {
+ dir.next();
+ QString fileName = dir.fileName();
+ if (fileName == QLatin1String("qmldir")
+ || fileName.endsWith(QLatin1String(".qml"))
+ || fileName.endsWith(QLatin1String(".js"))) {
+#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_DARWIN) || defined(Q_OS_SYMBIAN)
+ fileName = fileName.toLower();
+#endif
+ files->insert(fileName);
+ }
+ }
+ return files;
+}
+
+
/*!
\class QDeclarativeDataBlob
\brief The QDeclarativeDataBlob encapsulates a data request that can be issued to a QDeclarativeDataLoader.
@@ -727,6 +754,67 @@ QDeclarativeQmldirData *QDeclarativeTypeLoader::getQmldir(const QUrl &url)
}
/*!
+Returns the absolute filename of path via a directory cache for files named
+"qmldir", "*.qml", "*.js"
+Returns a empty string if the path does not exist.
+*/
+QString QDeclarativeTypeLoader::absoluteFilePath(const QString &path)
+{
+ if (path.isEmpty())
+ return QString();
+ if (path.at(0) == QLatin1Char(':')) {
+ // qrc resource
+ QFileInfo fileInfo(path);
+ return fileInfo.isFile() ? fileInfo.absoluteFilePath() : QString();
+ }
+#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_DARWIN) || defined(Q_OS_SYMBIAN)
+ QString lowPath(path.toLower());
+#else
+ QString lowPath(path);
+#endif
+ int lastSlash = lowPath.lastIndexOf(QLatin1Char('/'));
+ QString dirPath = lowPath.left(lastSlash);
+
+ StringSet *fileSet = 0;
+ QHash<QString,StringSet*>::const_iterator it = m_importDirCache.find(dirPath);
+ if (it == m_importDirCache.end()) {
+ StringSet *files = qmlFilesInDirectory(path.left(lastSlash));
+ m_importDirCache.insert(dirPath, files);
+ fileSet = files;
+ } else {
+ fileSet = *it;
+ }
+ if (!fileSet)
+ return QString();
+
+ QString absoluteFilePath = fileSet->contains(QString(lowPath.constData()+lastSlash+1, lowPath.length()-lastSlash-1)) ? path : QString();
+ if (absoluteFilePath.length() > 2 && absoluteFilePath.at(0) != QLatin1Char('/') && absoluteFilePath.at(1) != QLatin1Char(':'))
+ absoluteFilePath = QFileInfo(absoluteFilePath).absoluteFilePath();
+
+ return absoluteFilePath;
+}
+
+/*!
+Return a QDeclarativeDirParser for absoluteFilePath. The QDeclarativeDirParser may be cached.
+*/
+const QDeclarativeDirParser *QDeclarativeTypeLoader::qmlDirParser(const QString &absoluteFilePath)
+{
+ QDeclarativeDirParser *qmldirParser;
+ QHash<QString,QDeclarativeDirParser*>::const_iterator it = m_importQmlDirCache.find(absoluteFilePath);
+ if (it == m_importQmlDirCache.end()) {
+ qmldirParser = new QDeclarativeDirParser;
+ qmldirParser->setFileSource(absoluteFilePath);
+ qmldirParser->setUrl(QUrl::fromLocalFile(absoluteFilePath));
+ qmldirParser->parse();
+ m_importQmlDirCache.insert(absoluteFilePath, qmldirParser);
+ } else {
+ qmldirParser = *it;
+ }
+
+ return qmldirParser;
+}
+
+/*
Clears cached information about loaded files, including any type data, scripts
and qmldir information.
*/
@@ -738,16 +826,20 @@ void QDeclarativeTypeLoader::clearCache()
(*iter)->release();
for (QmldirCache::Iterator iter = m_qmldirCache.begin(); iter != m_qmldirCache.end(); ++iter)
(*iter)->release();
+ qDeleteAll(m_importDirCache);
+ qDeleteAll(m_importQmlDirCache);
m_typeCache.clear();
m_scriptCache.clear();
m_qmldirCache.clear();
+ m_importDirCache.clear();
+ m_importQmlDirCache.clear();
}
QDeclarativeTypeData::QDeclarativeTypeData(const QUrl &url, QDeclarativeTypeLoader::Options options,
QDeclarativeTypeLoader *manager)
-: QDeclarativeDataBlob(url, QmlFile), m_options(options), m_typesResolved(false),
+: QDeclarativeDataBlob(url, QmlFile), m_options(options), m_imports(manager), m_typesResolved(false),
m_compiledData(0), m_typeLoader(manager)
{
}
diff --git a/src/declarative/qml/qdeclarativetypeloader_p.h b/src/declarative/qml/qdeclarativetypeloader_p.h
index 56b6636..c0dce3e 100644
--- a/src/declarative/qml/qdeclarativetypeloader_p.h
+++ b/src/declarative/qml/qdeclarativetypeloader_p.h
@@ -198,14 +198,23 @@ public:
QDeclarativeScriptData *getScript(const QUrl &);
QDeclarativeQmldirData *getQmldir(const QUrl &);
+
+ QString absoluteFilePath(const QString &path);
+ const QDeclarativeDirParser *qmlDirParser(const QString &absoluteFilePath);
+
private:
typedef QHash<QUrl, QDeclarativeTypeData *> TypeCache;
typedef QHash<QUrl, QDeclarativeScriptData *> ScriptCache;
typedef QHash<QUrl, QDeclarativeQmldirData *> QmldirCache;
+ typedef QSet<QString> StringSet;
+ typedef QHash<QString, StringSet*> ImportDirCache;
+ typedef QHash<QString, QDeclarativeDirParser*> ImportQmlDirCache;
TypeCache m_typeCache;
ScriptCache m_scriptCache;
QmldirCache m_qmldirCache;
+ ImportDirCache m_importDirCache;
+ ImportQmlDirCache m_importQmlDirCache;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeTypeLoader::Options)
diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp
index 5cdf785..f86274f 100644
--- a/src/declarative/util/qdeclarativepropertychanges.cpp
+++ b/src/declarative/util/qdeclarativepropertychanges.cpp
@@ -171,7 +171,8 @@ public:
reverseExpression = rewindExpression;
}
- /*virtual void copyOriginals(QDeclarativeActionEvent *other)
+ virtual bool needsCopy() { return true; }
+ virtual void copyOriginals(QDeclarativeActionEvent *other)
{
QDeclarativeReplaceSignalHandler *rsh = static_cast<QDeclarativeReplaceSignalHandler*>(other);
saveCurrentValues();
@@ -182,7 +183,7 @@ public:
ownedExpression = rsh->ownedExpression;
rsh->ownedExpression = 0;
}
- }*/
+ }
virtual void rewind() {
ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, rewindExpression);
diff --git a/src/gui/dialogs/dialogs.pri b/src/gui/dialogs/dialogs.pri
index 1dddb44..fc1ea9e 100644
--- a/src/gui/dialogs/dialogs.pri
+++ b/src/gui/dialogs/dialogs.pri
@@ -109,11 +109,7 @@ SOURCES += \
dialogs/qprintpreviewdialog.cpp
symbian:contains(QT_CONFIG, s60) {
- contains(CONFIG, is_using_gnupoc) {
- LIBS += -lcommondialogs
- } else {
- LIBS += -lCommonDialogs
- }
+ LIBS += -lcommondialogs
SOURCES += dialogs/qfiledialog_symbian.cpp \
dialogs/qcolordialog_symbian.cpp
}
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index ad51b4b..90d47f9 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -205,6 +205,7 @@ private:
QBasicTimer m_tempPreeditStringTimeout;
bool m_hasTempPreeditString;
QString m_cachedPreeditString;
+ int m_cachedCursorAndAnchorPosition;
int m_splitViewResizeBy;
Qt::WindowStates m_splitViewPreviousWindowStates;
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 8f13c53..ed7411f 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -380,6 +380,7 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
m_formatRetriever(0),
m_pointerHandler(0),
m_hasTempPreeditString(false),
+ m_cachedCursorAndAnchorPosition(-1),
m_splitViewResizeBy(0),
m_splitViewPreviousWindowStates(Qt::WindowNoState),
m_splitViewPreviousFocusItem(0),
@@ -448,9 +449,18 @@ void QCoeFepInputContext::reset()
}
// Store a copy of preedit text, if prediction is active and input context is reseted.
// This is to ensure that we can replace preedit string after losing focus to FEP manager's
- // internal sub-windows.
- if (m_cachedPreeditString.isEmpty() && !(currentHints & Qt::ImhNoPredictiveText))
+ // internal sub-windows. Additionally, store the cursor position if there is no selected text.
+ // This allows input context to replace preedit strings if they are not at the end of current
+ // text.
+ if (m_cachedPreeditString.isEmpty() && !(currentHints & Qt::ImhNoPredictiveText)) {
m_cachedPreeditString = m_preeditString;
+ if (focusWidget() && !m_cachedPreeditString.isEmpty()) {
+ int cursor = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt();
+ int anchor = focusWidget()->inputMethodQuery(Qt::ImAnchorPosition).toInt();
+ if (cursor == anchor)
+ m_cachedCursorAndAnchorPosition = cursor;
+ }
+ }
commitCurrentString(true);
// QGraphicsScene calls reset() when changing focus item. Unfortunately, the new focus item is
@@ -491,6 +501,7 @@ void QCoeFepInputContext::setFocusWidget(QWidget *w)
void QCoeFepInputContext::widgetDestroyed(QWidget *w)
{
m_cachedPreeditString.clear();
+ m_cachedCursorAndAnchorPosition = -1;
// Make sure that the input capabilities of whatever new widget got focused are queried.
CCoeControl *ctrl = w->effectiveWinId();
@@ -1350,6 +1361,7 @@ void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText,
return;
m_cachedPreeditString.clear();
+ m_cachedCursorAndAnchorPosition = -1;
commitTemporaryPreeditString();
@@ -1408,8 +1420,16 @@ void QCoeFepInputContext::UpdateFepInlineTextL(const TDesC& aNewInlineText,
QString newPreeditString = qt_TDesC2QString(aNewInlineText);
QInputMethodEvent event(newPreeditString, attributes);
if (!m_cachedPreeditString.isEmpty()) {
- event.setCommitString(QLatin1String(""), -m_cachedPreeditString.length(), m_cachedPreeditString.length());
+ int cursorPos = w->inputMethodQuery(Qt::ImCursorPosition).toInt();
+ // Predicted word is either replaced from the end of the word (normal case),
+ // or from stored location, if the predicted word is either in the beginning of,
+ // or in the middle of already committed word.
+ int diff = cursorPos - m_cachedCursorAndAnchorPosition;
+ int replaceLocation = (diff != m_cachedPreeditString.length()) ? diff : m_cachedPreeditString.length();
+
+ event.setCommitString(QLatin1String(""), -replaceLocation, m_cachedPreeditString.length());
m_cachedPreeditString.clear();
+ m_cachedCursorAndAnchorPosition = -1;
} else if (newPreeditString.isEmpty() && m_preeditString.isEmpty()) {
// In Symbian world this means "erase last character".
event.setCommitString(QLatin1String(""), -1, 1);
@@ -1507,6 +1527,10 @@ void QCoeFepInputContext::SetCursorSelectionForFepL(const TCursorSelection& aCur
int pos = aCursorSelection.iAnchorPos;
int length = aCursorSelection.iCursorPos - pos;
+ if (m_cachedCursorAndAnchorPosition != -1) {
+ pos = m_cachedCursorAndAnchorPosition;
+ length = 0;
+ }
QList<QInputMethodEvent::Attribute> attributes;
attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos, length, QVariant());
@@ -1524,6 +1548,13 @@ void QCoeFepInputContext::GetCursorSelectionForFep(TCursorSelection& aCursorSele
int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + m_preeditString.size();
int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt() + m_preeditString.size();
+
+ // If the position is stored, use that value, so that word replacement from proposed word
+ // lists are added to the correct position.
+ if (m_cachedCursorAndAnchorPosition != -1) {
+ cursor = m_cachedCursorAndAnchorPosition;
+ anchor = m_cachedCursorAndAnchorPosition;
+ }
QString text = w->inputMethodQuery(Qt::ImSurroundingText).value<QString>();
int combinedSize = text.size() + m_preeditString.size();
if (combinedSize < anchor || combinedSize < cursor) {
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 35a9559..3605472 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -3426,7 +3426,35 @@ QString QApplication::sessionKey() const
}
#endif
+/*!
+ \since 4.7.4
+ \fn void QApplication::aboutToReleaseGpuResources()
+
+ This signal is emitted when application is about to release all
+ GPU resources associated to contexts owned by application.
+
+ The signal is particularly useful if your application has allocated
+ GPU resources directly apart from Qt and needs to do some last-second
+ cleanup.
+
+ \warning This signal is only emitted on Symbian.
+
+ \sa aboutToUseGpuResources()
+*/
+/*!
+ \since 4.7.4
+ \fn void QApplication::aboutToUseGpuResources()
+
+ This signal is emitted when application is about to use GPU resources.
+
+ The signal is particularly useful if your application needs to know
+ when GPU resources are be available.
+
+ \warning This signal is only emitted on Symbian.
+
+ \sa aboutToFreeGpuResources()
+*/
/*!
\since 4.2
diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h
index 1548849..3334056 100644
--- a/src/gui/kernel/qapplication.h
+++ b/src/gui/kernel/qapplication.h
@@ -305,6 +305,10 @@ Q_SIGNALS:
void commitDataRequest(QSessionManager &sessionManager);
void saveStateRequest(QSessionManager &sessionManager);
#endif
+#ifdef Q_OS_SYMBIAN
+ void aboutToReleaseGpuResources();
+ void aboutToUseGpuResources();
+#endif
public:
QString styleSheet() const;
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index 0756d6c..c4cb19c 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -564,6 +564,9 @@ public:
void symbianHandleLiteModeStartup();
void _q_aboutToQuit();
+
+ void emitAboutToReleaseGpuResources();
+ void emitAboutToUseGpuResources();
#endif
#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined (Q_WS_QWS) || defined(Q_WS_MAC) || defined(Q_WS_QPA)
void sendSyntheticEnterLeave(QWidget *widget);
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 7d198ce..46b16cb 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -92,6 +92,10 @@
#include <graphics/wstfxconst.h>
#endif
+#ifdef COE_GROUPED_POINTER_EVENT_VERSION
+#include <coeeventdata.h>
+#endif
+
QT_BEGIN_NAMESPACE
// Goom Events through Window Server
@@ -235,6 +239,9 @@ void QS60Data::controlVisibilityChanged(CCoeControl *control, bool visible)
if (QTLWExtra *topData = qt_widget_private(window)->maybeTopData()) {
QWidgetBackingStoreTracker &backingStore = topData->backingStore;
if (visible) {
+ QApplicationPrivate *d = QApplicationPrivate::instance();
+ d->emitAboutToUseGpuResources();
+
if (backingStore.data()) {
backingStore.registerWidget(widget);
} else {
@@ -244,6 +251,9 @@ void QS60Data::controlVisibilityChanged(CCoeControl *control, bool visible)
widget->repaint();
}
} else {
+ QApplicationPrivate *d = QApplicationPrivate::instance();
+ d->emitAboutToReleaseGpuResources();
+
// In certain special scenarios we may get an ENotVisible event
// without a previous EPartiallyVisible. The backingstore must
// still be destroyed, hence the registerWidget() call below.
@@ -584,7 +594,11 @@ QSymbianControl::~QSymbianControl()
{
// Ensure backing store is deleted before the top-level
// window is destroyed
- qt_widget_private(qwidget)->topData()->backingStore.destroy();
+ QT_TRY {
+ qt_widget_private(qwidget)->topData()->backingStore.destroy();
+ } QT_CATCH(const std::exception&) {
+ // ignore exceptions, nothing can be done
+ }
if (S60->curWin == this)
S60->curWin = 0;
@@ -667,71 +681,121 @@ void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, cons
}
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
+#ifdef COE_GROUPED_POINTER_EVENT_VERSION
+void QSymbianControl::translateMultiEventPointerEvent(const CCoeEventData &eventData )
+{
+ TUint count = eventData.Count();
+ QVector<TouchEventParams> touches;
+ touches.reserve(count);
+ for (int i = 0; i < count; i++) {
+ const TPointerEvent *pointerEvent = eventData.Pointer(i);
+ const TAdvancedPointerEvent *advEvent = pointerEvent->AdvancedPointerEvent();
+ if (advEvent)
+ touches.push_back(TouchEventFromAdvancedPointerEvent(advEvent));
+ }
+ if (touches.size())
+ processTouchEvents(touches);
+}
+#endif
+
void QSymbianControl::translateAdvancedPointerEvent(const TAdvancedPointerEvent *event)
{
+ processTouchEvents(QVector<TouchEventParams>(1, TouchEventFromAdvancedPointerEvent(event)));
+}
+
+QSymbianControl::TouchEventParams QSymbianControl::TouchEventFromAdvancedPointerEvent(const TAdvancedPointerEvent *event)
+{
QApplicationPrivate *d = QApplicationPrivate::instance();
QPointF screenPos = qwidget->mapToGlobal(translatePointForFixedNativeOrientation(event->iPosition));
qreal pressure;
- if(d->pressureSupported
+ if (d->pressureSupported
&& event->Pressure() > 0) //workaround for misconfigured HAL
pressure = event->Pressure() / qreal(d->maxTouchPressure);
else
pressure = qreal(1.0);
- processTouchEvent(event->PointerNumber(), event->iType, screenPos, pressure);
+ return TouchEventParams(event->PointerNumber(), event->iType, screenPos, pressure);
}
#endif
-void QSymbianControl::processTouchEvent(int pointerNumber, TPointerEvent::TType type, QPointF screenPos, qreal pressure)
+QSymbianControl::TouchEventParams::TouchEventParams()
+{}
+
+QSymbianControl::TouchEventParams::TouchEventParams(int pointerNumber, TPointerEvent::TType type, QPointF screenPos, qreal pressure)
+ : pointerNumber(pointerNumber),
+ type(type),
+ screenPos(screenPos),
+ pressure(pressure)
+{}
+
+void QSymbianControl::processTouchEvents(const QVector<TouchEventParams> &touches)
{
QRect screenGeometry = qApp->desktop()->screenGeometry(qwidget);
QApplicationPrivate *d = QApplicationPrivate::instance();
+ // get the maximum pointer number
+ int numUpdates = touches.size();
+ int maxPointerNumber = 0;
+ for (int i = 0; i < numUpdates; ++i) {
+ const TouchEventParams &touch = touches[i];
+ maxPointerNumber = qMax(maxPointerNumber, touch.pointerNumber);
+ }
+
+ // ensure there are sufficient touch events in the list,
+ // touch events will be indexed by pointerNumber
QList<QTouchEvent::TouchPoint> points = d->appAllTouchPoints;
- while (points.count() <= pointerNumber)
+ while (points.count() <= maxPointerNumber)
points.append(QTouchEvent::TouchPoint(points.count()));
- Qt::TouchPointStates allStates = 0;
+ // first set all active touch points to stationary
for (int i = 0; i < points.count(); ++i) {
QTouchEvent::TouchPoint &touchPoint = points[i];
+ if (touchPoint.state() != Qt::TouchPointReleased) {
+ touchPoint.setState(Qt::TouchPointStationary);
+ }
+ }
- if (touchPoint.id() == pointerNumber) {
- Qt::TouchPointStates state;
- switch (type) {
- case TPointerEvent::EButton1Down:
+ // Add all info about moving or state changed touch points
+ for (int i = 0; i < numUpdates; ++i) {
+ const TouchEventParams &touch = touches[i];
+ QTouchEvent::TouchPoint &touchPoint = points[touch.pointerNumber];
+ Qt::TouchPointStates state;
+ switch (touch.type) {
+ case TPointerEvent::EButton1Down:
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
- case TPointerEvent::EEnterHighPressure:
+ case TPointerEvent::EEnterHighPressure:
#endif
- state = Qt::TouchPointPressed;
- break;
- case TPointerEvent::EButton1Up:
+ state = Qt::TouchPointPressed;
+ break;
+ case TPointerEvent::EButton1Up:
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
- case TPointerEvent::EExitCloseProximity:
-#endif
- state = Qt::TouchPointReleased;
- break;
- case TPointerEvent::EDrag:
- state = Qt::TouchPointMoved;
- break;
- default:
- // how likely is this to happen?
- state = Qt::TouchPointStationary;
- break;
- }
- if (pointerNumber == 0)
- state |= Qt::TouchPointPrimary;
- touchPoint.setState(state);
+ case TPointerEvent::EExitCloseProximity:
+#endif
+ state = Qt::TouchPointReleased;
+ break;
+ case TPointerEvent::EDrag:
+ state = Qt::TouchPointMoved;
+ break;
+ default:
+ // how likely is this to happen?
+ state = Qt::TouchPointStationary;
+ break;
+ }
+ if (touch.pointerNumber == 0)
+ state |= Qt::TouchPointPrimary;
+ touchPoint.setState(state);
- touchPoint.setScreenPos(screenPos);
- touchPoint.setNormalizedPos(QPointF(screenPos.x() / screenGeometry.width(),
- screenPos.y() / screenGeometry.height()));
+ touchPoint.setScreenPos(touch.screenPos);
+ touchPoint.setNormalizedPos(QPointF(touch.screenPos.x() / screenGeometry.width(),
+ touch.screenPos.y() / screenGeometry.height()));
- touchPoint.setPressure(pressure);
- } else if (touchPoint.state() != Qt::TouchPointReleased) {
- // all other active touch points should be marked as stationary
- touchPoint.setState(Qt::TouchPointStationary);
- }
+ touchPoint.setPressure(touch.pressure);
+ }
+ // check the resulting state of all touch points
+ Qt::TouchPointStates allStates = 0;
+ for (int i = 0; i < points.count(); ++i) {
+ QTouchEvent::TouchPoint &touchPoint = points[i];
allStates |= touchPoint.state();
}
@@ -750,6 +814,28 @@ void QSymbianControl::processTouchEvent(int pointerNumber, TPointerEvent::TType
void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent)
{
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
+#ifdef COE_GROUPED_POINTER_EVENT_VERSION
+ if (pEvent.iType == TPointerEvent::EDataCCoeEventData) {
+ // only advanced pointers can be data type pointer events
+ const TAdvancedPointerEvent *advEvent = pEvent.AdvancedPointerEvent();
+ if (!advEvent)
+ return;
+ const CCoeEventData& eventData = CCoeEventData::EventData(*advEvent);
+ if (eventData.Type() == CWsEventWithData::EPointerEvent) {
+ QT_TRYCATCH_LEAVING(translateMultiEventPointerEvent(eventData));
+ // pointer 0 events and unnumbered events should also be handled as mouse events
+ for (int i=0; i<eventData.Count(); i++) {
+ const TPointerEvent *pointerEvent = eventData.Pointer(i);
+ const TAdvancedPointerEvent *advEvent = pointerEvent->AdvancedPointerEvent();
+ if (!advEvent || advEvent->PointerNumber() == 0) {
+ m_longTapDetector->PointerEventL(*pointerEvent);
+ QT_TRYCATCH_LEAVING(HandlePointerEvent(*pointerEvent));
+ }
+ }
+ return;
+ }
+ }
+#endif
if (pEvent.IsAdvancedPointerEvent()) {
const TAdvancedPointerEvent *advancedPointerEvent = pEvent.AdvancedPointerEvent();
translateAdvancedPointerEvent(advancedPointerEvent);
@@ -823,7 +909,7 @@ void QSymbianControl::HandlePointerEvent(const TPointerEvent& pEvent)
//Generate single touch event for S60 5.0 (has touchscreen, does not have advanced pointers)
#ifndef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
if (S60->hasTouchscreen) {
- processTouchEvent(0, pEvent.iType, QPointF(globalPos), 1.0);
+ processTouchEvents(QVector<TouchEventParams>(1, TouchEventParams(0, pEvent.iType, QPointF(globalPos), 1.0)));
}
#endif
@@ -2795,6 +2881,24 @@ void QApplicationPrivate::_q_aboutToQuit()
#endif
}
+void QApplicationPrivate::emitAboutToReleaseGpuResources()
+{
+#ifdef Q_SYMBIAN_SUPPORTS_SURFACES
+ Q_Q(QApplication);
+ QPointer<QApplication> guard(q);
+ emit q->aboutToReleaseGpuResources();
+#endif
+}
+
+void QApplicationPrivate::emitAboutToUseGpuResources()
+{
+#ifdef Q_SYMBIAN_SUPPORTS_SURFACES
+ Q_Q(QApplication);
+ QPointer<QApplication> guard(q);
+ emit q->aboutToUseGpuResources();
+#endif
+}
+
QS60ThreadLocalData::QS60ThreadLocalData()
{
CCoeEnv *env = CCoeEnv::Static();
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 5ad5b00..5b5d5ce 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -102,6 +102,10 @@ class QSymbianTypeFaceExtras;
typedef QHash<QString, const QSymbianTypeFaceExtras *> QSymbianTypeFaceExtrasHash;
typedef void (*QThreadLocalReleaseFunc)();
+#ifdef COE_GROUPED_POINTER_EVENT_VERSION
+class CCoeEventData;
+#endif
+
class Q_AUTOTEST_EXPORT QS60ThreadLocalData
{
public:
@@ -308,10 +312,23 @@ private:
const QPoint &globalPos,
Qt::MouseButton button,
Qt::KeyboardModifiers modifiers);
- void processTouchEvent(int pointerNumber, TPointerEvent::TType type, QPointF screenPos, qreal pressure);
+ struct TouchEventParams
+ {
+ TouchEventParams();
+ TouchEventParams(int pointerNumber, TPointerEvent::TType type, QPointF screenPos, qreal pressure);
+ int pointerNumber;
+ TPointerEvent::TType type;
+ QPointF screenPos;
+ qreal pressure;
+ };
+ void processTouchEvents(const QVector<TouchEventParams> &touches);
void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation );
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
+#ifdef COE_GROUPED_POINTER_EVENT_VERSION
+ void translateMultiEventPointerEvent(const CCoeEventData &eventData );
+#endif
void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event);
+ TouchEventParams TouchEventFromAdvancedPointerEvent(const TAdvancedPointerEvent *event);
#endif
bool isSplitViewWidget(QWidget *widget);
bool hasFocusedAndVisibleChild(QWidget *parentWidget);
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 396c306..a37c265 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -1040,8 +1040,12 @@ void QWidgetPrivate::registerTouchWindow()
RWindow *rwindow = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
QSymbianControl *window = static_cast<QSymbianControl *>(q->effectiveWinId());
//Enabling advanced pointer events for controls that already have active windows causes a panic.
- if (!window->isControlActive())
+ if (!window->isControlActive()) {
rwindow->EnableAdvancedPointers();
+#ifdef COE_GROUPED_POINTER_EVENT_VERSION
+ qt_symbian_throwIfError(window->ConfigureEventData(CCoeControl::EEventDataAllowGroupedPointerEvents));
+#endif
+ }
}
#endif
}
diff --git a/src/gui/painting/qgraphicssystemex_symbian.cpp b/src/gui/painting/qgraphicssystemex_symbian.cpp
index 32e040f..5a182ff 100644
--- a/src/gui/painting/qgraphicssystemex_symbian.cpp
+++ b/src/gui/painting/qgraphicssystemex_symbian.cpp
@@ -46,7 +46,7 @@
#include <e32property.h>
-#ifdef Q_SYMBIAN_SUPPORTS_SURFACES
+#if defined(Q_SYMBIAN_SUPPORTS_SURFACES) && !defined (QT_NO_EGL)
#include "private/qegl_p.h"
#endif
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
static bool bcm2727Initialized = false;
static bool bcm2727 = false;
-#ifdef Q_SYMBIAN_SUPPORTS_SURFACES
+#if defined(Q_SYMBIAN_SUPPORTS_SURFACES) && !defined (QT_NO_EGL)
typedef EGLBoolean (*NOK_resource_profiling)(EGLDisplay, EGLint, EGLint*, EGLint, EGLint*);
#define EGL_PROF_TOTAL_MEMORY_NOK 0x3070
#endif
@@ -69,7 +69,7 @@ bool QSymbianGraphicsSystemEx::hasBCM2727()
if (bcm2727Initialized)
return bcm2727;
-#ifdef Q_SYMBIAN_SUPPORTS_SURFACES
+#if defined(Q_SYMBIAN_SUPPORTS_SURFACES) && !defined (QT_NO_EGL)
EGLDisplay display = QEgl::display();
#if 1
// Hacky but fast ~0ms.
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index fb5ce96..72357a6 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -9509,7 +9509,7 @@ void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivat
\oldcode
void *visual = QPaintDevice::x11AppVisual(screen);
\newcode
- void *visual = qApp->x11Info(screen).visual();
+ void *visual = widget->x11Info().appVisual(screen);
\endcode
\sa QWidget::x11Info(), QPixmap::x11Info()
@@ -9521,7 +9521,7 @@ void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivat
\oldcode
unsigned long colormap = QPaintDevice::x11AppColormap(screen);
\newcode
- unsigned long colormap = qApp->x11Info(screen).colormap();
+ unsigned long colormap = widget->x11Info().appColormap(screen);
\endcode
\sa QWidget::x11Info(), QPixmap::x11Info()
@@ -9533,7 +9533,7 @@ void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivat
\oldcode
Display *display = QPaintDevice::x11AppDisplay();
\newcode
- Display *display = qApp->x11Info().display();
+ Display *display = widget->x11Info().display();
\endcode
\sa QWidget::x11Info(), QPixmap::x11Info()
@@ -9545,7 +9545,7 @@ void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivat
\oldcode
int screen = QPaintDevice::x11AppScreen();
\newcode
- int screen = qApp->x11Info().screen();
+ int screen = widget->x11Info().appScreen();
\endcode
\sa QWidget::x11Info(), QPixmap::x11Info()
@@ -9557,7 +9557,7 @@ void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivat
\oldcode
int depth = QPaintDevice::x11AppDepth(screen);
\newcode
- int depth = qApp->x11Info(screen).depth();
+ int depth = widget->x11Info().appDepth(screen);
\endcode
\sa QWidget::x11Info(), QPixmap::x11Info()
@@ -9569,7 +9569,7 @@ void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivat
\oldcode
int cells = QPaintDevice::x11AppCells(screen);
\newcode
- int cells = qApp->x11Info(screen).cells();
+ int cells = widget->x11Info().appCells(screen);
\endcode
\sa QWidget::x11Info(), QPixmap::x11Info()
@@ -9581,7 +9581,7 @@ void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivat
\oldcode
unsigned long window = QPaintDevice::x11AppRootWindow(screen);
\newcode
- unsigned long window = qApp->x11Info(screen).appRootWindow();
+ unsigned long window = widget->x11Info().appRootWindow(screen);
\endcode
\sa QWidget::x11Info(), QPixmap::x11Info()
@@ -9593,7 +9593,7 @@ void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivat
\oldcode
bool isDefault = QPaintDevice::x11AppDefaultColormap(screen);
\newcode
- bool isDefault = qApp->x11Info(screen).defaultColormap();
+ bool isDefault = widget->x11Info().appDefaultColormap(screen);
\endcode
\sa QWidget::x11Info(), QPixmap::x11Info()
@@ -9605,7 +9605,7 @@ void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivat
\oldcode
bool isDefault = QPaintDevice::x11AppDefaultVisual(screen);
\newcode
- bool isDefault = qApp->x11Info(screen).defaultVisual();
+ bool isDefault = widget->x11Info().appDefaultVisual(screen);
\endcode
\sa QWidget::x11Info(), QPixmap::x11Info()
@@ -9625,7 +9625,7 @@ void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivat
\oldcode
bool isDefault = QPaintDevice::x11AppDpiX(screen);
\newcode
- bool isDefault = qApp->x11Info(screen).appDpiX();
+ bool isDefault = widget->x11Info().appDpiX(screen);
\endcode
\sa QWidget::x11Info(), QPixmap::x11Info()
@@ -9637,7 +9637,7 @@ void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivat
\oldcode
bool isDefault = QPaintDevice::x11AppDpiY(screen);
\newcode
- bool isDefault = qApp->x11Info(screen).appDpiY();
+ bool isDefault = widget->x11Info().appDpiY(screen);
\endcode
\sa QWidget::x11Info(), QPixmap::x11Info()
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index 2fa8c7f..ad55761 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -473,8 +473,8 @@ public:
private: //data members
//TODO: consider changing these to non-pointers as the classes are rather small anyway
- AnimationData *m_defaultData;
- AnimationDataV2 *m_currentData;
+ QScopedPointer<AnimationData> m_defaultData;
+ QScopedPointer<AnimationDataV2> m_currentData;
};
#endif //Q_WS_S60
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index cfb10fa..eb59115 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -132,14 +132,12 @@ AnimationDataV2::~AnimationDataV2()
QS60StyleAnimation::QS60StyleAnimation(const QS60StyleEnums::SkinParts part, int frames, int interval)
{
- QT_TRAP_THROWING(m_defaultData = new (ELeave) AnimationData(part, frames, interval));
- QT_TRAP_THROWING(m_currentData = new (ELeave) AnimationDataV2(*m_defaultData));
+ m_defaultData.reset(new AnimationData(part, frames, interval));
+ m_currentData.reset(new AnimationDataV2(*m_defaultData));
}
QS60StyleAnimation::~QS60StyleAnimation()
{
- delete m_currentData;
- delete m_defaultData;
}
void QS60StyleAnimation::setAnimationObject(CAknBitmapAnimation* animation)
@@ -152,9 +150,7 @@ void QS60StyleAnimation::setAnimationObject(CAknBitmapAnimation* animation)
void QS60StyleAnimation::resetToDefaults()
{
- delete m_currentData;
- m_currentData = 0;
- QT_TRAP_THROWING(m_currentData = new (ELeave) AnimationDataV2(*m_defaultData));
+ m_currentData.reset(new AnimationDataV2(*m_defaultData));
}
class QS60StyleModeSpecifics
diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri
index b6eeec9..45ed8eb 100644
--- a/src/gui/styles/styles.pri
+++ b/src/gui/styles/styles.pri
@@ -172,11 +172,7 @@ contains( styles, s60 ):contains(QT_CONFIG, s60) {
symbian {
SOURCES += styles/qs60style_s60.cpp
LIBS += -legul -lbmpanim
- contains(CONFIG, is_using_gnupoc) {
- LIBS += -laknicon -laknskins -laknskinsrv -lfontutils
- } else {
- LIBS += -lAknIcon -lAKNSKINS -lAKNSKINSRV -lFontUtils
- }
+ LIBS += -laknicon -laknskins -laknskinsrv -lfontutils
} else {
SOURCES += styles/qs60style_simulated.cpp
RESOURCES += styles/qstyle_s60_simulated.qrc
diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri
index 7395604..7cf1a55 100644
--- a/src/gui/util/util.pri
+++ b/src/gui/util/util.pri
@@ -57,9 +57,5 @@ symbian {
DEFINES += USE_SCHEMEHANDLER
}
- contains(CONFIG, is_using_gnupoc) {
- LIBS += -ldirectorylocalizer
- } else {
- LIBS += -lDirectoryLocalizer
- }
+ LIBS += -ldirectorylocalizer
}
diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp
index c0be3e1..2b6eeb7 100644
--- a/src/gui/widgets/qlabel.cpp
+++ b/src/gui/widgets/qlabel.cpp
@@ -60,7 +60,7 @@
#endif
#ifdef Q_OS_SYMBIAN
-#include "qt_s60_p.h"
+#include "private/qt_s60_p.h"
#endif
QT_BEGIN_NAMESPACE
diff --git a/src/imports/folderlistmodel/folderlistmodel.pro b/src/imports/folderlistmodel/folderlistmodel.pro
index 44764a9..0f63979 100644
--- a/src/imports/folderlistmodel/folderlistmodel.pro
+++ b/src/imports/folderlistmodel/folderlistmodel.pro
@@ -19,8 +19,8 @@ symbian:{
isEmpty(DESTDIR):importFiles.files = qmlfolderlistmodelplugin$${QT_LIBINFIX}.dll qmldir
else:importFiles.files = $$DESTDIR/qmlfolderlistmodelplugin$${QT_LIBINFIX}.dll qmldir
importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
-
- DEPLOYMENT = importFiles
+
+ DEPLOYMENT += importFiles
}
INSTALLS += target qmldir
diff --git a/src/imports/gestures/gestures.pro b/src/imports/gestures/gestures.pro
index ad872ba..2768cc9 100644
--- a/src/imports/gestures/gestures.pro
+++ b/src/imports/gestures/gestures.pro
@@ -19,8 +19,8 @@ symbian:{
isEmpty(DESTDIR):importFiles.files = qmlgesturesplugin$${QT_LIBINFIX}.dll qmldir
else:importFiles.files = $$DESTDIR/qmlgesturesplugin$${QT_LIBINFIX}.dll qmldir
importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
-
- DEPLOYMENT = importFiles
+
+ DEPLOYMENT += importFiles
}
INSTALLS += target qmldir
diff --git a/src/imports/particles/particles.pro b/src/imports/particles/particles.pro
index 90b50e4..894d164 100644
--- a/src/imports/particles/particles.pro
+++ b/src/imports/particles/particles.pro
@@ -23,8 +23,8 @@ symbian:{
isEmpty(DESTDIR):importFiles.files = qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir
else:importFiles.files = $$DESTDIR/qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir
importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
-
- DEPLOYMENT = importFiles
+
+ DEPLOYMENT += importFiles
}
INSTALLS += target qmldir
diff --git a/src/imports/shaders/shaders.pro b/src/imports/shaders/shaders.pro
index d7a6275..51a9a91 100644
--- a/src/imports/shaders/shaders.pro
+++ b/src/imports/shaders/shaders.pro
@@ -32,7 +32,7 @@ symbian:{
isEmpty(DESTDIR):importFiles.sources = qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir
else:importFiles.sources = $$DESTDIR/qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir
importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
}
INSTALLS += target qmldir
diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp
index 50a3b1e..eccfea6 100644
--- a/src/network/access/qftp.cpp
+++ b/src/network/access/qftp.cpp
@@ -1851,11 +1851,11 @@ int QFtp::cd(const QString &dir)
int QFtp::get(const QString &file, QIODevice *dev, TransferType type)
{
QStringList cmds;
- cmds << QLatin1String("SIZE ") + file + QLatin1String("\r\n");
if (type == Binary)
cmds << QLatin1String("TYPE I\r\n");
else
cmds << QLatin1String("TYPE A\r\n");
+ cmds << QLatin1String("SIZE ") + file + QLatin1String("\r\n");
cmds << QLatin1String(d_func()->transferMode == Passive ? "PASV\r\n" : "PORT\r\n");
cmds << QLatin1String("RETR ") + file + QLatin1String("\r\n");
return d_func()->addCommand(new QFtpCommand(Get, cmds, dev));
@@ -2336,7 +2336,7 @@ void QFtpPrivate::_q_piError(int errorCode, const QString &text)
// non-fatal errors
if (c->command == QFtp::Get && pi.currentCommand().startsWith(QLatin1String("SIZE "))) {
- pi.dtp.setBytesTotal(-1);
+ pi.dtp.setBytesTotal(0);
return;
} else if (c->command==QFtp::Put && pi.currentCommand().startsWith(QLatin1String("ALLO "))) {
return;
diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp
index 88c45d1..1dc1268 100644
--- a/src/network/access/qnetworkaccessbackend.cpp
+++ b/src/network/access/qnetworkaccessbackend.cpp
@@ -72,10 +72,10 @@ public:
QMutex mutex;
//this is used to avoid (re)constructing factory data from destructors of other global classes
- static QAtomicInt valid;
+ static QBasicAtomicInt valid;
};
Q_GLOBAL_STATIC(QNetworkAccessBackendFactoryData, factoryData)
-QAtomicInt QNetworkAccessBackendFactoryData::valid;
+QBasicAtomicInt QNetworkAccessBackendFactoryData::valid = Q_BASIC_ATOMIC_INITIALIZER(0);
QNetworkAccessBackendFactory::QNetworkAccessBackendFactory()
{
diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp
index 1c515c2..a567c2d 100644
--- a/src/network/access/qnetworkdiskcache.cpp
+++ b/src/network/access/qnetworkdiskcache.cpp
@@ -429,7 +429,7 @@ QIODevice *QNetworkDiskCache::data(const QUrl &url)
// ### verify that QFile uses the fd size and not the file name
qint64 size = file->size() - file->pos();
const uchar *p = 0;
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_INTEGRITY)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_SYMBIAN)
p = file->map(file->pos(), size);
#endif
if (p) {
@@ -478,7 +478,7 @@ void QNetworkDiskCache::updateMetaData(const QNetworkCacheMetaData &metaData)
}
/*!
- Returns the current maximum size for the disk cache.
+ Returns the current maximum size in bytes for the disk cache.
\sa setMaximumCacheSize()
*/
@@ -489,7 +489,7 @@ qint64 QNetworkDiskCache::maximumCacheSize() const
}
/*!
- Sets the maximum size of the disk cache to be \a size.
+ Sets the maximum size of the disk cache to be \a size in bytes.
If the new size is smaller then the current cache size then the cache will call expire().
diff --git a/src/network/ssl/qssl.cpp b/src/network/ssl/qssl.cpp
index 08a05ff..b556328 100644
--- a/src/network/ssl/qssl.cpp
+++ b/src/network/ssl/qssl.cpp
@@ -131,7 +131,7 @@ QT_BEGIN_NAMESPACE
fragments into the data when using block ciphers. When enabled, this
prevents some attacks (such as the BEAST attack), however it is
incompatible with some servers.
- \value SslOptionDisableTickets Disables the SSL session ticket
+ \value SslOptionDisableSessionTickets Disables the SSL session ticket
extension. This can cause slower connection setup, however some servers
are not compatible with the extension.
\value SslOptionDisableCompression Disables the SSL compression
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index dbbb07c..f5fe739 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -2268,6 +2268,8 @@ void QGL2PaintEngineExPrivate::updateClipScissorTest()
currentScissorBounds = bounds;
if (bounds == QRect(0, 0, width, height)) {
+ if (ctx->d_func()->workaround_brokenScissor)
+ clearClip(0);
glDisable(GL_SCISSOR_TEST);
} else {
glEnable(GL_SCISSOR_TEST);
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index eaaf9a8..08b9ca3 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1743,6 +1743,7 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format)
workaround_brokenTextureFromPixmap = false;
workaround_brokenTextureFromPixmap_init = false;
+ workaround_brokenScissor = false;
workaround_brokenAlphaTexSubImage = false;
workaround_brokenAlphaTexSubImage_init = false;
@@ -4381,7 +4382,7 @@ bool QGLWidget::event(QEvent *e)
// if we've reparented a window that has the current context
// bound, we need to rebind that context to the new window id
if (d->glcx == QGLContext::currentContext())
- makeCurrent();
+ makeCurrent(); // Shouldn't happen but keep it here just for sure
if (testAttribute(Qt::WA_TranslucentBackground))
setContext(new QGLContext(d->glcx->requestedFormat(), this));
@@ -4389,8 +4390,11 @@ bool QGLWidget::event(QEvent *e)
// A re-parent is likely to destroy the Symbian window and re-create it. It is important
// that we free the EGL surface _before_ the winID changes - otherwise we can leak.
- if (e->type() == QEvent::ParentAboutToChange)
+ if (e->type() == QEvent::ParentAboutToChange) {
+ if (d->glcx == QGLContext::currentContext())
+ d->glcx->doneCurrent();
d->glcx->d_func()->destroyEglSurfaceForDevice();
+ }
if ((e->type() == QEvent::ParentChange) || (e->type() == QEvent::WindowStateChange)) {
// The window may have been re-created during re-parent or state change - if so, the EGL
diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp
index 4de5122..0b96350 100644
--- a/src/opengl/qgl_egl.cpp
+++ b/src/opengl/qgl_egl.cpp
@@ -194,7 +194,9 @@ void QGLContext::makeCurrent()
if (!d->workaroundsCached) {
d->workaroundsCached = true;
const char *renderer = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
- if (renderer && (strstr(renderer, "SGX") || strstr(renderer, "MBX"))) {
+ if (!renderer)
+ return;
+ if ((strstr(renderer, "SGX") || strstr(renderer, "MBX"))) {
// PowerVR MBX/SGX chips needs to clear all buffers when starting to render
// a new frame, otherwise there will be a performance penalty to pay for
// each frame.
@@ -231,6 +233,13 @@ void QGLContext::makeCurrent()
d->workaround_brokenFBOReadBack = true;
}
}
+ } else if (strstr(renderer, "VideoCore III")) {
+ // Some versions of VideoCore III drivers seem to pollute and use
+ // stencil buffer when using glScissors even if stencil test is disabled.
+ // Workaround is to clear stencil buffer before disabling scissoring.
+
+ // qDebug() << "Found VideoCore III driver, enabling brokenDisableScissorTest";
+ d->workaround_brokenScissor = true;
}
}
}
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index b6fc96a..df09dfd 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -179,6 +179,7 @@ public:
#endif
#if defined(Q_OS_SYMBIAN)
, eglSurfaceWindowId(0)
+ , surfaceSizeInitialized(false)
#endif
{
isGLWidget = 1;
@@ -224,6 +225,7 @@ public:
#ifdef Q_OS_SYMBIAN
void recreateEglSurface();
WId eglSurfaceWindowId;
+ bool surfaceSizeInitialized : 1;
#endif
};
@@ -426,6 +428,7 @@ public:
uint workaround_brokenTextureFromPixmap : 1;
uint workaround_brokenTextureFromPixmap_init : 1;
+ uint workaround_brokenScissor : 1;
uint workaround_brokenAlphaTexSubImage : 1;
uint workaround_brokenAlphaTexSubImage_init : 1;
diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp
index b8e5c22..94c63fc 100644
--- a/src/opengl/qgl_symbian.cpp
+++ b/src/opengl/qgl_symbian.cpp
@@ -259,7 +259,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) // almost same as
return true;
}
-void QGLWidget::resizeEvent(QResizeEvent *)
+void QGLWidget::resizeEvent(QResizeEvent *e)
{
Q_D(QGLWidget);
if (!isValid())
@@ -270,17 +270,18 @@ void QGLWidget::resizeEvent(QResizeEvent *)
if (this == qt_gl_share_widget())
return;
- if (QGLContext::currentContext())
- doneCurrent();
-
- // Symbian needs to recreate the surface on resize.
- d->recreateEglSurface();
+ if (!d->surfaceSizeInitialized || e->oldSize() != e->size()) {
+ // On Symbian we need to recreate the surface on resize.
+ d->recreateEglSurface();
+ d->surfaceSizeInitialized = true;
+ }
makeCurrent();
+
if (!d->glcx->initialized())
glInit();
+
resizeGL(width(), height());
- //handle overlay
}
const QGLContext* QGLWidget::overlayContext() const
@@ -363,6 +364,9 @@ void QGLWidgetPrivate::recreateEglSurface()
WId currentId = q->winId();
if (glcx->d_func()->eglSurface != EGL_NO_SURFACE) {
+ if (glcx == QGLContext::currentContext())
+ glcx->doneCurrent();
+
eglDestroySurface(glcx->d_func()->eglContext->display(),
glcx->d_func()->eglSurface);
}
diff --git a/src/plugins/bearer/symbian/symbian.pri b/src/plugins/bearer/symbian/symbian.pri
index 8d92f57..74dc4ee 100644
--- a/src/plugins/bearer/symbian/symbian.pri
+++ b/src/plugins/bearer/symbian/symbian.pri
@@ -21,11 +21,7 @@ LIBS += -lcommdb \
-lefsrv \
-lnetmeta
-is_using_gnupoc {
- LIBS += -lconnmon
-} else {
- LIBS += -lConnMon
-}
+LIBS += -lconnmon
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/bearer
target.path += $$[QT_INSTALL_PLUGINS]/bearer
diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro
index a84c5ac..5144f35 100644
--- a/src/plugins/phonon/mmf/mmf.pro
+++ b/src/plugins/phonon/mmf/mmf.pro
@@ -103,11 +103,7 @@ symbian {
exists($${EPOCROOT}epoc32/include/mw/downloadmgrclient.h) {
HEADERS += $$PHONON_MMF_DIR/download.h
SOURCES += $$PHONON_MMF_DIR/download.cpp
- contains(CONFIG, is_using_gnupoc) {
- LIBS += -ldownloadmgr
- } else {
- LIBS += -lDownloadMgr
- }
+ LIBS += -ldownloadmgr
DEFINES += PHONON_MMF_PROGRESSIVE_DOWNLOAD
}
}
@@ -129,11 +125,7 @@ symbian {
LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream
# These are for effects.
- is_using_gnupoc {
- LIBS += -laudioequalizereffect -lbassboosteffect -ldistanceattenuationeffect -ldopplerbase -leffectbase -lenvironmentalreverbeffect -llistenerdopplereffect -llistenerlocationeffect -llistenerorientationeffect -llocationbase -lloudnesseffect -lorientationbase -lsourcedopplereffect -lsourcelocationeffect -lsourceorientationeffect -lstereowideningeffect
- } else {
- LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerbase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect
- }
+ LIBS += -laudioequalizereffect -lbassboosteffect -ldistanceattenuationeffect -ldopplerbase -leffectbase -lenvironmentalreverbeffect -llistenerdopplereffect -llistenerlocationeffect -llistenerorientationeffect -llocationbase -lloudnesseffect -lorientationbase -lsourcedopplereffect -lsourcelocationeffect -lsourceorientationeffect -lstereowideningeffect
# This is to allow IAP to be specified
LIBS += -lcommdb
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 335b94f..92bfb25 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -13113,6 +13113,7 @@ EXPORTS
?hasBCM2727@QSymbianGraphicsSystemEx@@SA_NXZ @ 13112 NONAME ; bool QSymbianGraphicsSystemEx::hasBCM2727(void)
?constImageRef@QVolatileImage@@QBEABVQImage@@XZ @ 13113 NONAME ; class QImage const & QVolatileImage::constImageRef(void) const
?toVolatileImage@QPixmapData@@UBE?AVQVolatileImage@@XZ @ 13114 NONAME ; class QVolatileImage QPixmapData::toVolatileImage(void) const
+<<<<<<< HEAD
?qt_s60_setPartialScreenAutomaticTranslation@@YAX_N@Z @ 13115 NONAME ; void qt_s60_setPartialScreenAutomaticTranslation(bool)
png_access_version_number @ 13116 NONAME
png_benign_error @ 13117 NONAME
@@ -13986,4 +13987,11 @@ EXPORTS
?resetFontEngineCache@QTextEngine@@QAEXXZ @ 13985 NONAME ; void QTextEngine::resetFontEngineCache(void)
?symbianHandleLiteModeStartup@QApplicationPrivate@@QAEXXZ @ 13986 NONAME ; void QApplicationPrivate::symbianHandleLiteModeStartup(void)
?_q_cleanupWinIds@QWidgetPrivate@@QAEXXZ @ 13987 NONAME ; void QWidgetPrivate::_q_cleanupWinIds(void)
+=======
+ ?qt_s60_setPartialScreenAutomaticTranslation@@YAX_N@Z @ 13115 NONAME ; void qt_s60_setPartialScreenAutomaticTranslation(bool)
+ ?aboutToUseGpuResources@QApplication@@IAEXXZ @ 13116 NONAME ; void QApplication::aboutToUseGpuResources(void)
+ ?aboutToReleaseGpuResources@QApplication@@IAEXXZ @ 13117 NONAME ; void QApplication::aboutToReleaseGpuResources(void)
+ ?emitAboutToUseGpuResources@QApplicationPrivate@@QAEXXZ @ 13118 NONAME ; void QApplicationPrivate::emitAboutToUseGpuResources(void)
+ ?emitAboutToReleaseGpuResources@QApplicationPrivate@@QAEXXZ @ 13119 NONAME ; void QApplicationPrivate::emitAboutToReleaseGpuResources(void)
+>>>>>>> origin/4.7
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 3606f9c..83e1851 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12198,6 +12198,7 @@ EXPORTS
_ZNK11QPixmapData15toVolatileImageEv @ 12197 NONAME
_ZNK14QVolatileImage13constImageRefEv @ 12198 NONAME
_Z43qt_s60_setPartialScreenAutomaticTranslationb @ 12199 NONAME
+<<<<<<< HEAD
_Z18qt_addBitmapToPathffPKhiiiP12QPainterPath @ 12200 NONAME
_Z22qt_fontdata_from_indexi @ 12201 NONAME
_Z27qt_isExtendedRadialGradientRK6QBrush @ 12202 NONAME
@@ -12799,4 +12800,10 @@ EXPORTS
_ZN11QTextEngine20resetFontEngineCacheEv @ 12798 NONAME
_ZN14QWidgetPrivate16_q_cleanupWinIdsEv @ 12799 NONAME
_ZN19QApplicationPrivate28symbianHandleLiteModeStartupEv @ 12800 NONAME
+=======
+ _ZN12QApplication22aboutToUseGpuResourcesEv @ 12200 NONAME
+ _ZN12QApplication26aboutToReleaseGpuResourcesEv @ 12201 NONAME
+ _ZN19QApplicationPrivate26emitAboutToUseGpuResourcesEv @ 12202 NONAME
+ _ZN19QApplicationPrivate30emitAboutToReleaseGpuResourcesEv @ 12203 NONAME
+>>>>>>> origin/4.7