MCPcopy Create free account
hub / github.com/KDE/kate / openCommitChangesDialog

Method openCommitChangesDialog

addons/project/gitwidget.cpp:851–877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

849}
850
851void GitWidget::openCommitChangesDialog(bool amend)
852{
853 if (!amend && m_model->stagedFiles().isEmpty()) {
854 sendMessage(i18n("Nothing to commit. Please stage your changes first."), true);
855 return;
856 }
857
858 auto *dialog = new GitCommitDialog(m_commitMessage, this);
859
860 if (amend) {
861 dialog->setAmendingCommit();
862 }
863
864 connect(dialog, &QDialog::finished, this, [this, dialog](int res) {
865 dialog->deleteLater();
866 if (res == QDialog::Accepted) {
867 if (dialog->subject().isEmpty()) {
868 sendMessage(i18n("Commit message cannot be empty."), true);
869 return;
870 }
871 m_commitMessage = dialog->subject() + QStringLiteral("[[\n\n]]") + dialog->description();
872 commitChanges(dialog->subject(), dialog->description(), dialog->signoff(), dialog->amendingLastCommit());
873 }
874 });
875
876 dialog->open();
877}
878
879void GitWidget::handleClick(const QModelIndex &idx, ClickAction clickAction)
880{

Callers

nothing calls this directly

Calls 7

setAmendingCommitMethod · 0.80
subjectMethod · 0.80
signoffMethod · 0.80
amendingLastCommitMethod · 0.80
isEmptyMethod · 0.45
descriptionMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected