| 2611 | |
| 2612 | |
| 2613 | qlonglong NoteTable::getSize(qint32 lid) { |
| 2614 | NSqlQuery query(db); |
| 2615 | db->lockForRead(); |
| 2616 | query.prepare("select data from datastore where key=:key and lid=:lid"); |
| 2617 | query.bindValue(":key", NOTE_CONTENT_LENGTH); |
| 2618 | query.bindValue(":lid", lid); |
| 2619 | query.exec(); |
| 2620 | qlonglong returnValue = 0; |
| 2621 | if (query.next()) { |
| 2622 | returnValue = query.value(0).toLongLong(); |
| 2623 | } |
| 2624 | query.prepare("Select sum(data) from DataStore where key=:key and lid in (select lid from datastore where key=:key2 and data=:lid)"); |
| 2625 | query.bindValue(":key", RESOURCE_DATA_SIZE); |
| 2626 | query.bindValue(":key2", RESOURCE_NOTE_LID); |
| 2627 | query.bindValue(":data", lid); |
| 2628 | query.exec(); |
| 2629 | while (query.next()) { |
| 2630 | returnValue = returnValue+query.value(0).toLongLong(); |
| 2631 | } |
| 2632 | return returnValue; |
| 2633 | } |
no test coverage detected