From 027a99e447b2d9c4d83fd0580851e803fe372c3a Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Fri, 28 Aug 2009 14:11:36 +0300 Subject: Updated docs to reflect current 'createpackage' and 'make sisx' syntax. Reviewed-by: Miikka Heikkinen --- doc/src/s60-introduction.qdoc | 48 ++++++++++++++++++---- doc/src/snippets/code/doc_src_installation.qdoc | 6 +-- .../snippets/code/doc_src_s60-introduction.qdoc | 16 +++++++- qmake/generators/symbian/symmake.cpp | 2 +- 4 files changed, 58 insertions(+), 14 deletions(-) diff --git a/doc/src/s60-introduction.qdoc b/doc/src/s60-introduction.qdoc index 24f7817..41a0268 100644 --- a/doc/src/s60-introduction.qdoc +++ b/doc/src/s60-introduction.qdoc @@ -90,6 +90,7 @@ \row \o \c debug-armv5 \o Build debug binaries for hardware using RVCT. \row \o \c release-armv5 \o Build release binaries for hardware using RVCT. \row \o \c run \o Run the emulator binaries from the build directory. + \row \o \c sisx \o Create signed \c .sis file for project. \endtable The following lines perform a debug build for the emulator @@ -102,16 +103,47 @@ \section1 Installing your own applications - To install your own applications on hardware, Qt comes with a tool called - \c createpackage. When used on the \c .pkg files created by qmake, it - will produce a signed \c .sis file that can be installed to the device. For - example: - + To install your own applications on hardware, you need signed \c .sis file. + The signed \c .sis file can be created with \c make \c sisx target. \c sisx target + is only supported for executables or projects with \c DEPLOYMENT statements. + By default the \c sisx target will create signed \.sis file for last build + target. For example, the following sequence will generate the needed makefiles, + build the project for \c debug-winscw and \c release-armv5, and create + self-signed \c .sis file for \c release-armv5 target: + \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 2 + If you want to use different certificate information or override the default + target for \c .sis file creation you can use the environment variables as + shown in the table below: + + \table + \row \o \c QT_SISX_OPTIONS \o Options accepted by \c .sis creation. + Currently only -i, install the package right away + using PC suite, is supported. + By default no otions are given. + \row \o \c QT_SISX_TARGET \o Target for which \c .sis file is created. + Accepted values are build targets listed in + previous table. By default last build target. + \row \o \c QT_SISX_CERTIFICATE \o The certificate file used for signing. + By default self-signed certificate. + \row \o \c QT_SISX_KEY \o The certificate's private key file. + By default key is associated to self-signed certificate. + \row \o \c QT_SISX_PASSPHRASE \o The certificate's private key file's passphrase. + By default empty. + \endtable + + The environment variables for \c make can be given as an parameters. For example: + + \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 3 + + The above example is identical to: + + \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 4 + If you want to install the program immediately, make sure that the device - is connected to the computer in "PC Suite" mode, and run \c createpackage - with the \c -i switch, like this: + is connected to the computer in "PC Suite" mode, and run \c sisx target + with the \c QT_SISX_OPTIONS=-i, like this: - \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 3 + \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 5 */ diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc index 489016d..ef46bf6 100644 --- a/doc/src/snippets/code/doc_src_installation.qdoc +++ b/doc/src/snippets/code/doc_src_installation.qdoc @@ -129,7 +129,7 @@ nmake //! [23] cd \Qt\%VERSION% -configure -platform win32-mwc -xplatform symbian-abld +configure -platform win32-g++ -xplatform symbian-abld //! [23] @@ -156,10 +156,10 @@ make release-armv5 //! [29] cd src\s60installs -createpackage -i qt_libs_armv5_urel.pkg +make sisx QT_SISX_OPTIONS=-i QT_SISX_CERTIFICATE= QT_SISX_KEY= //! [29] //! [30] cd embedded\fluidlauncher -createpackage -i fluidlauncher_armv5_urel.pkg +make sisx QT_SISX_OPTIONS=-i //! [30] diff --git a/doc/src/snippets/code/doc_src_s60-introduction.qdoc b/doc/src/snippets/code/doc_src_s60-introduction.qdoc index ff1d159..fa9fd45 100644 --- a/doc/src/snippets/code/doc_src_s60-introduction.qdoc +++ b/doc/src/snippets/code/doc_src_s60-introduction.qdoc @@ -8,9 +8,21 @@ //! [1] //! [2] - createpackage wiggly_gcce_udeb.pkg + qmake + make debug-winscw release-armv5 + make sisx //! [2] //! [3] - createpackage -i wiggly_gcce_udeb.pkg + make sisx QT_SISX_TARGET=debug-armv5 //! [3] + +//! [4] + set QT_SISX_TARGET=debug-armv5 + make sisx +//! [4] + +//! [5] + set QT_SISX_OPTIONS=-i + make sisx +//! [5] \ No newline at end of file diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 48fc8ef..3aa3c7b 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -1649,7 +1649,7 @@ void SymbianMakefileGenerator::writeSisxTargets(QTextStream &t) t << OK_SISX_TARGET ":" << endl; - QString pkgcommand = QString("\tcreatepackage.bat %1_template.%2 $(QT_SISX_TARGET) " \ + QString pkgcommand = QString("\tcreatepackage.bat $(QT_SISX_OPTIONS) %1_template.%2 $(QT_SISX_TARGET) " \ "$(QT_SISX_CERTIFICATE) $(QT_SISX_KEY) $(QT_SISX_PASSPHRASE)") .arg(fixedTarget) .arg("pkg"); -- cgit v0.12 From 761793aec914f4af5b3145400091c58b74c37ebf Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 28 Aug 2009 19:07:49 +0200 Subject: Removing an obviously obsolete LIBS includion workaround. Reviewed-By: Trustme --- src/gui/styles/styles.pri | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri index 70ac6cb..7e725c0 100644 --- a/src/gui/styles/styles.pri +++ b/src/gui/styles/styles.pri @@ -168,8 +168,6 @@ contains( styles, s60 ):contains(QT_CONFIG, s60) { SOURCES += styles/qs60style.cpp symbian { SOURCES += styles/qs60style_s60.cpp - # TODO: fix the following LIBS hack. Line 1 is for armv5, 2 for winscw - LIBS += aknicon aknskins aknskinsrv fontutils LIBS += -laknicon -laknskins -laknskinsrv -lfontutils } else { SOURCES += styles/qs60style_simulated.cpp -- cgit v0.12 From 93232a4283cf2fc1e64fe63f70ac3fb0250c8b23 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Fri, 28 Aug 2009 18:23:05 +0200 Subject: QMetaObjectPrivate: refactor internal disconnect to avoid duplicate code Reviewed-by: ogoffart --- src/corelib/kernel/qmetaobject_p.h | 5 ++- src/corelib/kernel/qobject.cpp | 91 ++++++++++++++++++-------------------- 2 files changed, 47 insertions(+), 49 deletions(-) diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h index d843deb..fdf36f3 100644 --- a/src/corelib/kernel/qmetaobject_p.h +++ b/src/corelib/kernel/qmetaobject_p.h @@ -102,6 +102,7 @@ enum MetaObjectFlags { DynamicMetaObject = 0x01 }; +class QMutex; struct QMetaObjectPrivate { @@ -127,7 +128,9 @@ struct QMetaObjectPrivate int type = 0, int *types = 0); static bool disconnect(const QObject *sender, int signal_index, const QObject *receiver, int method_index); - + static inline bool disconnectHelper(QObjectPrivate::Connection *c, + const QObject *receiver, int method_index, + QMutex *senderMutex); }; #ifndef UTILS_H diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index e080bd6..6a451d5 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -3079,6 +3079,43 @@ bool QMetaObject::disconnect(const QObject *sender, int signal_index, } /*! \internal + Helper function to remove the connection from the senders list and setting the receivers to 0 + */ +bool QMetaObjectPrivate::disconnectHelper(QObjectPrivate::Connection *c, + const QObject *receiver, int method_index, + QMutex *senderMutex) +{ + bool success = false; + while (c) { + if (c->receiver + && (receiver == 0 || (c->receiver == receiver + && (method_index < 0 || c->method == method_index)))) { + bool needToUnlock = false; + QMutex *receiverMutex = 0; + if (!receiver) { + receiverMutex = signalSlotLock(c->receiver); + // need to relock this receiver and sender in the correct order + needToUnlock = QOrderedMutexLocker::relock(senderMutex, receiverMutex); + } + if (c->receiver) { + *c->prev = c->next; + if (c->next) + c->next->prev = c->prev; + } + + if (needToUnlock) + receiverMutex->unlock(); + + c->receiver = 0; + + success = true; + } + c = c->nextConnectionList; + } + return success; +} + +/*! \internal Same as the QMetaObject::disconnect, but \a signal_index must be the result of QObjectPrivate::signalIndex */ bool QMetaObjectPrivate::disconnect(const QObject *sender, int signal_index, @@ -3088,7 +3125,6 @@ bool QMetaObjectPrivate::disconnect(const QObject *sender, int signal_index, return false; QObject *s = const_cast(sender); - QObject *r = const_cast(receiver); QMutex *senderMutex = signalSlotLock(sender); QMutex *receiverMutex = receiver ? signalSlotLock(receiver) : 0; @@ -3107,58 +3143,17 @@ bool QMetaObjectPrivate::disconnect(const QObject *sender, int signal_index, for (signal_index = -1; signal_index < connectionLists->count(); ++signal_index) { QObjectPrivate::Connection *c = (*connectionLists)[signal_index].first; - while (c) { - if (c->receiver - && (r == 0 || (c->receiver == r - && (method_index < 0 || c->method == method_index)))) { - QMutex *m = signalSlotLock(c->receiver); - bool needToUnlock = false; - if (!receiverMutex && senderMutex != m) { - // need to relock this receiver and sender in the correct order - needToUnlock = QOrderedMutexLocker::relock(senderMutex, m); - } - if (c->receiver) { - *c->prev = c->next; - if (c->next) c->next->prev = c->prev; - } - - if (needToUnlock) - m->unlock(); - - c->receiver = 0; - - success = true; - connectionLists->dirty = true; - } - c = c->nextConnectionList; + if (disconnectHelper(c, receiver, method_index, senderMutex)) { + success = true; + connectionLists->dirty = true; } } } else if (signal_index < connectionLists->count()) { QObjectPrivate::Connection *c = (*connectionLists)[signal_index].first; - while (c) { - if (c->receiver - && (r == 0 || (c->receiver == r - && (method_index < 0 || c->method == method_index)))) { - QMutex *m = signalSlotLock(c->receiver); - bool needToUnlock = false; - if (!receiverMutex && senderMutex != m) { - // need to relock this receiver and sender in the correct order - needToUnlock = QOrderedMutexLocker::relock(senderMutex, m); - } - if (c->receiver) { - *c->prev = c->next; - if (c->next) c->next->prev = c->prev; - } - - if (needToUnlock) - m->unlock(); - c->receiver = 0; - - success = true; - connectionLists->dirty = true; - } - c = c->nextConnectionList; + if (disconnectHelper(c, receiver, method_index, senderMutex)) { + success = true; + connectionLists->dirty = true; } } -- cgit v0.12 From 850a179f0f879a37302780148dd1900fc5a69d3b Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 28 Aug 2009 19:49:40 +0200 Subject: Added a default theme for the simulated S60 style Reviewed-By: Trustme --- src/gui/styles/images/defaults60theme.blob | Bin 0 -> 74127 bytes src/gui/styles/qs60style_simulated.cpp | 3 +-- src/gui/styles/qstyle_s60_simulated.qrc | 2 +- src/gui/styles/styles.pri | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 src/gui/styles/images/defaults60theme.blob diff --git a/src/gui/styles/images/defaults60theme.blob b/src/gui/styles/images/defaults60theme.blob new file mode 100644 index 0000000..f3a5952 Binary files /dev/null and b/src/gui/styles/images/defaults60theme.blob differ diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 350ef51..2d185bd 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -366,8 +366,7 @@ QFont QS60StylePrivate::s60Font_specific(QS60StyleEnums::FontCategories fontCate QS60Style::QS60Style() : QCommonStyle(*new QS60StylePrivate) { - // Assume, that the resource system has a ':/s60Stylethemes/Default.blob' - const QString defaultBlob = QString::fromLatin1(":/s60Stylethemes/Default.blob"); + const QString defaultBlob = QString::fromLatin1(":/trolltech/styles/s60style/images/defaults60theme.blob"); if (QFile::exists(defaultBlob)) loadS60ThemeFromBlob(defaultBlob); } diff --git a/src/gui/styles/qstyle_s60_simulated.qrc b/src/gui/styles/qstyle_s60_simulated.qrc index 72aab9e..969732e 100644 --- a/src/gui/styles/qstyle_s60_simulated.qrc +++ b/src/gui/styles/qstyle_s60_simulated.qrc @@ -1,6 +1,6 @@ - images/s60themes.dat + images/defaults60theme.blob diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri index 7e725c0..767ade0 100644 --- a/src/gui/styles/styles.pri +++ b/src/gui/styles/styles.pri @@ -171,6 +171,7 @@ contains( styles, s60 ):contains(QT_CONFIG, s60) { LIBS += -laknicon -laknskins -laknskinsrv -lfontutils } else { SOURCES += styles/qs60style_simulated.cpp + RESOURCES += styles/qstyle_s60_simulated.qrc } } else { DEFINES += QT_NO_STYLE_S60 -- cgit v0.12 From bdb8379d84218c55d573ecef8c3fa13fa57f0bc7 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 28 Aug 2009 19:51:22 +0200 Subject: Warning -- --- src/gui/styles/qs60style.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 12d4948..3230c17 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2732,6 +2732,8 @@ bool QS60Style::event(QEvent *e) default: break; } +#else + Q_UNUSED(e) #endif return false; } -- cgit v0.12 From d23863952b0c13ccd8b2989d24153d94b3d3f83d Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Fri, 28 Aug 2009 23:16:29 +0200 Subject: trivial: make moc compile again --- src/corelib/kernel/qmetaobject_p.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h index fdf36f3..572e727 100644 --- a/src/corelib/kernel/qmetaobject_p.h +++ b/src/corelib/kernel/qmetaobject_p.h @@ -122,6 +122,7 @@ struct QMetaObjectPrivate static int indexOfSignalRelative(const QMetaObject **baseObject, const char* name); static int originalClone(const QMetaObject *obj, int local_method_index); +#ifndef QT_NO_QOBJECT //defined in qobject.cpp static bool connect(const QObject *sender, int signal_index, const QObject *receiver, int method_index, @@ -131,6 +132,7 @@ struct QMetaObjectPrivate static inline bool disconnectHelper(QObjectPrivate::Connection *c, const QObject *receiver, int method_index, QMutex *senderMutex); +#endif }; #ifndef UTILS_H -- cgit v0.12 From be1140bf0040963b50a5b80be123245c98833b96 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 31 Aug 2009 09:56:12 +1000 Subject: Destroy EGL window surface when direct VG surface is deleted OpenVG window surfaces were leaking because the QVGEGLWindowSurfaceDirect destructor was previously not cleaning up the EGLSurface object. Reviewed-by: trustme --- src/openvg/qwindowsurface_vgegl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp index ae91bb2..ba711b7 100644 --- a/src/openvg/qwindowsurface_vgegl.cpp +++ b/src/openvg/qwindowsurface_vgegl.cpp @@ -618,6 +618,12 @@ QVGEGLWindowSurfaceDirect::QVGEGLWindowSurfaceDirect(QWindowSurface *win) QVGEGLWindowSurfaceDirect::~QVGEGLWindowSurfaceDirect() { + destroyPaintEngine(); + if (context) { + if (windowSurface != EGL_NO_SURFACE) + qt_vg_destroy_surface(context, windowSurface); + qt_vg_destroy_context(context); + } } QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget) -- cgit v0.12 From 4aec7f5a065ed84f93f01088d5b394950c23646d Mon Sep 17 00:00:00 2001 From: Bill King Date: Mon, 31 Aug 2009 09:56:57 +1000 Subject: Fixes race condition on reopening an ODBC connection. Original code was keeping it's own (out of date) copy of the handles. It now includes a pointer to the driver private, and asks that what the handles are instead. --- src/sql/drivers/odbc/qsql_odbc.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 06ee3e1..43658f7 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -126,8 +126,8 @@ private: class QODBCPrivate { public: - QODBCPrivate() - : hEnv(0), hDbc(0), hStmt(0), useSchema(false), hasSQLFetchScroll(true) + QODBCPrivate(QODBCDriverPrivate *dpp) + : hStmt(0), useSchema(false), hasSQLFetchScroll(true), driverPrivate(dpp) { unicode = false; } @@ -135,8 +135,8 @@ public: inline void clearValues() { fieldCache.fill(QVariant()); fieldCacheIdx = 0; } - SQLHANDLE hEnv; - SQLHANDLE hDbc; + SQLHANDLE dpEnv() const { return driverPrivate ? driverPrivate->hEnv : 0;} + SQLHANDLE dpDbc() const { return driverPrivate ? driverPrivate->hDbc : 0;} SQLHANDLE hStmt; uint unicode :1; @@ -147,6 +147,7 @@ public: int fieldCacheIdx; int disconnectCount; bool hasSQLFetchScroll; + QODBCDriverPrivate *driverPrivate; bool isStmtHandleValid(const QSqlDriver *driver); void updateStmtHandleState(const QSqlDriver *driver); @@ -208,8 +209,8 @@ static QString qWarnODBCHandle(int handleType, SQLHANDLE handle, int *nativeCode static QString qODBCWarn(const QODBCPrivate* odbc, int *nativeCode = 0) { - return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->hEnv) + QLatin1Char(' ') - + qWarnODBCHandle(SQL_HANDLE_DBC, odbc->hDbc) + QLatin1Char(' ') + return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->dpEnv()) + QLatin1Char(' ') + + qWarnODBCHandle(SQL_HANDLE_DBC, odbc->dpDbc()) + QLatin1Char(' ') + qWarnODBCHandle(SQL_HANDLE_STMT, odbc->hStmt, nativeCode)); } @@ -247,6 +248,7 @@ static QSqlError qMakeError(const QString& err, QSqlError::ErrorType type, template static QVariant::Type qDecodeODBCType(SQLSMALLINT sqltype, const T* p, bool isSigned = true) { + Q_UNUSED(p); QVariant::Type type = QVariant::Invalid; switch (sqltype) { case SQL_DECIMAL: @@ -799,9 +801,7 @@ QString QODBCDriverPrivate::adjustCase(const QString &identifier) const QODBCResult::QODBCResult(const QODBCDriver * db, QODBCDriverPrivate* p) : QSqlResult(db) { - d = new QODBCPrivate(); - d->hEnv = p->hEnv; - d->hDbc = p->hDbc; + d = new QODBCPrivate(p); d->unicode = p->unicode; d->useSchema = p->useSchema; d->disconnectCount = p->disconnectCount; @@ -839,7 +839,7 @@ bool QODBCResult::reset (const QString& query) } } r = SQLAllocHandle(SQL_HANDLE_STMT, - d->hDbc, + d->dpDbc(), &d->hStmt); if (r != SQL_SUCCESS) { qSqlWarning(QLatin1String("QODBCResult::reset: Unable to allocate statement handle"), d); @@ -1180,7 +1180,7 @@ bool QODBCResult::prepare(const QString& query) } } r = SQLAllocHandle(SQL_HANDLE_STMT, - d->hDbc, + d->dpDbc(), &d->hStmt); if (r != SQL_SUCCESS) { qSqlWarning(QLatin1String("QODBCResult::prepare: Unable to allocate statement handle"), d); -- cgit v0.12 From 528106b2ffa39b8f0a2bc4d1b4e23419eaf454ca Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 31 Aug 2009 10:44:26 +1000 Subject: Remove QGLShader from its QGLShaderProgram when it is destroyed Reviewed-by: Samuel --- src/opengl/qglshaderprogram.cpp | 24 ++++++++++++++++++++---- src/opengl/qglshaderprogram.h | 3 +++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index b07fb3b..6e3ea88 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -701,6 +701,7 @@ public: , linked(false) , inited(false) , hasPartialShaders(false) + , removingShaders(false) , vertexShader(0) , fragmentShader(0) { @@ -716,6 +717,7 @@ public: bool linked; bool inited; bool hasPartialShaders; + bool removingShaders; QString log; QList shaders; QList anonShaders; @@ -813,6 +815,7 @@ bool QGLShaderProgram::addShader(QGLShader *shader) } d->linked = false; // Program needs to be relinked. d->shaders.append(shader); + connect(shader, SIGNAL(destroyed()), this, SLOT(shaderDestroyed())); return true; } else { return false; @@ -917,12 +920,14 @@ bool QGLShaderProgram::addShaderFromFile */ void QGLShaderProgram::removeShader(QGLShader *shader) { - if (d->program && shader && shader->d->shader) { + if (d->program && shader && shader->d->shader) glDetachShader(d->program, shader->d->shader); - d->linked = false; // Program needs to be relinked. + d->linked = false; // Program needs to be relinked. + if (shader) { + d->shaders.removeAll(shader); + d->anonShaders.removeAll(shader); + disconnect(shader, SIGNAL(destroyed()), this, SLOT(shaderDestroyed())); } - d->shaders.removeAll(shader); - d->anonShaders.removeAll(shader); } /*! @@ -946,6 +951,7 @@ QList QGLShaderProgram::shaders() const */ void QGLShaderProgram::removeAllShaders() { + d->removingShaders = true; foreach (QGLShader *shader, d->shaders) { if (d->program && shader && shader->d->shader) glDetachShader(d->program, shader->d->shader); @@ -957,6 +963,7 @@ void QGLShaderProgram::removeAllShaders() d->shaders.clear(); d->anonShaders.clear(); d->linked = false; // Program needs to be relinked. + d->removingShaders = false; } #if defined(QT_OPENGL_ES_2) @@ -2977,6 +2984,15 @@ bool QGLShaderProgram::hasShaderPrograms(const QGLContext *context) #endif } +/*! + \internal +*/ +void QGLShaderProgram::shaderDestroyed() +{ + QGLShader *shader = qobject_cast(sender()); + if (shader && !d->removingShaders) + removeShader(shader); +} #endif diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index d747679..8d6efab 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -282,6 +282,9 @@ public: static bool hasShaderPrograms(const QGLContext *context = 0); +private Q_SLOTS: + void shaderDestroyed(); + private: QGLShaderProgramPrivate *d; -- cgit v0.12 From 46403d21e1cfd5b4b89244067a4111d5c2c0ff1a Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 31 Aug 2009 10:52:12 +1000 Subject: Move QGLShareContextScope to qgl_p.h so other things can use it. Reviewed-by: trustme --- src/opengl/qgl_p.h | 40 ++++++++++++++++++++++++++++++++++++++++ src/opengl/qpixmapdata_gl.cpp | 37 ------------------------------------- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 6905199..5496819 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -533,6 +533,46 @@ private: FreeFunc free; }; +// Temporarily make a context current if not already current or +// shared with the current contex. The previous context is made +// current when the object goes out of scope. +class Q_OPENGL_EXPORT QGLShareContextScope +{ +public: + QGLShareContextScope(const QGLContext *ctx) + : m_oldContext(0) + { + QGLContext *currentContext = const_cast(QGLContext::currentContext()); + if (currentContext != ctx && !qgl_share_reg()->checkSharing(ctx, currentContext)) { + m_oldContext = currentContext; + m_ctx = const_cast(ctx); + m_ctx->makeCurrent(); + } else { + m_ctx = currentContext; + } + } + + operator QGLContext *() + { + return m_ctx; + } + + QGLContext *operator->() + { + return m_ctx; + } + + ~QGLShareContextScope() + { + if (m_oldContext) + m_oldContext->makeCurrent(); + } + +private: + QGLContext *m_oldContext; + QGLContext *m_ctx; +}; + QT_END_NAMESPACE #endif // QGL_P_H diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index c193f12..e18f98b 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -132,43 +132,6 @@ void QGLFramebufferObjectPool::release(QGLFramebufferObject *fbo) m_fbos << fbo; } -class QGLShareContextScope -{ -public: - QGLShareContextScope(const QGLContext *ctx) - : m_oldContext(0) - { - QGLContext *currentContext = const_cast(QGLContext::currentContext()); - if (currentContext != ctx && !qgl_share_reg()->checkSharing(ctx, currentContext)) { - m_oldContext = currentContext; - m_ctx = const_cast(ctx); - m_ctx->makeCurrent(); - } else { - m_ctx = currentContext; - } - } - - operator QGLContext *() - { - return m_ctx; - } - - QGLContext *operator->() - { - return m_ctx; - } - - ~QGLShareContextScope() - { - if (m_oldContext) - m_oldContext->makeCurrent(); - } - -private: - QGLContext *m_oldContext; - QGLContext *m_ctx; -}; - static int qt_gl_pixmap_serial = 0; QGLPixmapData::QGLPixmapData(PixelType type) -- cgit v0.12 From 6f1ff3ec69cc6365d61fccf80e97f9afa317395d Mon Sep 17 00:00:00 2001 From: Peter Yard Date: Mon, 31 Aug 2009 12:40:23 +1000 Subject: Added doc link to point to Assistant doc table of collection file values. Fix for task 259252. --- tools/assistant/lib/qhelpenginecore.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/assistant/lib/qhelpenginecore.cpp b/tools/assistant/lib/qhelpenginecore.cpp index 3f8bc02..e642295 100644 --- a/tools/assistant/lib/qhelpenginecore.cpp +++ b/tools/assistant/lib/qhelpenginecore.cpp @@ -175,6 +175,14 @@ void QHelpEngineCorePrivate::errorReceived(const QString &msg) This class does not offer any GUI components or functionality for indices or contents. If you need one of those use QHelpEngine instead. + + When creating a custom help viewer the viewer can be +configured by writing a custom collection file which could contain various +keywords to be used to configure the help engine. These keywords and values +and their meaning can be found in the help information for +\l{assistant-custom-help-viewer.html#creating-a-custom-help-collection-file +}{creating a custom help collection file} for +Assistant. */ /*! -- cgit v0.12 From 3b74c6350ab789c31a938df0807c8c9399bc4fcb Mon Sep 17 00:00:00 2001 From: Keith Isdale Date: Mon, 31 Aug 2009 13:58:40 +1000 Subject: Correct grammatical in documentation for QNetworkDiskCache::expire() The text: When the current size of the cache is greater then the maximumCacheSize() should read When the current size of the cache is greater than the maximumCacheSize() Task-number: 260496 Reviewed-by: Zheng Liu (George) --- src/network/access/qnetworkdiskcache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp index 167f5d5..21d52c8 100644 --- a/src/network/access/qnetworkdiskcache.cpp +++ b/src/network/access/qnetworkdiskcache.cpp @@ -466,7 +466,7 @@ void QNetworkDiskCache::setMaximumCacheSize(qint64 size) Cleans the cache so that its size is under the maximum cache size. Returns the current size of the cache. - When the current size of the cache is greater then the maximumCacheSize() + When the current size of the cache is greater than the maximumCacheSize() older cache files are removed until the total size is less then 90% of maximumCacheSize() starting with the oldest ones first using the file creation date to determine how old a cache file is. -- cgit v0.12 From 8d636ab46ccfc3ab37083f947a7c184df47ddcb9 Mon Sep 17 00:00:00 2001 From: Bill King Date: Mon, 31 Aug 2009 15:07:12 +1000 Subject: Adds ability to open sqlite databases readonly. Changes opening of sqlite to open_v2, and adds a new connection option. Reviewed-by: Justin McPherson --- src/sql/drivers/sqlite/qsql_sqlite.cpp | 24 ++++++++++++++++++------ src/sql/kernel/qsqldatabase.cpp | 1 + 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp index 81afbf9..1b5c9c5 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.cpp +++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp @@ -502,15 +502,27 @@ static int qGetSqliteTimeout(QString opts) enum { DefaultTimeout = 5000 }; opts.remove(QLatin1Char(' ')); - if (opts.startsWith(QLatin1String("QSQLITE_BUSY_TIMEOUT="))) { - bool ok; - int nt = opts.mid(21).toInt(&ok); - if (ok) - return nt; + foreach(QString option, opts.split(QLatin1Char(';'))) { + if (option.startsWith(QLatin1String("QSQLITE_BUSY_TIMEOUT="))) { + bool ok; + int nt = option.mid(21).toInt(&ok); + if (ok) + return nt; + } } return DefaultTimeout; } +static int qGetSqliteOpenMode(QString opts) +{ + opts.remove(QLatin1Char(' ')); + foreach(QString option, opts.split(QLatin1Char(';'))) { + if (option == QLatin1String("QSQLITE_OPEN_READONLY"))) + return SQLITE_OPEN_READONLY; + } + return SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE; +} + /* SQLite dbs have no user name, passwords, hosts or ports. just file names. @@ -523,7 +535,7 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c if (db.isEmpty()) return false; - if (sqlite3_open16(db.constData(), &d->access) == SQLITE_OK) { + if (sqlite3_open_v2(db.toUtf8().constData(), &d->access, qGetSqliteOpenMode(conOpts), NULL) == SQLITE_OK) { sqlite3_busy_timeout(d->access, qGetSqliteTimeout(conOpts)); setOpen(true); setOpenError(false); diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp index d155c03..16bd05b 100644 --- a/src/sql/kernel/qsqldatabase.cpp +++ b/src/sql/kernel/qsqldatabase.cpp @@ -1263,6 +1263,7 @@ QSqlRecord QSqlDatabase::record(const QString& tablename) const \i \list \i QSQLITE_BUSY_TIMEOUT + \i QSQLITE_OPEN_READONLY \endlist \i -- cgit v0.12 From 72f277c3340ad4c6182bd203d21832b9fdace78f Mon Sep 17 00:00:00 2001 From: Bill King Date: Mon, 31 Aug 2009 15:24:05 +1000 Subject: Fixes compile for my last change. --- src/sql/drivers/sqlite/qsql_sqlite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp index 1b5c9c5..db7950d 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.cpp +++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp @@ -517,7 +517,7 @@ static int qGetSqliteOpenMode(QString opts) { opts.remove(QLatin1Char(' ')); foreach(QString option, opts.split(QLatin1Char(';'))) { - if (option == QLatin1String("QSQLITE_OPEN_READONLY"))) + if (option == QLatin1String("QSQLITE_OPEN_READONLY")) return SQLITE_OPEN_READONLY; } return SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE; -- cgit v0.12 From 10c3a3bf11d6bbd8f8e99028ecab41acb89b7273 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Mon, 31 Aug 2009 15:26:12 +1000 Subject: Fix license headers. Reviewed-by: Trust Me --- doc/src/snippets/qxmlquery/bindingExample.cpp | 41 +++++++++++++++ doc/src/snippets/signalmapper/filereader.cpp | 41 +++++++++++++++ doc/src/snippets/signalmapper/main.cpp | 41 +++++++++++++++ src/xmlpatterns/parser/qquerytransformparser.cpp | 61 ---------------------- .../xmlpatternsxqts/lib/tests/XMLWriterTest.cpp | 41 --------------- 5 files changed, 123 insertions(+), 102 deletions(-) diff --git a/doc/src/snippets/qxmlquery/bindingExample.cpp b/doc/src/snippets/qxmlquery/bindingExample.cpp index 8ed9974..15905cd 100644 --- a/doc/src/snippets/qxmlquery/bindingExample.cpp +++ b/doc/src/snippets/qxmlquery/bindingExample.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + //! [0] QBuffer device; device.setData(myQString.toUtf8()); diff --git a/doc/src/snippets/signalmapper/filereader.cpp b/doc/src/snippets/signalmapper/filereader.cpp index 8732dab..c25a8a7 100644 --- a/doc/src/snippets/signalmapper/filereader.cpp +++ b/doc/src/snippets/signalmapper/filereader.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include #include "filereader.h" diff --git a/doc/src/snippets/signalmapper/main.cpp b/doc/src/snippets/signalmapper/main.cpp index ebc601b..744b0b3 100644 --- a/doc/src/snippets/signalmapper/main.cpp +++ b/doc/src/snippets/signalmapper/main.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include #include "filereader.h" diff --git a/src/xmlpatterns/parser/qquerytransformparser.cpp b/src/xmlpatterns/parser/qquerytransformparser.cpp index 4a960c3..d2cfbf3 100644 --- a/src/xmlpatterns/parser/qquerytransformparser.cpp +++ b/src/xmlpatterns/parser/qquerytransformparser.cpp @@ -39,16 +39,6 @@ ** ****************************************************************************/ -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. - /* A Bison parser, made by GNU Bison 2.3a. */ /* Skeleton implementation for Bison's Yacc-like parsers in C @@ -123,57 +113,6 @@ /* Line 164 of yacc.c. */ #line 22 "querytransformparser.ypp" -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtXmlPatterns module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. - #include #include diff --git a/tests/auto/xmlpatternsxqts/lib/tests/XMLWriterTest.cpp b/tests/auto/xmlpatternsxqts/lib/tests/XMLWriterTest.cpp index 1f603ff..15b7e0b 100644 --- a/tests/auto/xmlpatternsxqts/lib/tests/XMLWriterTest.cpp +++ b/tests/auto/xmlpatternsxqts/lib/tests/XMLWriterTest.cpp @@ -38,47 +38,6 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Patternist project on Trolltech Labs. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** $QT_END_LICENSE$ -** -*************************************************************************** - */ #include -- cgit v0.12 From a78c47247ecf67ea8a406bb394d2837e4c18cdc8 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 31 Aug 2009 09:07:17 +0300 Subject: Added QContextMenuEvent sending to widget in Symbian. The event construction without sending does nothing, sending constructed event possibly dissappeared due to bad merge or something. So here it comes again... Task-number: 260222 Reviewed-by: TrustMe --- src/gui/kernel/qapplication_s60.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 648a5d5..87cf82e 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -351,7 +351,8 @@ void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, cons bool res = sendMouseEvent(alienWidget, &mEvent); #if !defined(QT_NO_CONTEXTMENU) - QContextMenuEvent e2(QContextMenuEvent::Mouse, widgetPos, globalPos, mEvent.modifiers()); + QContextMenuEvent contextMenuEvent(QContextMenuEvent::Mouse, widgetPos, globalPos, mEvent.modifiers()); + qt_sendSpontaneousEvent(alienWidget, &contextMenuEvent); #endif m_previousEventLongTap = true; -- cgit v0.12 From 3f44ecdaa7366a69545f331a20988f7753158123 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 31 Aug 2009 10:38:16 +0300 Subject: Removed hard-coded sqlite3 deployment statement - used PKG conditions. Before this change Qt did not install to device which had sqlite3 already in ROM. Since we now install the sqlite3 only if it is not on any drive, the installation works also with preinstalled sqlite. Even better appraoch would be to use embedded SIS file for sqlite, since that would allow sqlite3 upgrade without upgrading the whole Qt. However we yet don't have such SIS, but once we get one from Symbian this needs to be further changed. Task-number: 258858 Reviewed-by: Miikka Heikkinen --- src/s60installs/s60installs.pro | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index 0314958..d691dd5 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -25,17 +25,13 @@ symbian: { qts60plugin_5_0.dll - # TODO: This should be conditional in PKG file, see commented code below - # However we don't yet have such mechanism in place - contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { - contains(CONFIG, system-sqlite): qtlibraries.sources += sqlite3.dll - } - - #; EXISTS statement does not resolve !. Lets check the most common drives - #IF NOT EXISTS("c:\sys\bin\sqlite3.dll") AND NOT EXISTS("e:\sys\bin\sqlite3.dll") AND NOT EXISTS("z:\sys\bin\sqlite3.dll") - #"\Epoc32\release\armv5\UREL\sqlite3.dll"-"!:\sys\bin\sqlite3.dll" - #ENDIF - + sqlitedeployment = \ + "; EXISTS statement does not resolve!. Lets check the most common drives" \ + "IF NOT EXISTS(\"c:\\sys\\bin\\sqlite3.dll\") AND NOT EXISTS(\"e:\\sys\\bin\\sqlite3.dll\") AND NOT EXISTS(\"z:\\sys\\bin\\sqlite3.dll\")" \ + "\"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/sqlite3.dll\"-\"!:\\sys\\bin\\sqlite3.dll\"" \ + "ENDIF" + qtlibraries.pkg_postrules = sqlitedeployment + qtlibraries.path = /sys/bin vendorinfo = \ -- cgit v0.12 From 01ee1740290ad192f98bb1d3d24e419e08be5806 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 31 Aug 2009 10:45:05 +0300 Subject: Trivial change to comment. Reviewed-by: TrustMe --- src/s60installs/s60installs.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index d691dd5..390cc11 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -6,6 +6,7 @@ symbian: { SUBDIRS= # WARNING: Changing TARGET name will break Symbian SISX upgrade functionality + # DO NOT TOUCH TARGET VARIABLE IF YOU ARE NOT SURE WHAT YOU ARE DOING TARGET = "Qt for S60" TARGET.UID3 = 0x2001E61C VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} -- cgit v0.12 From 10e3f11057218dac621087980bc37db464838941 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 31 Aug 2009 10:46:01 +0300 Subject: Fixed createpackage to use lowercase target to be Linux compliant. All S60 SDK paths in Linux are lowercase. Reviewed-by: TrustMe --- bin/createpackage.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/createpackage.pl b/bin/createpackage.pl index af46e04..a180864 100644 --- a/bin/createpackage.pl +++ b/bin/createpackage.pl @@ -52,7 +52,7 @@ unless (GetOptions('i|install' => \$install, 'p|preprocess' => \$preprocessonly) # Read params to variables my $templatepkg = $ARGV[0]; -my $targetplatform = uc $ARGV[1]; +my $targetplatform = lc $ARGV[1]; my @tmpvalues = split('-', $targetplatform); my $target = $tmpvalues[0]; -- cgit v0.12 From 9f7fd4923e04b3a5022e1f9b60ec1823918aefac Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Sat, 29 Aug 2009 18:04:18 +0200 Subject: Benchmark test for QSvgRenderer. Right now mostly testing the constructor and the parser. The only SVG to be tested so far is tiger.svg, i.e. the famous Tiger head converted from tiger.eps found in GPL-ed Ghostscript. Reviewed-by: Kim --- tests/benchmarks/qsvgrenderer/data/tiger.svg | 730 +++++++++++++++++++++ tests/benchmarks/qsvgrenderer/qsvgrenderer.pro | 9 + tests/benchmarks/qsvgrenderer/qsvgrenderer.qrc | 6 + tests/benchmarks/qsvgrenderer/tst_qsvgrenderer.cpp | 103 +++ 4 files changed, 848 insertions(+) create mode 100644 tests/benchmarks/qsvgrenderer/data/tiger.svg create mode 100644 tests/benchmarks/qsvgrenderer/qsvgrenderer.pro create mode 100644 tests/benchmarks/qsvgrenderer/qsvgrenderer.qrc create mode 100644 tests/benchmarks/qsvgrenderer/tst_qsvgrenderer.cpp diff --git a/tests/benchmarks/qsvgrenderer/data/tiger.svg b/tests/benchmarks/qsvgrenderer/data/tiger.svg new file mode 100644 index 0000000..983e570 --- /dev/null +++ b/tests/benchmarks/qsvgrenderer/data/tiger.svg @@ -0,0 +1,730 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/benchmarks/qsvgrenderer/qsvgrenderer.pro b/tests/benchmarks/qsvgrenderer/qsvgrenderer.pro new file mode 100644 index 0000000..8222a09 --- /dev/null +++ b/tests/benchmarks/qsvgrenderer/qsvgrenderer.pro @@ -0,0 +1,9 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_qsvgrenderer + +SOURCES += tst_qsvgrenderer.cpp +RESOURCES += qsvgrenderer.qrc + +QT += svg + diff --git a/tests/benchmarks/qsvgrenderer/qsvgrenderer.qrc b/tests/benchmarks/qsvgrenderer/qsvgrenderer.qrc new file mode 100644 index 0000000..bdf4a31 --- /dev/null +++ b/tests/benchmarks/qsvgrenderer/qsvgrenderer.qrc @@ -0,0 +1,6 @@ + + + data/tiger.svg + + + diff --git a/tests/benchmarks/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/benchmarks/qsvgrenderer/tst_qsvgrenderer.cpp new file mode 100644 index 0000000..2f01dfa --- /dev/null +++ b/tests/benchmarks/qsvgrenderer/tst_qsvgrenderer.cpp @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include +#include + +//TESTED_FILES= + +class tst_QSvgRenderer : public QObject +{ + Q_OBJECT + +public: + tst_QSvgRenderer(); + virtual ~tst_QSvgRenderer(); + +public slots: + void init(); + void cleanup(); + +private slots: + void construct(); + void load(); +}; + +tst_QSvgRenderer::tst_QSvgRenderer() +{ +} + +tst_QSvgRenderer::~tst_QSvgRenderer() +{ +} + +void tst_QSvgRenderer::init() +{ +} + +void tst_QSvgRenderer::cleanup() +{ +} + +void tst_QSvgRenderer::construct() +{ + QBENCHMARK { + QSvgRenderer renderer; + } +} + +void tst_QSvgRenderer::load() +{ + QFile file(":/data/tiger.svg"); + if (!file.open(QFile::ReadOnly)) + QFAIL("Can not open tiger.svg"); + QByteArray data = file.readAll(); + QSvgRenderer renderer; + + QBENCHMARK { + renderer.load(data); + } +} + +QTEST_MAIN(tst_QSvgRenderer) +#include "tst_qsvgrenderer.moc" -- cgit v0.12 From 8529d7e3ace4994cd2caf563bb437f2c5c38bcee Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 28 Aug 2009 18:35:43 +0200 Subject: Add an opt-in QWeakPointer::operator->. To use this, you must add #define QWEAKPOINTER_ENABLE_ARROW to your .cpp before #including any headers. Be careful about adding this to .h files. Reviewed-by: Olivier Goffart --- src/corelib/tools/qsharedpointer_impl.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index e4f7ba9..a4282e1 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -626,6 +626,10 @@ public: inline QSharedPointer toStrongRef() const { return QSharedPointer(*this); } +#if defined(QWEAKPOINTER_ENABLE_ARROW) + inline T *operator->() const { return data(); } +#endif + private: #if defined(Q_NO_TEMPLATE_FRIENDS) -- cgit v0.12 From 624ea78d71dca5112272597f9f1ee165c2275c5c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 29 Aug 2009 11:54:22 +0200 Subject: Autotest: add some D-Bus tests sending complex structs and lists of them --- tests/auto/qdbusmarshall/common.h | 35 ++++++++++++++++++++++++++ tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp | 18 +++++++++++++ 2 files changed, 53 insertions(+) diff --git a/tests/auto/qdbusmarshall/common.h b/tests/auto/qdbusmarshall/common.h index 9df1e01..bdc9f09 100644 --- a/tests/auto/qdbusmarshall/common.h +++ b/tests/auto/qdbusmarshall/common.h @@ -103,6 +103,34 @@ const QDBusArgument &operator>>(const QDBusArgument &arg, MyStruct &ms) return arg; } +struct MyVariantMapStruct +{ + QString s; + QVariantMap map; + + inline bool operator==(const MyVariantMapStruct &other) const + { return s == other.s && map == other.map; } +}; +Q_DECLARE_METATYPE(MyVariantMapStruct) +Q_DECLARE_METATYPE(QList) + +QDBusArgument &operator<<(QDBusArgument &arg, const MyVariantMapStruct &ms) +{ + arg.beginStructure(); + arg << ms.s << ms.map; + arg.endStructure(); + return arg; +} + +const QDBusArgument &operator>>(const QDBusArgument &arg, MyVariantMapStruct &ms) +{ + arg.beginStructure(); + arg >> ms.s >> ms.map; + arg.endStructure(); + return arg; +} + + void commonInit() { qDBusRegisterMetaType >(); @@ -127,6 +155,8 @@ void commonInit() qDBusRegisterMetaType >(); qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType >(); } #ifdef USE_PRIVATE_CODE #include "private/qdbusintrospection_p.h" @@ -476,6 +506,11 @@ bool compareToArgument(const QDBusArgument &arg, const QVariant &v2) else if (id == qMetaTypeId()) return compare(arg, v2); + + else if (id == qMetaTypeId()) + return compare(arg, v2); + else if (id == qMetaTypeId >()) + return compare >(arg, v2); } qWarning() << "Unexpected QVariant type" << v2.userType() diff --git a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp index 6e66393..b209aef 100644 --- a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp +++ b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp @@ -492,6 +492,24 @@ void tst_QDBusMarshall::sendStructs_data() QTest::newRow("time") << QVariant(time) << "(iiii)" << "[Argument: (iiii) 12, 25, 0, 0]"; QTest::newRow("datetime") << QVariant(QDateTime(date, time)) << "((iii)(iiii)i)" << "[Argument: ((iii)(iiii)i) [Argument: (iii) 2006, 6, 18], [Argument: (iiii) 12, 25, 0, 0], 0]"; + + MyStruct ms = { 1, "Hello, World" }; + QTest::newRow("int-string") << qVariantFromValue(ms) << "(is)" << "[Argument: (is) 1, \"Hello, World\"]"; + + MyVariantMapStruct mvms = { "Hello, World", QVariantMap() }; + QTest::newRow("string-variantmap") << qVariantFromValue(mvms) << "(sa{sv})" << "[Argument: (sa{sv}) \"Hello, World\", [Argument: a{sv} {}]]"; + + // use only basic types, otherwise comparison will fail + mvms.map["int"] = 42; + mvms.map["uint"] = 42u; + mvms.map["short"] = qVariantFromValue(-47); + mvms.map["bytearray"] = QByteArray("Hello, world"); + QTest::newRow("string-variantmap2") << qVariantFromValue(mvms) << "(sa{sv})" << "[Argument: (sa{sv}) \"Hello, World\", [Argument: a{sv} {\"bytearray\" = [Variant(QByteArray): {72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100}], \"int\" = [Variant(int): 42], \"short\" = [Variant(short): -47], \"uint\" = [Variant(uint): 42]}]]"; + + QList list; + QTest::newRow("empty-list-of-string-variantmap") << qVariantFromValue(list) << "a(sa{sv})" << "[Argument: a(sa{sv}) {}]"; + list << mvms; + QTest::newRow("list-of-string-variantmap") << qVariantFromValue(list) << "a(sa{sv})" << "[Argument: a(sa{sv}) {[Argument: (sa{sv}) \"Hello, World\", [Argument: a{sv} {\"bytearray\" = [Variant(QByteArray): {72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100}], \"int\" = [Variant(int): 42], \"short\" = [Variant(short): -47], \"uint\" = [Variant(uint): 42]}]]}]"; } void tst_QDBusMarshall::sendComplex_data() -- cgit v0.12