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

Method ctxCopy

plugins/subversion/kdevsvnplugin.cpp:352–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352void 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
388void KDevSvnPlugin::ctxMove()
389{

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