| 252 | } |
| 253 | |
| 254 | CDatabaseUrl::UrlItem CDatabaseUrl::GetItem(int id) |
| 255 | { |
| 256 | UrlItem item; |
| 257 | if (0 >= id) return item; |
| 258 | |
| 259 | QSqlQuery query(GetDatabase()); |
| 260 | query.prepare("SELECT url, title, icon, visit_time FROM " + m_szTableName + |
| 261 | " WHERE id = :id"); |
| 262 | query.bindValue(":id", id); |
| 263 | if (query.exec() && query.next()) { |
| 264 | item.id = id; |
| 265 | item.szUrl = query.value(0).toString(); |
| 266 | item.szTitle = query.value(1).toString(); |
| 267 | item.iconId = query.value(2).toInt(); |
| 268 | item.icon = m_iconDB.GetIcon(item.iconId); |
| 269 | item.visit_time = query.value(3).toDateTime(); |
| 270 | } |
| 271 | return item; |
| 272 | } |
| 273 | |
| 274 | CDatabaseUrl::UrlItem CDatabaseUrl::GetItem(const QString& url) |
| 275 | { |
no test coverage detected