| 116 | } |
| 117 | |
| 118 | bool CRecentModel::removeRows(int row, int count, const QModelIndex &parent) |
| 119 | { |
| 120 | if (row < 0 || row + count > m_Items.count()) |
| 121 | return false; |
| 122 | |
| 123 | if(!m_pDatabase) { |
| 124 | qCritical(log) << "The m_pDatabase is nullptr"; |
| 125 | return false; |
| 126 | } |
| 127 | |
| 128 | for (int i = row + count - 1; i >= row; i--) { |
| 129 | m_pDatabase->DeleteRecent(m_Items.at(i).id); |
| 130 | m_Items.removeAt(i); |
| 131 | } |
| 132 | |
| 133 | return true; |
| 134 | } |
| 135 | |
| 136 | void CRecentModel::refresh(int limit) |
| 137 | { |