mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-24 17:37:53 +02:00
2018-10-22 Fred Gleason <fredg@paravelsystems.com>
* Fixed a ''qt_sql_default_connection' is still in use' runtime warning emitted by the 'RDDbValid()' function.
This commit is contained in:
parent
5b3cd9e4ab
commit
15c0449489
@ -17877,3 +17877,6 @@
|
||||
2018-10-22 Patrick Linstruth <patrick@deltecent.com>
|
||||
* Fixed a bug in 'configure.ac' that broke the 'make rpm' target
|
||||
when used with long version strings.
|
||||
2018-10-22 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a ''qt_sql_default_connection' is still in use' runtime
|
||||
warning emitted by the 'RDDbValid()' function.
|
||||
|
@ -68,12 +68,14 @@ bool RDDbValid(RDConfig *config,int *schema)
|
||||
QSqlQuery *q;
|
||||
bool ret=false;
|
||||
|
||||
QSqlDatabase db=QSqlDatabase::addDatabase(config->mysqlDriver());
|
||||
db.setDatabaseName(config->mysqlDbname());
|
||||
db.setUserName(config->mysqlUsername());
|
||||
db.setPassword(config->mysqlPassword());
|
||||
db.setHostName(config->mysqlHostname());
|
||||
if(db.open()) {
|
||||
QSqlDatabase *db=
|
||||
new QSqlDatabase(QSqlDatabase::addDatabase(config->mysqlDriver()));
|
||||
QString conn_name=db->connectionName();
|
||||
db->setDatabaseName(config->mysqlDbname());
|
||||
db->setUserName(config->mysqlUsername());
|
||||
db->setPassword(config->mysqlPassword());
|
||||
db->setHostName(config->mysqlHostname());
|
||||
if(db->open()) {
|
||||
ret=true;
|
||||
sql="select DB from VERSION";
|
||||
q=new QSqlQuery(sql);
|
||||
@ -81,8 +83,10 @@ bool RDDbValid(RDConfig *config,int *schema)
|
||||
*schema=q->value(0).toInt();
|
||||
}
|
||||
delete q;
|
||||
db.close();
|
||||
db->close();
|
||||
}
|
||||
delete db;
|
||||
QSqlDatabase::removeDatabase(conn_name);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user