MCPcopy Create free account
hub / github.com/KDE/kdevelop / ctxMove

Method ctxMove

plugins/subversion/kdevsvnplugin.cpp:388–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388void 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
423QString KDevSvnPlugin::name() const
424{

Callers

nothing calls this directly

Calls 11

contextUrlListMethod · 0.80
isLocalFileMethod · 0.80
toLocalFileMethod · 0.80
execMethod · 0.80
registerJobMethod · 0.80
runControllerMethod · 0.80
selectedUrlMethod · 0.80
QFileInfoClass · 0.50
countMethod · 0.45
firstMethod · 0.45
setModeMethod · 0.45

Tested by

no test coverage detected