mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 10:22:55 +00:00
fix upstream QTBUG-15773 and QTBUG-70506
upstream commits:49efea26a5
dedd4a7a7c
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
f40fc06760
commit
4370a45efe
2 changed files with 17 additions and 7 deletions
3
README
3
README
|
@ -76,7 +76,8 @@ QTBUG-40153, QTBUG-35479, QTBUG-1628, QTBUG-42989, QTBUG-34861, QTBUG-46767,
|
|||
QTBUG-25114, QTBUG-24672, QTBUG-23524 (WIP), QTBUG-56088, QTBUG-42189,
|
||||
QTBUG-39285, QTBUG-18173, QTBUG-28968, QTBUG-34336, QTBUG-40974, QTBUG-44286,
|
||||
QTBUG-12564, QTBUG-20028, QTBUG-71967, QTBUG-70956, QTBUG-71446, QTBUG-61307,
|
||||
QTBUG-27287, QTBUG-25143, QTBUG-22833, QTBUG-57399, QTBUG-59159
|
||||
QTBUG-27287, QTBUG-25143, QTBUG-22833, QTBUG-57399, QTBUG-59159, QTBUG-15773,
|
||||
QTBUG-70506
|
||||
|
||||
Unless you use QMake and QDoc porting to Katie or even supporting it along with
|
||||
Qt4 in the same codebase is trivial and requires only minor changes because
|
||||
|
|
|
@ -89,7 +89,7 @@ static QVariant::Type qGetColumnType(const QString &tpName)
|
|||
}
|
||||
|
||||
static QSqlError qMakeError(sqlite3 *access, const QString &descr, QSqlError::ErrorType type,
|
||||
int errorCode = -1)
|
||||
int errorCode)
|
||||
{
|
||||
return QSqlError(descr,
|
||||
QString::fromUtf8(reinterpret_cast<const char *>(sqlite3_errmsg(access))),
|
||||
|
@ -563,15 +563,23 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c
|
|||
|
||||
sqlite3_enable_shared_cache(sharedCache);
|
||||
|
||||
if (sqlite3_open_v2(db.toUtf8().constData(), &d->access, openMode, NULL) == SQLITE_OK) {
|
||||
const int res = sqlite3_open_v2(db.toUtf8().constData(), &d->access, openMode, NULL);
|
||||
|
||||
if (res == SQLITE_OK) {
|
||||
sqlite3_busy_timeout(d->access, timeOut);
|
||||
setOpen(true);
|
||||
setOpenError(false);
|
||||
return true;
|
||||
} else {
|
||||
setLastError(qMakeError(d->access, tr("Error opening database"),
|
||||
QSqlError::ConnectionError));
|
||||
QSqlError::ConnectionError, res));
|
||||
setOpenError(true);
|
||||
|
||||
if (d->access) {
|
||||
sqlite3_close(d->access);
|
||||
d->access = 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -582,9 +590,10 @@ void QSQLiteDriver::close()
|
|||
foreach (QSQLiteResult *result, d->results)
|
||||
result->d->finalize();
|
||||
|
||||
if (sqlite3_close(d->access) != SQLITE_OK)
|
||||
setLastError(qMakeError(d->access, tr("Error closing database"),
|
||||
QSqlError::ConnectionError));
|
||||
const int res = sqlite3_close(d->access);
|
||||
|
||||
if (res != SQLITE_OK)
|
||||
setLastError(qMakeError(d->access, tr("Error closing database"), QSqlError::ConnectionError, res));
|
||||
d->access = 0;
|
||||
setOpen(false);
|
||||
setOpenError(false);
|
||||
|
|
Loading…
Add table
Reference in a new issue