| 164 | } |
| 165 | |
| 166 | QModelIndex ReadingListModel::parent(const QModelIndex &index) const |
| 167 | { |
| 168 | |
| 169 | if (!index.isValid()) |
| 170 | return QModelIndex(); |
| 171 | |
| 172 | auto item = static_cast<ListItem *>(index.internalPointer()); |
| 173 | |
| 174 | if (typeid(*item) == typeid(ReadingListItem)) { |
| 175 | auto childItem = static_cast<ReadingListItem *>(index.internalPointer()); |
| 176 | ReadingListItem *parent = childItem->parent; |
| 177 | if (parent->getId() != 0) |
| 178 | return createIndex(parent->row() + specialLists.count() + labels.count() + 2, 0, parent); |
| 179 | } |
| 180 | |
| 181 | return QModelIndex(); |
| 182 | } |
| 183 | |
| 184 | bool ReadingListModel::canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const |
| 185 | { |
no test coverage detected