Commit 78824b02 authored by Ronan's avatar Ronan
Browse files

fix(AbstractDb): unused variable when soci is not available

parent 01999cba
......@@ -30,30 +30,25 @@ LINPHONE_BEGIN_NAMESPACE
AbstractDb::AbstractDb (AbstractDbPrivate &p) : Object(*new AbstractDbPrivate) {}
bool AbstractDb::connect (Backend backend, const std::string &parameters) {
L_D(AbstractDb);
#ifdef SOCI_ENABLED
try {
if (d->isConnected) {
d->session.close();
d->isConnected = false;
L_D(AbstractDb);
try {
if (d->isConnected) {
d->session.close();
d->isConnected = false;
}
d->session.open(backend == Mysql ? "mysql" : "sqlite3", parameters);
init();
} catch (const exception &e) {
return false;
}
d->session.open(backend == Mysql ? "mysql" : "sqlite3", parameters);
init();
} catch (const exception &e) {
return false;
}
return true;
return true;
#else
lWarning() << "Cannot use AbstractDb. Soci is not enabled.";
return false;
#endif // ifndef SOCI_ENABLED
lWarning() << "Cannot use AbstractDb. Soci is not enabled.";
return false;
#endif // ifndef SOCI_ENABLED
}
bool AbstractDb::isConnected () const {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment