Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/sql/drivers/odbc/qsql_odbc.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    6363#define ODBC_CHECK_DRIVER
    6464
    65 #if defined(Q_ODBC_VERSION_2)
    66 //crude hack to get non-unicode capable driver managers to work
    67 # undef UNICODE
    68 # define SQLTCHAR SQLCHAR
    69 # define SQL_C_TCHAR SQL_C_CHAR
    70 #endif
    71 
    7265// newer platform SDKs use SQLLEN instead of SQLINTEGER
    73 #if defined(WIN32) && (_MSC_VER < 1300)
     66#if defined(WIN32) && (_MSC_VER < 1300)
    7467# define QSQLLEN SQLINTEGER
    7568# define QSQLULEN SQLUINTEGER
     
    267260static QString qODBCWarn(const QODBCPrivate* odbc, int *nativeCode = 0)
    268261{
    269     return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->dpEnv()) + QLatin1Char(' ')
     262    return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->dpEnv()) + QLatin1Char(' ')
    270263             + qWarnODBCHandle(SQL_HANDLE_DBC, odbc->dpDbc()) + QLatin1Char(' ')
    271264             + qWarnODBCHandle(SQL_HANDLE_STMT, odbc->hStmt, nativeCode)).simplified();
     
    274267static QString qODBCWarn(const QODBCDriverPrivate* odbc, int *nativeCode = 0)
    275268{
    276     return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->hEnv) + QLatin1Char(' ')
     269    return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->hEnv) + QLatin1Char(' ')
    277270             + qWarnODBCHandle(SQL_HANDLE_DBC, odbc->hDbc, nativeCode)).simplified();
    278271}
     
    344337        type = QVariant::DateTime;
    345338        break;
    346 #ifndef Q_ODBC_VERSION_2
    347339    case SQL_WCHAR:
    348340    case SQL_WVARCHAR:
     
    350342        type = QVariant::String;
    351343        break;
    352 #endif
    353344    case SQL_CHAR:
    354345    case SQL_VARCHAR:
     
    670661static int qGetODBCVersion(const QString &connOpts)
    671662{
    672 #ifndef Q_ODBC_VERSION_2
    673663    if (connOpts.contains(QLatin1String("SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC3"), Qt::CaseInsensitive))
    674664        return SQL_OV_ODBC3;
    675 #endif
    676     if (connOpts.contains(QLatin1String("SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC2"), Qt::CaseInsensitive))
    677         return SQL_OV_ODBC2;
    678 #ifdef _IODBCUNIX_H
    679     return SQL_OV_ODBC3;
    680 #else
    681665    return SQL_OV_ODBC2;
    682 #endif
    683666}
    684667
     
    781764            }
    782765            r = SQLSetConnectAttr(hDbc, SQL_ATTR_TRACE, (SQLPOINTER) v, 0);
    783 #ifndef Q_ODBC_VERSION_2
    784766        } else if (opt.toUpper() == QLatin1String("SQL_ATTR_CONNECTION_POOLING")) {
    785767            if (val == QLatin1String("SQL_CP_OFF"))
     
    808790            }
    809791            r = SQLSetConnectAttr(hDbc, SQL_ATTR_CP_MATCH, (SQLPOINTER)v, 0);
    810 #endif
    811792        } else if (opt.toUpper() == QLatin1String("SQL_ATTR_ODBC_VERSION")) {
    812793            // Already handled in QODBCDriver::open()
     
    15301511                break;
    15311512            case QVariant::String:
    1532 #ifndef Q_ODBC_VERSION_2
    15331513                if (d->unicode) {
    15341514                    QString str = val.toString();
     
    15681548                }
    15691549                else
    1570 #endif
    15711550                {
    15721551                    QByteArray str = val.toString().toUtf8();
     
    19741953void QODBCDriverPrivate::checkUnicode()
    19751954{
    1976 #if defined(Q_ODBC_VERSION_2)
    1977     unicode = false;
    1978     return;
    1979 #endif
    1980 
    19811955    SQLRETURN   r;
    19821956    SQLUINTEGER fFunc;
     
    21332107#endif
    21342108        isFreeTDSDriver = serverType.contains(QLatin1String("tdsodbc"), Qt::CaseInsensitive);
    2135         unicode = isFreeTDSDriver == false;
     2109        unicode = ;
    21362110    }
    21372111}
  • trunk/src/sql/drivers/odbc/qsql_odbc.h

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    4848#if defined (Q_OS_WIN32)
    4949#include <QtCore/qt_windows.h>
    50 #endif
    51 
    52 #if defined (Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3)
    53 // assume we use iodbc on MACX
    54 // comment next line out if you use a
    55 // unicode compatible manager
    56 # define Q_ODBC_VERSION_2
    5750#endif
    5851
Note: See TracChangeset for help on using the changeset viewer.