| 341 | } |
| 342 | |
| 343 | auto StoreModel::executeDropAction(const dragAndDropInfoPasswordStore &info, |
| 344 | Qt::DropAction action, |
| 345 | const QModelIndex &parent) -> bool { |
| 346 | QModelIndex destIndex = |
| 347 | this->index(parent.row(), parent.column(), parent.parent()); |
| 348 | QFileInfo destFileinfo = fs->fileInfo(mapToSource(destIndex)); |
| 349 | QFileInfo srcFileInfo = QFileInfo(info.path); |
| 350 | |
| 351 | QString cleanedSrc = QDir::cleanPath(srcFileInfo.absoluteFilePath()); |
| 352 | QString cleanedDest = QDir::cleanPath(destFileinfo.absoluteFilePath()); |
| 353 | |
| 354 | switch (info.kind) { |
| 355 | case dragAndDropInfoPasswordStore::ItemKind::Directory: |
| 356 | return handleDirDrop(cleanedSrc, destFileinfo, srcFileInfo, action); |
| 357 | case dragAndDropInfoPasswordStore::ItemKind::File: |
| 358 | return handleFileDrop(cleanedSrc, cleanedDest, destFileinfo, action); |
| 359 | default: |
| 360 | qWarning() << "executeDropAction: unexpected ItemKind, ignoring drop"; |
| 361 | return false; |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | auto StoreModel::handleDirDrop(const QString &cleanedSrc, |
| 366 | const QFileInfo &destFileinfo, |
nothing calls this directly
no outgoing calls
no test coverage detected