bool StorageImpl::init()
{
- EVAF_INFO("%s initialized", qPrintable(objectName()));
-
// Open the database
if (!QSqlDatabase::contains(DbConnectionName)) {
// No database connection yet
/// Register our interface
Common::iRegistry::instance()->registerInterface("iStorage", this);
+ EVAF_INFO("%s initialized", qPrintable(objectName()));
+
return true;
}
// This is an update
if (data->modified()) {
QSqlQuery q(mDb);
- if (!q.exec(QString("UPDATE data SET length = \'%1\', flags = \'%2\' WHERE name = \'%3\';").arg(data->length()).arg(data->flags()).arg(name))) {
+ if (!q.exec(QString("UPDATE data SET length = \'%1\', flags = \'%2\' WHERE name = \'%3\';")
+ .arg(data->length()).arg(data->flags()).arg(name))) {
QSqlError err = mDb.lastError();
EVAF_ERROR("Failed to update \'%s\' : %s", qPrintable(name), qPrintable(err.text()));
return false;
else {
// Store to the database
QSqlQuery q(mDb);
- if (!q.exec(QString("INSERT INTO data (name, length, flags) VALUES (\'%1\', %2, %3);").arg(name).arg(data->length()).arg(int(data->flags())))) {
+ if (!q.exec(QString("INSERT INTO data (name, length, flags) VALUES (\'%1\', %2, %3);")
+ .arg(name).arg(data->length())
+ .arg(int(data->flags())))) {
QSqlError err = mDb.lastError();
EVAF_ERROR("Failed to insert \'%s\' : %s", qPrintable(name), qPrintable(err.text()));
return false;