| 125 | } |
| 126 | |
| 127 | bool CHistoryModel::removeRows(int row, int count, const QModelIndex &parent) |
| 128 | { |
| 129 | if (row < 0 || row + count > m_historyItems.count()) |
| 130 | return false; |
| 131 | |
| 132 | if(!m_pDatabase) { |
| 133 | qCritical(log) << "The m_pDatabase is nullptr"; |
| 134 | return false; |
| 135 | } |
| 136 | |
| 137 | beginRemoveRows(parent, row, row + count - 1); |
| 138 | |
| 139 | for (int i = row + count - 1; i >= row; --i) { |
| 140 | m_pDatabase->deleteHistoryEntry(m_historyItems.at(i).id); |
| 141 | m_historyItems.removeAt(i); |
| 142 | } |
| 143 | |
| 144 | endRemoveRows(); |
| 145 | return true; |
| 146 | } |
| 147 | |
| 148 | HistoryItem CHistoryModel::getItem(const QModelIndex &index) const |
| 149 | { |
no test coverage detected