| 386 | } |
| 387 | |
| 388 | void KDevSvnPlugin::ctxMove() |
| 389 | { |
| 390 | QList<QUrl> const & ctxUrlList = m_common->contextUrlList(); |
| 391 | if (ctxUrlList.count() != 1) { |
| 392 | KMessageBox::error(nullptr, i18n("Please select only one item for this operation")); |
| 393 | return; |
| 394 | } |
| 395 | |
| 396 | QUrl source = ctxUrlList.first(); |
| 397 | |
| 398 | if (source.isLocalFile()) { |
| 399 | QUrl dir = source; |
| 400 | bool isFile = QFileInfo(source.toLocalFile()).isFile(); |
| 401 | |
| 402 | if (isFile) { |
| 403 | dir = source.adjusted(QUrl::RemoveFilename|QUrl::StripTrailingSlash); |
| 404 | } |
| 405 | |
| 406 | KUrlRequesterDialog dlg(dir, i18n("Destination file/directory"), nullptr); |
| 407 | |
| 408 | if (isFile) { |
| 409 | dlg.urlRequester()->setMode(KFile::File | KFile::Directory | KFile::LocalOnly); |
| 410 | } else { |
| 411 | dlg.urlRequester()->setMode(KFile::Directory | KFile::LocalOnly); |
| 412 | } |
| 413 | |
| 414 | if (dlg.exec() == QDialog::Accepted) { // krazy:exclude=crashy |
| 415 | KDevelop::ICore::self()->runController()->registerJob(move(source, dlg.selectedUrl())); |
| 416 | } |
| 417 | } else { |
| 418 | KMessageBox::error(nullptr, i18n("Moving only works on local files/dirs")); |
| 419 | return; |
| 420 | } |
| 421 | } |
| 422 | |
| 423 | QString KDevSvnPlugin::name() const |
| 424 | { |
nothing calls this directly
no test coverage detected