Adds succesfull lts/proxies migration & testsuite
This commit is contained in:
59 files changed
+754
-273
No files matched your search
@@ -30,7 +30,7 @@ Dao::Dao(int exerciseId)
|
||||
, m_bEmitMessageOnError(true)
|
||||
, m_bCanHandleSchemas(true)
|
||||
, m_ownDatabaseConnection(true)
|
||||
, m_logger(getLogger("Db"))
|
||||
, m_logger(&getLogger("Db"))
|
||||
{}
|
||||
|
||||
Dao::~Dao()
|
||||
@@ -55,7 +55,7 @@ bool Dao::init(const QString &dbUser,
|
||||
{
|
||||
m_ownDatabaseConnection = true;
|
||||
|
||||
m_dbConnection = DBConnection::open(m_logger, dbUser, dbPasswd, dbDriver, dbHost, dbName, schemaName());
|
||||
m_dbConnection = DBConnection::open(*m_logger, dbUser, dbPasswd, dbDriver, dbHost, dbName, schemaName());
|
||||
|
||||
return initInternal();
|
||||
}
|
||||
@@ -65,15 +65,15 @@ bool Dao::initInternal()
|
||||
QSqlDriver *driver = m_dbConnection.driver();
|
||||
if (!driver)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "No SQL driver loaded - no database available!";
|
||||
WARNING_LOG(*m_logger) << "No SQL driver loaded - no database available!";
|
||||
return false;
|
||||
}
|
||||
const QString driverName = m_dbConnection.driverName();
|
||||
DEBUG_LOG(m_logger) << "Connected to database " << m_dbConnection.databaseName() << "@" << m_dbConnection.hostName()
|
||||
DEBUG_LOG(*m_logger) << "Connected to database " << m_dbConnection.databaseName() << "@" << m_dbConnection.hostName()
|
||||
<< ", schema: " << schemaName() << ", used driver: " << driverName;
|
||||
if (!m_dbConnection.isOpen())
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Database connection is no open - can not initialize database interface";
|
||||
WARNING_LOG(*m_logger) << "Database connection is no open - can not initialize database interface";
|
||||
return false;
|
||||
}
|
||||
if (driverName == QLatin1String("QSQLITE"))
|
||||
@@ -82,7 +82,7 @@ bool Dao::initInternal()
|
||||
{% if has_db_notifications %}
|
||||
if (!driver->hasFeature(QSqlDriver::EventNotifications))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Can not subscribe to notifications - sqldriver does not support this feature!";
|
||||
WARNING_LOG(*m_logger) << "Can not subscribe to notifications - sqldriver does not support this feature!";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -91,7 +91,7 @@ bool Dao::initInternal()
|
||||
{% for cpp_struct in cpp_structs %}{% for db_notify in cpp_struct.dbNotifications %}driver->subscribeToNotification(QStringLiteral("{{ db_notify }}"));{% endfor %}{% endfor %}
|
||||
}
|
||||
{% endif %}
|
||||
m_query = std::unique_ptr<NSqlQuery>(new NSqlQuery(m_dbConnection, m_logger));
|
||||
m_query = std::unique_ptr<NSqlQuery>(new NSqlQuery(m_dbConnection, *m_logger));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ QSqlError Dao::getLastError() const
|
||||
{% if has_db_notifications %}
|
||||
void Dao::onNotification(const QString &name, QSqlDriver::NotificationSource source, const QVariant &payload)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Notification source = " << source;
|
||||
DEBUG_LOG(*m_logger) << "Notification source = " << source;
|
||||
if (source == QSqlDriver::SelfSource)
|
||||
return;
|
||||
// search coresponding signal
|
||||
|
||||
Reference in new issue
Block a user