Get a list of notes for a given tag
| 1061 | |
| 1062 | // Get a list of notes for a given tag |
| 1063 | qint32 NoteTable::getNotesWithTag(QList<qint32> &retval, QString tag) { |
| 1064 | db->lockForRead(); |
| 1065 | NSqlQuery query(db); |
| 1066 | TagTable tagTable(db); |
| 1067 | qint32 tagLid = tagTable.getLid(tag); |
| 1068 | query.prepare("Select lid data from DataStore where data=:tag and key=:key"); |
| 1069 | query.bindValue(":tag", tagLid); |
| 1070 | query.bindValue(":key", NOTE_TAG_LID); |
| 1071 | query.exec(); |
| 1072 | while(query.next()) { |
| 1073 | retval.append(query.value(0).toInt()); |
| 1074 | } |
| 1075 | query.finish(); |
| 1076 | db->unlock(); |
| 1077 | return retval.size(); |
| 1078 | } |
| 1079 | |
| 1080 | |
| 1081 | // Set if a note needs to be indexed |