src/sql/kernel/qsqldatabase.cpp
changeset 30 5dc02b23752f
parent 18 2f34d5167611
child 37 758a864f9613
equal deleted inserted replaced
29:b72c6db6890b 30:5dc02b23752f
    96 #include "qhash.h"
    96 #include "qhash.h"
    97 #include <stdlib.h>
    97 #include <stdlib.h>
    98 
    98 
    99 QT_BEGIN_NAMESPACE
    99 QT_BEGIN_NAMESPACE
   100 
   100 
   101 #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
   101 #ifndef QT_NO_LIBRARY
   102 Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
   102 Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
   103                           (QSqlDriverFactoryInterface_iid,
   103                           (QSqlDriverFactoryInterface_iid,
   104                            QLatin1String("/sqldrivers")))
   104                            QLatin1String("/sqldrivers")))
   105 #endif
   105 #endif
   106 
   106 
   574 #endif
   574 #endif
   575 #ifdef QT_SQL_IBASE
   575 #ifdef QT_SQL_IBASE
   576     list << QLatin1String("QIBASE");
   576     list << QLatin1String("QIBASE");
   577 #endif
   577 #endif
   578 
   578 
   579 #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
   579 #ifndef QT_NO_LIBRARY
   580     if (QFactoryLoader *fl = loader()) {
   580     if (QFactoryLoader *fl = loader()) {
   581         QStringList keys = fl->keys();
   581         QStringList keys = fl->keys();
   582         for (QStringList::const_iterator i = keys.constBegin(); i != keys.constEnd(); ++i) {
   582         for (QStringList::const_iterator i = keys.constBegin(); i != keys.constEnd(); ++i) {
   583             if (!list.contains(*i))
   583             if (!list.contains(*i))
   584                 list << *i;
   584                 list << *i;
   772                 driver = ((QSqlDriverCreatorBase*)(*it))->createObject();
   772                 driver = ((QSqlDriverCreatorBase*)(*it))->createObject();
   773             }
   773             }
   774         }
   774         }
   775     }
   775     }
   776 
   776 
   777 #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
   777 #ifndef QT_NO_LIBRARY
   778     if (!driver && loader()) {
   778     if (!driver && loader()) {
   779         if (QSqlDriverFactoryInterface *factory = qobject_cast<QSqlDriverFactoryInterface*>(loader()->instance(type)))
   779         if (QSqlDriverFactoryInterface *factory = qobject_cast<QSqlDriverFactoryInterface*>(loader()->instance(type)))
   780             driver = factory->create(type);
   780             driver = factory->create(type);
   781     }
   781     }
   782 #endif // QT_NO_LIBRARY
   782 #endif // QT_NO_LIBRARY