Remove QT3_SUPPORT from qsql, qxml
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Tue, 5 Jul 2011 16:30:35 +0000 (18:30 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 6 Jul 2011 10:03:30 +0000 (12:03 +0200)
Change-Id: Iab36ef60de2f0201efa4eb86d8ed5e514d6244fb
Reviewed-on: http://codereview.qt.nokia.com/1188
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
14 files changed:
src/sql/kernel/qsql.h
src/sql/kernel/qsqldatabase.cpp
src/sql/kernel/qsqldatabase.h
src/sql/kernel/qsqldriver.h
src/sql/kernel/qsqlerror.h
src/sql/kernel/qsqlfield.h
src/sql/kernel/qsqlindex.cpp
src/sql/kernel/qsqlindex.h
src/sql/kernel/qsqlquery.h
src/sql/kernel/qsqlrecord.cpp
src/sql/kernel/qsqlrecord.h
src/sql/kernel/qsqlresult.h
src/xml/sax/qxml.cpp
src/xml/sax/qxml.h

index 5a1c323..f23b518 100644 (file)
@@ -56,10 +56,6 @@ namespace QSql
     {
         BeforeFirstRow = -1,
         AfterLastRow = -2
-#ifdef QT3_SUPPORT
-        , BeforeFirst = BeforeFirstRow,
-        AfterLast = AfterLastRow
-#endif
     };
 
     enum ParamTypeFlag
@@ -87,21 +83,6 @@ namespace QSql
 
         HighPrecision        = 0
     };
-
-#ifdef QT3_SUPPORT
-    enum Op {
-        None = -1,
-        Insert = 0,
-        Update = 1,
-        Delete = 2
-    };
-
-    enum Confirm {
-        Cancel = -1,
-        No = 0,
-        Yes = 1
-    };
-#endif
 }
 
 Q_DECLARE_OPERATORS_FOR_FLAGS(QSql::ParamType)
index c5eac19..cd36d5d 100644 (file)
@@ -1434,26 +1434,6 @@ bool QSqlDatabase::isValid() const
     return d->driver && d->driver != d->shared_null()->driver;
 }
 
-#ifdef QT3_SUPPORT
-/*!
-    Use query.record() instead.
-*/
-QSqlRecord QSqlDatabase::record(const QSqlQuery& query) const
-{ return query.record(); }
-
-/*!
-    Use query.record() instead.
-*/
-QSqlRecord QSqlDatabase::recordInfo(const QSqlQuery& query) const
-{ return query.record(); }
-
-/*!
-    \fn QSqlRecord QSqlDatabase::recordInfo(const QString& tablename) const
-
-    Use record() instead.
-*/
-#endif
-
 /*!
     Clones the database connection \a other and and stores it as \a
     connectionName. All the settings from the original database, e.g.
index c8cde85..72c5694 100644 (file)
@@ -44,9 +44,6 @@
 
 #include <QtCore/qstring.h>
 #include <QtSql/qsql.h>
-#ifdef QT3_SUPPORT
-#include <QtSql/qsqlrecord.h>
-#endif
 
 QT_BEGIN_HEADER
 
@@ -92,12 +89,6 @@ public:
     QStringList tables(QSql::TableType type = QSql::Tables) const;
     QSqlIndex primaryIndex(const QString& tablename) const;
     QSqlRecord record(const QString& tablename) const;
-#ifdef QT3_SUPPORT
-    QT3_SUPPORT QSqlRecord record(const QSqlQuery& query) const;
-    inline QT3_SUPPORT QSqlRecord recordInfo(const QString& tablename) const
-    { return record(tablename); }
-    QT3_SUPPORT QSqlRecord recordInfo(const QSqlQuery& query) const;
-#endif
     QSqlQuery exec(const QString& query = QString()) const;
     QSqlError lastError() const;
     bool isValid() const;
index 479d3ac..ee1e525 100644 (file)
@@ -46,9 +46,6 @@
 #include <QtCore/qstring.h>
 #include <QtCore/qstringlist.h>
 #include <QtSql/qsql.h>
-#ifdef QT3_SUPPORT
-#include <QtSql/qsqlquery.h>
-#endif
 
 QT_BEGIN_HEADER
 
@@ -93,17 +90,6 @@ public:
     virtual QStringList tables(QSql::TableType tableType) const;
     virtual QSqlIndex primaryIndex(const QString &tableName) const;
     virtual QSqlRecord record(const QString &tableName) const;
-#ifdef QT3_SUPPORT
-    inline QT3_SUPPORT QSqlRecord record(const QSqlQuery& query) const
-    { return query.record(); }
-    inline QT3_SUPPORT QSqlRecord recordInfo(const QString& tablename) const
-    { return record(tablename); }
-    inline QT3_SUPPORT QSqlRecord recordInfo(const QSqlQuery& query) const
-    { return query.record(); }
-    inline QT3_SUPPORT QString nullText() const { return QLatin1String("NULL"); }
-    inline QT3_SUPPORT QString formatValue(const QSqlField *field, bool trimStrings = false) const
-    { return field ? formatValue(*field, trimStrings) : QString(); }
-#endif
     virtual QString formatValue(const QSqlField& field, bool trimStrings = false) const;
 
     virtual QString escapeIdentifier(const QString &identifier, IdentifierType type) const;
index 87136ec..fea3ca8 100644 (file)
@@ -59,13 +59,6 @@ public:
         StatementError,
         TransactionError,
         UnknownError
-#ifdef QT3_SUPPORT
-        , None = NoError,
-        Connection = ConnectionError,
-        Statement = StatementError,
-        Transaction = TransactionError,
-        Unknown = UnknownError
-#endif
     };
     QSqlError( const QString& driverText = QString(),
                 const QString& databaseText = QString(),
index 182b531..93992ea 100644 (file)
@@ -98,10 +98,6 @@ public:
     bool isGenerated() const;
     bool isValid() const;
 
-#ifdef QT3_SUPPORT
-    inline QT3_SUPPORT void setNull() { clear(); }
-#endif
-
 private:
     void detach();
     QVariant val;
index 33e3c1c..764e93a 100644 (file)
@@ -164,60 +164,6 @@ void QSqlIndex::setDescending(int i, bool desc)
         sorts[i] = desc;
 }
 
-#ifdef QT3_SUPPORT
-
-/*!
-    Returns a comma-separated list of all the index's field names as a
-    string. This string is suitable, for example, for generating a
-    SQL SELECT statement. Only generated fields are included in the
-    list (see \l{isGenerated()}). If a \a prefix is specified, e.g. a
-    table name, it is prepended before all field names in the form:
-
-    "\a{prefix}.<fieldname>"
-
-    If \a sep is specified, each field is separated by \a sep. If \a
-    verbose is true (the default), each field contains a suffix
-    indicating an ASCending or DESCending sort order.
-*/
-
-QString QSqlIndex::toString(const QString& prefix, const QString& sep, bool verbose) const
-{
-    QString s;
-    bool comma = false;
-    for (int i = 0; i < count(); ++i) {
-        if(comma)
-            s += sep + QLatin1Char(' ');
-        s += createField(i, prefix, verbose);
-        comma = true;
-    }
-    return s;
-}
-
-/*!
-    Returns a list of all the index's field names. Only generated
-    fields are included in the list (see \l{isGenerated()}). If a \a
-    prefix is specified, e.g. a table name, all fields are prefixed in
-    the form:
-
-    "\a{prefix}.<fieldname>"
-
-    If \a verbose is true (the default), each field contains a suffix
-    indicating an ASCending or DESCending sort order.
-
-    Note that if you want to iterate over the list, you should iterate
-    over a copy, e.g.
-    \snippet doc/src/snippets/code/src_sql_kernel_qsqlindex.cpp 0
-
-*/
-QStringList QSqlIndex::toStringList(const QString& prefix, bool verbose) const
-{
-    QStringList s;
-    for (int i = 0; i < count(); ++i)
-        s += createField(i, prefix, verbose);
-    return s;
-}
-#endif
-
 /*! \internal
 
   Creates a string representing the field number \a i using prefix \a
index 97874e2..c88e306 100644 (file)
@@ -70,14 +70,6 @@ public:
     bool isDescending(int i) const;
     void setDescending(int i, bool desc);
 
-#ifdef QT3_SUPPORT
-    QT3_SUPPORT QString toString(const QString &prefix = QString(),
-                               const QString &sep = QLatin1String(","),
-                               bool verbose = true) const;
-    QT3_SUPPORT QStringList toStringList(const QString& prefix = QString(),
-                                       bool verbose = true) const;
-#endif
-
 private:
     QString createField(int i, const QString& prefix, bool verbose) const;
     QString cursor;
index e823809..bd498f3 100644 (file)
@@ -94,9 +94,6 @@ public:
     bool seek(int i, bool relative = false);
     bool next();
     bool previous();
-#ifdef QT3_SUPPORT
-    inline QT3_SUPPORT bool prev() { return previous(); }
-#endif
     bool first();
     bool last();
 
index dfeb3e0..944f2fc 100644 (file)
@@ -244,34 +244,6 @@ int QSqlRecord::indexOf(const QString& name) const
     return -1;
 }
 
-#ifdef QT3_SUPPORT
-/*!
-    \obsolete
-    Use field() instead
-*/
-const QSqlField* QSqlRecord::fieldPtr(int index) const
-{
-    if (!d->contains(index))
-        return 0;
-
-    return &d->fields.at(index);
-}
-
-/*!
-    \obsolete
-    Use field() instead
-*/
-
-const QSqlField* QSqlRecord::fieldPtr(const QString& name) const
-{
-    int i = indexOf(name);
-    if (!d->contains(i))
-        return 0;
-
-    return &d->fields.at(i);
-}
-#endif //QT3_SUPPORT
-
 /*!
     Returns the field at position \a index. If the position is out of
     range, an empty field is returned.
@@ -496,49 +468,6 @@ bool QSqlRecord::isGenerated(int index) const
     return d->fields.value(index).isGenerated();
 }
 
-#ifdef QT3_SUPPORT
-/*!
-    Returns a list of all the record's field names as a string
-    separated by \a sep.
-
-    In the unlikely event that you used this function in Qt 3, you
-    can simulate it using the rest of the QSqlRecord public API.
-*/
-
-QString QSqlRecord::toString(const QString& prefix, const QString& sep) const
-{
-    QString pflist;
-    bool comma = false;
-    for (int i = 0; i < count(); ++i) {
-        if (!d->fields.value(i).isGenerated()) {
-            if (comma)
-                pflist += sep + QLatin1Char(' ');
-            pflist += d->createField(i, prefix);
-            comma = true;
-        }
-    }
-    return pflist;
-}
-
-/*!
-    Returns a list of all the record's field names, each having the
-    prefix \a prefix.
-
-    In the unlikely event that you used this function in Qt 3, you
-    can simulate it using the rest of the QSqlRecord public API.
-*/
-
-QStringList QSqlRecord::toStringList(const QString& prefix) const
-{
-    QStringList s;
-    for (int i = 0; i < count(); ++i) {
-        if (!d->fields.value(i).isGenerated())
-            s += d->createField(i, prefix);
-    }
-    return s;
-}
-#endif // QT3_SUPPORT
-
 /*!
     Returns the number of fields in the record.
 
index e697e8e..8c7a17a 100644 (file)
@@ -87,15 +87,6 @@ public:
     void setGenerated(const QString& name, bool generated);
     void setGenerated(int i, bool generated);
 
-#ifdef QT3_SUPPORT
-    QT3_SUPPORT const QSqlField* fieldPtr(int i) const;
-    QT3_SUPPORT const QSqlField* fieldPtr(const QString& name) const;
-    inline QT3_SUPPORT int position(const QString& name) const { return indexOf(name); }
-    QT3_SUPPORT QString toString(const QString& prefix = QString(),
-                               const QString& sep = QLatin1String(",")) const;
-    QT3_SUPPORT QStringList toStringList(const QString& prefix = QString()) const;
-#endif
-
     void append(const QSqlField& field);
     void replace(int pos, const QSqlField& field);
     void insert(int pos, const QSqlField& field);
index 58b19c1..984bd5e 100644 (file)
@@ -74,10 +74,6 @@ protected:
     enum BindingSyntax {
         PositionalBinding,
         NamedBinding
-#ifdef QT3_SUPPORT
-        , BindByPosition = PositionalBinding,
-        BindByName = NamedBinding
-#endif
     };
 
     explicit QSqlResult(const QSqlDriver * db);
index 2f5384b..671adaf 100644 (file)
@@ -1324,29 +1324,6 @@ QXmlInputSource::QXmlInputSource(QIODevice *dev)
     d->inputDevice->setTextModeEnabled(false);
 }
 
-#ifdef QT3_SUPPORT
-/*!
-    Use the QXmlInputSource(QIODevice *) constructor instead, with
-    the device used by \a stream.
-
-    \sa QTextStream::device()
-*/
-QXmlInputSource::QXmlInputSource(QTextStream& stream)
-{
-    init();
-    d->inputStream = &stream;
-}
-
-/*!
-    Use QXmlInputSource(&\a file) instead.
-*/
-QXmlInputSource::QXmlInputSource(QFile& file)
-{
-    init();
-    d->inputDevice = &file;
-}
-#endif
-
 /*!
     Destructor.
 */
index 8b402df..52eea6c 100644 (file)
@@ -172,11 +172,6 @@ public:
     static const ushort EndOfData;
     static const ushort EndOfDocument;
 
-#ifdef QT3_SUPPORT
-    QT3_SUPPORT_CONSTRUCTOR QXmlInputSource(QFile& file);
-    QT3_SUPPORT_CONSTRUCTOR QXmlInputSource(QTextStream& stream);
-#endif
-
 protected:
     virtual QString fromRawData(const QByteArray &data, bool beginning = false);