MCPcopy Create free account
hub / github.com/IJHack/QtPass / handleFileToFileDrop

Method handleFileToFileDrop

src/storemodel.cpp:406–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

404}
405
406auto StoreModel::handleFileToFileDrop(const QString &cleanedSrc,
407 const QString &cleanedDest,
408 Qt::DropAction action) -> bool {
409 QWidget *parentWidget = qobject_cast<QWidget *>(parent());
410 int answer = QMessageBox::question(
411 parentWidget, tr("Force overwrite?"),
412 tr("overwrite %1 with %2?").arg(cleanedDest, cleanedSrc),
413 QMessageBox::Yes | QMessageBox::No);
414 bool force = answer == QMessageBox::Yes;
415
416 if (action == Qt::MoveAction) {
417 QtPassSettings::getPass()->Move(cleanedSrc, cleanedDest, force);
418 } else if (action == Qt::CopyAction) {
419 QtPassSettings::getPass()->Copy(cleanedSrc, cleanedDest, force);
420 }
421 return true;
422}
423
424/**
425 * @brief StoreModel::lessThan

Callers

nothing calls this directly

Calls 2

MoveMethod · 0.45
CopyMethod · 0.45

Tested by

no test coverage detected