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

Method ensureValidGitIdentity

plugins/git/gitplugin.cpp:560–580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558
559
560bool GitPlugin::ensureValidGitIdentity(const QDir& dir)
561{
562 const QUrl url = QUrl::fromLocalFile(dir.absolutePath());
563
564 const QString name = readConfigOption(url, QStringLiteral("user.name"));
565 const QString email = readConfigOption(url, QStringLiteral("user.email"));
566 if (!email.isEmpty() && !name.isEmpty()) {
567 return true; // already okay
568 }
569
570 GitNameEmailDialog dialog;
571 dialog.setName(name);
572 dialog.setEmail(email);
573 if (!dialog.exec()) {
574 return false;
575 }
576
577 runSynchronously(setConfigOption(url, QStringLiteral("user.name"), dialog.name(), dialog.isGlobal()));
578 runSynchronously(setConfigOption(url, QStringLiteral("user.email"), dialog.email(), dialog.isGlobal()));
579 return true;
580}
581
582void GitPlugin::addNotVersionedFiles(const QDir& dir, const QList<QUrl>& files)
583{

Callers

nothing calls this directly

Calls 8

setEmailMethod · 0.80
execMethod · 0.80
isGlobalMethod · 0.80
emailMethod · 0.80
runSynchronouslyFunction · 0.70
isEmptyMethod · 0.45
setNameMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected