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

Method move

plugins/git/gitplugin.cpp:1671–1692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1669}
1670
1671VcsJob* GitPlugin::move(const QUrl& source, const QUrl& destination)
1672{
1673 QDir dir = urlDir(source);
1674
1675 QFileInfo fileInfo(source.toLocalFile());
1676 if (fileInfo.isDir()) {
1677 if (isEmptyDirStructure(QDir(source.toLocalFile()))) {
1678 //move empty folder, git doesn't do that
1679 qCDebug(PLUGIN_GIT) << "empty folder" << source;
1680 return new StandardJob(this, KIO::move(source, destination));
1681 }
1682 }
1683
1684 const QStringList otherStr = getLsFiles(dir, QStringList{QStringLiteral("--others"), QStringLiteral("--"), source.toLocalFile()}, KDevelop::OutputJob::Silent);
1685 if(otherStr.isEmpty()) {
1686 auto* job = new GitJob(dir, this, KDevelop::OutputJob::Verbose);
1687 *job << "git" << "mv" << source.toLocalFile() << destination.toLocalFile();
1688 return job;
1689 } else {
1690 return new StandardJob(this, KIO::move(source, destination));
1691 }
1692}
1693
1694void GitPlugin::parseGitRepoLocationOutput(DVcsJob* job)
1695{

Callers 8

updateItemWidgetsFunction · 0.45
itemEnteredMethod · 0.45
moveViewPositionMethod · 0.45
renameUrlMethod · 0.45
doVisibilityMethod · 0.45
setViewGeometryMethod · 0.45
actionsForPartsMethod · 0.45

Calls 5

isEmptyDirStructureFunction · 0.85
toLocalFileMethod · 0.80
urlDirFunction · 0.70
QDirClass · 0.70
isEmptyMethod · 0.45

Tested by 1