diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-04-27 06:52:38 (GMT) |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-04-27 06:52:38 (GMT) |
commit | 6ed9a0b6344cfd0fd9c27f6a69f15b4e709f97eb (patch) | |
tree | 68d6c4928dbd91d50e08b5b9d09a1178dffad092 /src/declarative/extra/qmlsqlconnection.cpp | |
parent | 5d8ce4c43c3c2816cd5dca03ddd429f26b96d34d (diff) | |
parent | 7e94543a9b013b6b1140137ba64406b74a363afc (diff) | |
download | Qt-6ed9a0b6344cfd0fd9c27f6a69f15b4e709f97eb.zip Qt-6ed9a0b6344cfd0fd9c27f6a69f15b4e709f97eb.tar.gz Qt-6ed9a0b6344cfd0fd9c27f6a69f15b4e709f97eb.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git://scm.dev.nokia.troll.no/qt/kinetic into kinetic-declarativeui-qfx
Diffstat (limited to 'src/declarative/extra/qmlsqlconnection.cpp')
-rw-r--r-- | src/declarative/extra/qmlsqlconnection.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/declarative/extra/qmlsqlconnection.cpp b/src/declarative/extra/qmlsqlconnection.cpp index 3e2032c..7f1fec2 100644 --- a/src/declarative/extra/qmlsqlconnection.cpp +++ b/src/declarative/extra/qmlsqlconnection.cpp @@ -62,7 +62,6 @@ public: int port; QString name, databaseName, connectionOptions; QString hostName, userName, password, driver; - QmlContext *context; }; /*! @@ -177,8 +176,6 @@ public: QmlSqlConnection::QmlSqlConnection(QObject *parent) : QObject(*(new QmlSqlConnectionPrivate), parent) { - Q_D(QmlSqlConnection); - d->context = QmlContext::activeContext(); } /*! @@ -416,10 +413,11 @@ QSqlDatabase QmlSqlConnection::database() const } if (db.isOpen()) return db; - if ((d->driver.isEmpty() || d->driver == QLatin1String("QSQLITE")) && d->context) { + if ((d->driver.isEmpty() || d->driver == QLatin1String("QSQLITE")) && + qmlContext(this)) { // SQLITE uses files for databases, hence use relative pathing // if possible. - QUrl url = d->context->resolvedUrl(d->databaseName); + QUrl url = qmlContext(this)->resolvedUrl(d->databaseName); if (url.isRelative() || url.scheme() == QLatin1String("file")) db.setDatabaseName(url.toLocalFile()); else |