| 244 | } |
| 245 | |
| 246 | bool ReadingListModel::dropComics(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) |
| 247 | { |
| 248 | Q_UNUSED(action); |
| 249 | |
| 250 | QList<qulonglong> comicIds = YACReader::mimeDataToComicsIds(data); |
| 251 | |
| 252 | QLOG_DEBUG() << "dropped : " << comicIds; |
| 253 | |
| 254 | QModelIndex dest; |
| 255 | QModelIndex parentDest; |
| 256 | |
| 257 | if (row == -1) { |
| 258 | dest = parent; |
| 259 | } else |
| 260 | dest = index(row, column, parent); |
| 261 | |
| 262 | parentDest = dest.parent(); |
| 263 | |
| 264 | if (rowIsSpecialList(dest.row(), parentDest)) { |
| 265 | if (dest.row() == 0) // add to favorites |
| 266 | { |
| 267 | QLOG_DEBUG() << "-------addComicsToFavorites : " << comicIds << " to " << dest.data(IDRole).toULongLong(); |
| 268 | emit addComicsToFavorites(comicIds); |
| 269 | return true; |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | if (rowIsLabel(dest.row(), parentDest)) { |
| 274 | QLOG_DEBUG() << "+++++++++++addComicsToLabel : " << comicIds << " to " << dest.data(IDRole).toULongLong(); |
| 275 | emit addComicsToLabel(comicIds, dest.data(IDRole).toULongLong()); |
| 276 | return true; |
| 277 | } |
| 278 | |
| 279 | if (rowIsReadingList(dest.row(), parentDest)) { |
| 280 | QLOG_DEBUG() << "///////////addComicsToReadingList : " << comicIds << " to " << dest.data(IDRole).toULongLong(); |
| 281 | emit addComicsToReadingList(comicIds, dest.data(IDRole).toULongLong()); |
| 282 | return true; |
| 283 | } |
| 284 | |
| 285 | return false; |
| 286 | } |
| 287 | |
| 288 | bool ReadingListModel::dropSublist(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) |
| 289 | { |