| 127 | } |
| 128 | |
| 129 | ConfigurationModel DatabaseManager::getConfigurationByName(const QString& name) |
| 130 | { |
| 131 | QMutexLocker locker(&mutex); |
| 132 | |
| 133 | QSqlQuery sql; |
| 134 | sql.prepare("SELECT c.Id, c.Name, c.Value FROM Configuration c " |
| 135 | "WHERE c.Name = :Name"); |
| 136 | sql.bindValue(":Name", name); |
| 137 | |
| 138 | if (!sql.exec()) |
| 139 | qCritical("Failed to execute sql query: %s, Error: %s", qPrintable(sql.lastQuery()), qPrintable(sql.lastError().text())); |
| 140 | |
| 141 | sql.first(); |
| 142 | |
| 143 | return ConfigurationModel(sql.value("Id").toInt(), sql.value("Name").toString(), sql.value("Value").toString()); |
| 144 | } |
| 145 | |
| 146 | QList<FormatModel> DatabaseManager::getFormat() |
| 147 | { |