mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-07-14 07:37:45 +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>
|
2018-10-22 Patrick Linstruth <patrick@deltecent.com>
|
||||||
* Fixed a bug in 'configure.ac' that broke the 'make rpm' target
|
* Fixed a bug in 'configure.ac' that broke the 'make rpm' target
|
||||||
when used with long version strings.
|
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;
|
QSqlQuery *q;
|
||||||
bool ret=false;
|
bool ret=false;
|
||||||
|
|
||||||
QSqlDatabase db=QSqlDatabase::addDatabase(config->mysqlDriver());
|
QSqlDatabase *db=
|
||||||
db.setDatabaseName(config->mysqlDbname());
|
new QSqlDatabase(QSqlDatabase::addDatabase(config->mysqlDriver()));
|
||||||
db.setUserName(config->mysqlUsername());
|
QString conn_name=db->connectionName();
|
||||||
db.setPassword(config->mysqlPassword());
|
db->setDatabaseName(config->mysqlDbname());
|
||||||
db.setHostName(config->mysqlHostname());
|
db->setUserName(config->mysqlUsername());
|
||||||
if(db.open()) {
|
db->setPassword(config->mysqlPassword());
|
||||||
|
db->setHostName(config->mysqlHostname());
|
||||||
|
if(db->open()) {
|
||||||
ret=true;
|
ret=true;
|
||||||
sql="select DB from VERSION";
|
sql="select DB from VERSION";
|
||||||
q=new QSqlQuery(sql);
|
q=new QSqlQuery(sql);
|
||||||
@ -81,8 +83,10 @@ bool RDDbValid(RDConfig *config,int *schema)
|
|||||||
*schema=q->value(0).toInt();
|
*schema=q->value(0).toInt();
|
||||||
}
|
}
|
||||||
delete q;
|
delete q;
|
||||||
db.close();
|
db->close();
|
||||||
}
|
}
|
||||||
|
delete db;
|
||||||
|
QSqlDatabase::removeDatabase(conn_name);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user