| 498 | } |
| 499 | |
| 500 | int SQLiteDB::insertNodeEntry(const QString &title, int type, int data_type) |
| 501 | { |
| 502 | QSqlQuery query; |
| 503 | |
| 504 | query.prepare("INSERT INTO object_node (type, data_type, title) VALUES (:type, :data_type, :title)"); |
| 505 | query.bindValue(0, type); |
| 506 | query.bindValue(1, data_type); |
| 507 | query.bindValue(2, title); |
| 508 | |
| 509 | if(!query.exec() || !query.exec("SELECT last_insert_rowid()") || !query.next()) { |
| 510 | qDebug() << query.lastError(); |
| 511 | return 0; |
| 512 | } |
| 513 | |
| 514 | return query.value(0).toInt(); |
| 515 | } |
| 516 | |
| 517 | bool SQLiteDB::insertSourceEntry(uint object_id, const QString &path, const QString &name) |
| 518 | { |