diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-08-04 16:29:09 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-08-06 09:06:17 (GMT) |
commit | 633f3f45e5420663cf4ceadea79e62fea44cd2eb (patch) | |
tree | 1b2c0d8b5dc0746a51c2ea4bf542845273cf7006 /src/sql/drivers/oci | |
parent | 7b5e37cab738804d47b78582aa3d0f3bb6933e70 (diff) | |
download | Qt-633f3f45e5420663cf4ceadea79e62fea44cd2eb.zip Qt-633f3f45e5420663cf4ceadea79e62fea44cd2eb.tar.gz Qt-633f3f45e5420663cf4ceadea79e62fea44cd2eb.tar.bz2 |
Remove the use of deprecated qVariant*
Test directory untouched.
This just apply those regexp:
git grep -O"sed -i 's/qVariantValue</qvariant_cast</'" qVariantValue
git grep -O"sed -i 's/qVariantSetValue(\([^&*\(),]*\), */\\1.setValue(/'" qVariantSetValue
git grep -O"sed -i 's/qVariantSetValue *<\([^>]*\)> *(\([^&*\(),]*\), */\\2.setValue<\\1>(/'" qVariantSetValue
git grep -O"sed -i 's/qVariantCanConvert *<\([^>]*\)> *(\([^&*\(),]*\))/\\2.canConvert<\\1>()/g'" qVariantCanConvert
git grep -O"sed -i 's/qVariantCanConvert *<\([^>]*\)> *(\([^&*\(),]*([^&*\(),]*)\))/\\2.canConvert<\\1>()/g'" qVariantCanConvert
git grep -O"sed -i 's/qVariantFromValue\( *[(<]\)/QVariant::fromValue\\1/'" qVariantFromValue
git checkout src/corelib/kernal/qvariant*
Rev-by: dev mailing list
Diffstat (limited to 'src/sql/drivers/oci')
-rw-r--r-- | src/sql/drivers/oci/qsql_oci.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp index e11cf75..6870055 100644 --- a/src/sql/drivers/oci/qsql_oci.cpp +++ b/src/sql/drivers/oci/qsql_oci.cpp @@ -293,9 +293,9 @@ int QOCIResultPrivate::bindValue(OCIStmt *sql, OCIBind **hbnd, OCIError *err, in SQLT_FLT, indPtr, 0, 0, 0, 0, OCI_DEFAULT); break; case QVariant::UserType: - if (qVariantCanConvert<QOCIRowIdPointer>(val) && !isOutValue(pos)) { + if (val.canConvert<QOCIRowIdPointer>() && !isOutValue(pos)) { // use a const pointer to prevent a detach - const QOCIRowIdPointer rptr = qVariantValue<QOCIRowIdPointer>(val); + const QOCIRowIdPointer rptr = qvariant_cast<QOCIRowIdPointer>(val); r = OCIBindByPos(sql, hbnd, err, pos + 1, // it's an IN value, so const_cast is ok @@ -1364,8 +1364,8 @@ bool QOCICols::execBatch(QOCIResultPrivate *d, QVector<QVariant> &boundValues, b break; } case QVariant::UserType: - if (qVariantCanConvert<QOCIRowIdPointer>(val)) { - const QOCIRowIdPointer rptr = qVariantValue<QOCIRowIdPointer>(val); + if (val.canConvert<QOCIRowIdPointer>()) { + const QOCIRowIdPointer rptr = qvariant_cast<QOCIRowIdPointer>(val); *reinterpret_cast<OCIRowid**>(dataPtr) = rptr->id; columns[i].lengths[row] = 0; break; @@ -1704,7 +1704,7 @@ QOCIResult::~QOCIResult() QVariant QOCIResult::handle() const { - return qVariantFromValue(d->sql); + return QVariant::fromValue(d->sql); } bool QOCIResult::reset (const QString& query) @@ -1932,7 +1932,7 @@ QVariant QOCIResult::lastInsertId() const int r = OCIAttrGet(d->sql, OCI_HTYPE_STMT, ptr.constData()->id, 0, OCI_ATTR_ROWID, d->err); if (r == OCI_SUCCESS) - return qVariantFromValue(ptr); + return QVariant::fromValue(ptr); } return QVariant(); } @@ -2534,7 +2534,7 @@ QString QOCIDriver::formatValue(const QSqlField &field, bool trimStrings) const QVariant QOCIDriver::handle() const { - return qVariantFromValue(d->env); + return QVariant::fromValue(d->env); } QString QOCIDriver::escapeIdentifier(const QString &identifier, IdentifierType type) const |