diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-03-09 12:41:43 (GMT) |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-03-09 12:41:43 (GMT) |
commit | 796b084fbaaeeacbb6af7b3a2d132b5900c3db62 (patch) | |
tree | 1d34a97cefa0ee2806cf54d0feb6efb9a48f4288 /src | |
parent | 5440d903532a37fdd69ae60e6579f82909996620 (diff) | |
parent | dc6b5702e0c488bf51ca029290eb65604bfb1dd5 (diff) | |
download | Qt-796b084fbaaeeacbb6af7b3a2d132b5900c3db62.zip Qt-796b084fbaaeeacbb6af7b3a2d132b5900c3db62.tar.gz Qt-796b084fbaaeeacbb6af7b3a2d132b5900c3db62.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextedit.cpp | 1 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextinput.cpp | 1 | ||||
-rw-r--r-- | src/gui/image/qpixmap.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qtextcontrol.cpp | 2 | ||||
-rw-r--r-- | src/network/access/qnetworkcookie.cpp | 21 | ||||
-rw-r--r-- | src/network/bearer/qsharednetworksession.cpp | 2 | ||||
-rw-r--r-- | src/plugins/bearer/symbian/symbianengine.cpp | 12 | ||||
-rw-r--r-- | src/plugins/graphicssystems/meego/qmeegographicssystem.cpp | 5 | ||||
-rw-r--r-- | src/plugins/graphicssystems/meego/qmeegographicssystem.h | 1 | ||||
-rw-r--r-- | src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp | 21 | ||||
-rw-r--r-- | src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h | 7 |
11 files changed, 61 insertions, 14 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index c28d7f4..d3c5b82 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -1469,6 +1469,7 @@ void QDeclarativeTextEditPrivate::init() #ifndef QT_NO_CLIPBOARD QObject::connect(q, SIGNAL(readOnlyChanged(bool)), q, SLOT(q_canPasteChanged())); QObject::connect(QApplication::clipboard(), SIGNAL(dataChanged()), q, SLOT(q_canPasteChanged())); + canPaste = control->canPaste(); #endif document = control->document(); diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 8b21008..29b1f6b 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -1766,6 +1766,7 @@ void QDeclarativeTextInputPrivate::init() q, SLOT(q_canPasteChanged())); q->connect(QApplication::clipboard(), SIGNAL(dataChanged()), q, SLOT(q_canPasteChanged())); + canPaste = !control->isReadOnly() && QApplication::clipboard()->text().length() != 0; #endif // QT_NO_CLIPBOARD q->connect(control, SIGNAL(updateMicroFocus()), q, SLOT(updateMicroFocus())); diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 0aefafb..1a83318 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1997,7 +1997,7 @@ void QPixmap::detach() } if (data->is_cached && data->ref == 1) - QImagePixmapCleanupHooks::executePixmapDataModificationHooks(pd); + QImagePixmapCleanupHooks::executePixmapDataModificationHooks(data.data()); #if defined(Q_WS_MAC) QMacPixmapData *macData = id == QPixmapData::MacClass ? static_cast<QMacPixmapData*>(pd) : 0; diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index f4054d3..f5da079 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -284,7 +284,7 @@ bool QTextControlPrivate::cursorMoveKeyEvent(QKeyEvent *e) if (cursor.position() != oldCursorPos) emit q->cursorPositionChanged(); emit q->microFocusChanged(); - } else if (ignoreNavigationEvents && isNavigationEvent) { + } else if (ignoreNavigationEvents && isNavigationEvent && oldSelection.anchor() == cursor.anchor()) { return false; } diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp index 70ea5c2..c2a6925 100644 --- a/src/network/access/qnetworkcookie.cpp +++ b/src/network/access/qnetworkcookie.cpp @@ -359,7 +359,7 @@ void QNetworkCookie::setValue(const QByteArray &value) } // ### move this to qnetworkcookie_p.h and share with qnetworkaccesshttpbackend -static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &position) +static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &position, bool isNameValue) { // format is one of: // (1) token @@ -394,13 +394,22 @@ static QPair<QByteArray, QByteArray> nextField(const QByteArray &text, int &posi // quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) // qdtext = <any TEXT except <">> // quoted-pair = "\" CHAR + + // If its NAME=VALUE, retain the value as is + // refer to ttp://bugreports.qt.nokia.com/browse/QTBUG-17746 + if (isNameValue) + second += '"'; ++i; while (i < length) { register char c = text.at(i); if (c == '"') { // end of quoted text + if (isNameValue) + second += '"'; break; } else if (c == '\\') { + if (isNameValue) + second += '\\'; ++i; if (i >= length) // broken line @@ -476,10 +485,12 @@ QByteArray QNetworkCookie::toRawForm(RawForm form) const result = d->name; result += '='; - if (d->value.contains(';') || + if ((d->value.contains(';') || d->value.contains(',') || d->value.contains(' ') || - d->value.contains('"')) { + d->value.contains('"')) && + (!d->value.startsWith('"') && + !d->value.endsWith('"'))) { result += '"'; QByteArray value = d->value; @@ -947,7 +958,7 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt QNetworkCookie cookie; // The first part is always the "NAME=VALUE" part - QPair<QByteArray,QByteArray> field = nextField(cookieString, position); + QPair<QByteArray,QByteArray> field = nextField(cookieString, position, true); if (field.first.isEmpty() || field.second.isNull()) // parsing error break; @@ -965,7 +976,7 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt case ';': // new field in the cookie - field = nextField(cookieString, position); + field = nextField(cookieString, position, false); field.first = field.first.toLower(); // everything but the NAME=VALUE is case-insensitive if (field.first == "expires") { diff --git a/src/network/bearer/qsharednetworksession.cpp b/src/network/bearer/qsharednetworksession.cpp index 51b3a32..28ca173 100644 --- a/src/network/bearer/qsharednetworksession.cpp +++ b/src/network/bearer/qsharednetworksession.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp index fc480c2..f367c26 100644 --- a/src/plugins/bearer/symbian/symbianengine.cpp +++ b/src/plugins/bearer/symbian/symbianengine.cpp @@ -150,16 +150,15 @@ SymbianEngine::~SymbianEngine() iConnectionMonitor.CancelNotifications(); iConnectionMonitor.Close(); - -#ifdef SNAP_FUNCTIONALITY_AVAILABLE - iCmManager.Close(); -#endif - - // CCommsDatabase destructor uses cleanup stack. Since QNetworkConfigurationManager + + // CCommsDatabase destructor and RCmManager.Close() use cleanup stack. Since QNetworkConfigurationManager // is a global static, but the time we are here, E32Main() has been exited already and // the thread's default cleanup stack has been deleted. Without this line, a // 'E32USER-CBase 69' -panic will occur. CTrapCleanup* cleanup = CTrapCleanup::New(); +#ifdef SNAP_FUNCTIONALITY_AVAILABLE + iCmManager.Close(); +#endif delete ipCommsDB; delete cleanup; } @@ -829,6 +828,7 @@ void SymbianEngine::updateStatesToSnaps() discovered = true; } } + snapConfigLocker.unlock(); if (active) { changeConfigurationStateTo(ptr, QNetworkConfiguration::Active); } else if (discovered) { diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp index 6b8d2b3..13eab7f 100644 --- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp +++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp @@ -335,3 +335,8 @@ void qt_meego_destroy_fence_sync(void* fs) { return QMeeGoGraphicsSystem::destroyFenceSync(fs); } + +void qt_meego_invalidate_live_surfaces(void) +{ + return QMeeGoLivePixmapData::invalidateSurfaces(); +} diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.h b/src/plugins/graphicssystems/meego/qmeegographicssystem.h index 323ce1f..27a4e7a 100644 --- a/src/plugins/graphicssystems/meego/qmeegographicssystem.h +++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.h @@ -103,6 +103,7 @@ extern "C" { Q_DECL_EXPORT Qt::HANDLE qt_meego_live_texture_get_handle(QPixmap *pixmap); Q_DECL_EXPORT void* qt_meego_create_fence_sync(void); Q_DECL_EXPORT void qt_meego_destroy_fence_sync(void* fs); + Q_DECL_EXPORT void qt_meego_invalidate_live_surfaces(void); } #endif diff --git a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp index e4f1900..2a2a098 100644 --- a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp +++ b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp @@ -49,6 +49,8 @@ #include <private/qpixmap_x11_p.h> #include <stdio.h> +static QMeeGoLivePixmapDataList all_live_pixmaps; + static EGLint lock_attribs[] = { EGL_MAP_PRESERVE_PIXELS_KHR, EGL_TRUE, EGL_LOCK_USAGE_HINT_KHR, EGL_READ_SURFACE_BIT_KHR | EGL_WRITE_SURFACE_BIT_KHR, @@ -118,21 +120,29 @@ QMeeGoLivePixmapData::QMeeGoLivePixmapData(int w, int h, QImage::Format format) backingX11Pixmap = new QPixmap(pmd); initializeThroughEGLImage(); + + pos = all_live_pixmaps.insert(all_live_pixmaps.begin(), this); } QMeeGoLivePixmapData::QMeeGoLivePixmapData(Qt::HANDLE h) : QGLPixmapData(QPixmapData::PixmapType) { backingX11Pixmap = new QPixmap(QPixmap::fromX11Pixmap(h)); initializeThroughEGLImage(); + + pos = all_live_pixmaps.insert(all_live_pixmaps.begin(), this); } QMeeGoLivePixmapData::~QMeeGoLivePixmapData() { delete backingX11Pixmap; + all_live_pixmaps.erase(pos); } void QMeeGoLivePixmapData::initializeThroughEGLImage() { + if (texture()->id != 0) + return; + QGLShareContextScope ctx(qt_gl_share_widget()->context()); QMeeGoExtensions::ensureInitialized(); @@ -245,6 +255,8 @@ bool QMeeGoLivePixmapData::scroll(int dx, int dy, const QRect &rect) EGLSurface QMeeGoLivePixmapData::getSurfaceForBackingPixmap() { + initializeThroughEGLImage(); + // This code is a crative remix of the stuff that can be found in the // Qt's TFP implementation in /src/opengl/qgl_x11egl.cpp ::bindiTextureFromNativePixmap QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(backingX11Pixmap->data_ptr().data()); @@ -290,3 +302,12 @@ void QMeeGoLivePixmapData::destroySurfaceForPixmapData(QPixmapData* pmd) pixmapData->gl_surface = 0; } } + +void QMeeGoLivePixmapData::invalidateSurfaces() +{ + foreach (QMeeGoLivePixmapData *data, all_live_pixmaps) { + QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(data->backingX11Pixmap->data_ptr().data()); + *data->texture() = QGLTexture(); + pixmapData->gl_surface = 0; + } +} diff --git a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h index 484028e..616b33c 100644 --- a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h +++ b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.h @@ -42,9 +42,13 @@ #ifndef MLIVEPIXMAPDATA_H #define MLIVEPIXMAPDATA_H +#include <QLinkedList> #include <private/qpixmapdata_gl_p.h> #include "qmeegoextensions.h" +class QMeeGoLivePixmapData; +typedef QLinkedList<QMeeGoLivePixmapData *> QMeeGoLivePixmapDataList; + class QMeeGoLivePixmapData : public QGLPixmapData { public: @@ -66,6 +70,9 @@ public: QPixmap *backingX11Pixmap; QImage lockedImage; + QMeeGoLivePixmapDataList::Iterator pos; + + static void invalidateSurfaces(); }; #endif |