| 350 | } |
| 351 | |
| 352 | void KDevSvnPlugin::ctxCopy() |
| 353 | { |
| 354 | QList<QUrl> const & ctxUrlList = m_common->contextUrlList(); |
| 355 | if (ctxUrlList.count() > 1) { |
| 356 | KMessageBox::error(nullptr, i18n("Please select only one item for this operation")); |
| 357 | return; |
| 358 | } |
| 359 | |
| 360 | QUrl source = ctxUrlList.first(); |
| 361 | |
| 362 | if (source.isLocalFile()) { |
| 363 | QUrl dir = source; |
| 364 | bool isFile = QFileInfo(source.toLocalFile()).isFile(); |
| 365 | |
| 366 | if (isFile) { |
| 367 | dir = dir.adjusted(QUrl::RemoveFilename|QUrl::StripTrailingSlash); |
| 368 | } |
| 369 | |
| 370 | KUrlRequesterDialog dlg(dir, i18nc("@label", "Destination file/directory"), nullptr); |
| 371 | |
| 372 | if (isFile) { |
| 373 | dlg.urlRequester()->setMode(KFile::File | KFile::Directory | KFile::LocalOnly); |
| 374 | } else { |
| 375 | dlg.urlRequester()->setMode(KFile::Directory | KFile::LocalOnly); |
| 376 | } |
| 377 | |
| 378 | if (dlg.exec() == QDialog::Accepted) { // krazy:exclude=crashy |
| 379 | KDevelop::ICore::self()->runController()->registerJob(copy(source, dlg.selectedUrl())); |
| 380 | } |
| 381 | } else { |
| 382 | KMessageBox::error(nullptr, i18n("Copying only works on local files")); |
| 383 | return; |
| 384 | } |
| 385 | |
| 386 | } |
| 387 | |
| 388 | void KDevSvnPlugin::ctxMove() |
| 389 | { |
nothing calls this directly
no test coverage detected