summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qmetaobject_p.h7
-rw-r--r--src/corelib/kernel/qobject.cpp91
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h4
-rw-r--r--src/gui/kernel/qapplication_s60.cpp3
-rw-r--r--src/gui/styles/images/defaults60theme.blobbin0 -> 74127 bytes
-rw-r--r--src/gui/styles/qs60style.cpp2
-rw-r--r--src/gui/styles/qs60style_simulated.cpp3
-rw-r--r--src/gui/styles/qstyle_s60_simulated.qrc2
-rw-r--r--src/gui/styles/styles.pri3
-rw-r--r--src/network/access/qnetworkdiskcache.cpp2
-rw-r--r--src/opengl/qgl_p.h40
-rw-r--r--src/opengl/qglshaderprogram.cpp24
-rw-r--r--src/opengl/qglshaderprogram.h3
-rw-r--r--src/opengl/qpixmapdata_gl.cpp37
-rw-r--r--src/openvg/qwindowsurface_vgegl.cpp6
-rw-r--r--src/s60installs/s60installs.pro19
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp22
-rw-r--r--src/sql/drivers/sqlite/qsql_sqlite.cpp24
-rw-r--r--src/sql/kernel/qsqldatabase.cpp1
-rw-r--r--src/xmlpatterns/parser/qquerytransformparser.cpp61
20 files changed, 168 insertions, 186 deletions
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index d843deb..572e727 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
{
@@ -121,13 +122,17 @@ 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,
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);
+#endif
};
#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<QObject *>(sender);
- QObject *r = const_cast<QObject *>(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;
}
}
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<T> toStrongRef() const { return QSharedPointer<T>(*this); }
+#if defined(QWEAKPOINTER_ENABLE_ARROW)
+ inline T *operator->() const { return data(); }
+#endif
+
private:
#if defined(Q_NO_TEMPLATE_FRIENDS)
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;
diff --git a/src/gui/styles/images/defaults60theme.blob b/src/gui/styles/images/defaults60theme.blob
new file mode 100644
index 0000000..f3a5952
--- /dev/null
+++ b/src/gui/styles/images/defaults60theme.blob
Binary files differ
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;
}
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 @@
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="/trolltech/styles/s60style">
- <file>images/s60themes.dat</file>
+ <file>images/defaults60theme.blob</file>
</qresource>
</RCC>
diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri
index 70ac6cb..767ade0 100644
--- a/src/gui/styles/styles.pri
+++ b/src/gui/styles/styles.pri
@@ -168,11 +168,10 @@ 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
+ RESOURCES += styles/qstyle_s60_simulated.qrc
}
} else {
DEFINES += QT_NO_STYLE_S60
diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp
index f1a0098b..3ae6f01 100644
--- a/src/network/access/qnetworkdiskcache.cpp
+++ b/src/network/access/qnetworkdiskcache.cpp
@@ -482,7 +482,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.
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 *>(QGLContext::currentContext());
+ if (currentContext != ctx && !qgl_share_reg()->checkSharing(ctx, currentContext)) {
+ m_oldContext = currentContext;
+ m_ctx = const_cast<QGLContext *>(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/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<QGLShader *> shaders;
QList<QGLShader *> 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<QGLShader *> 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<QGLShader *>(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;
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 *>(QGLContext::currentContext());
- if (currentContext != ctx && !qgl_share_reg()->checkSharing(ctx, currentContext)) {
- m_oldContext = currentContext;
- m_ctx = const_cast<QGLContext *>(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)
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)
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 0314958..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}
@@ -25,17 +26,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 = \
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<class T>
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);
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp
index 81afbf9..db7950d 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
diff --git a/src/xmlpatterns/parser/qquerytransformparser.cpp b/src/xmlpatterns/parser/qquerytransformparser.cpp
index 2e45817..3f747ff 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 <limits>
#include <QUrl>