| 271 | } |
| 272 | |
| 273 | bool CRecentDatabase::DeleteRecent(int id) |
| 274 | { |
| 275 | if(0 >= id) return false; |
| 276 | QSqlQuery query(GetDatabase()); |
| 277 | query.prepare("DELETE FROM recent WHERE id=:id"); |
| 278 | query.bindValue(":id", id); |
| 279 | bool success = query.exec(); |
| 280 | if (!success) { |
| 281 | SetError("Failed to delete recent: " + query.lastError().text() |
| 282 | + "; Sql: " + query.executedQuery() |
| 283 | + "; id: " + QString::number(id)); |
| 284 | qCritical(log) << GetError(); |
| 285 | } |
| 286 | return success; |
| 287 | } |
| 288 | |
| 289 | QList<CRecentDatabase::RecentItem> CRecentDatabase::GetRecents(int limit, int offset) |
| 290 | { |