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

Method VcsCommitDialog

kdevplatform/vcs/widgets/vcscommitdialog.cpp:36–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34};
35
36VcsCommitDialog::VcsCommitDialog( IPatchSource *patchSource, QWidget *parent )
37 : QDialog(parent)
38 , d_ptr(new VcsCommitDialogPrivate())
39{
40 Q_D(VcsCommitDialog);
41
42 d->ui.setupUi(this);
43
44 KDevelop::restoreAndAutoSaveGeometry(*this, QStringLiteral("VCS"), QStringLiteral("CommitDialog"));
45
46 QWidget *customWidget = patchSource->customWidget();
47 if( customWidget )
48 {
49 d->ui.verticalLayout->insertWidget(0, customWidget);
50 }
51
52 auto okButton = d->ui.buttonBox->button(QDialogButtonBox::Ok);
53 okButton->setDefault(true);
54 okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
55 connect(d->ui.buttonBox, &QDialogButtonBox::accepted, this, &VcsCommitDialog::accept);
56 connect(d->ui.buttonBox, &QDialogButtonBox::rejected, this, &VcsCommitDialog::reject);
57
58 d->m_patchSource = patchSource;
59 d->m_model = new VcsFileChangesModel( this, true );
60 d->ui.files->setModel( d->m_model );
61
62 // Resize columns asynchronously because the contents is not ready yet.
63 QMetaObject::invokeMethod(
64 this,
65 [d] {
66 for (auto c = 0, columnCount = d->m_model->columnCount(); c != columnCount; ++c) {
67 d->ui.files->resizeColumnToContents(c);
68 }
69 },
70 Qt::QueuedConnection);
71}
72
73VcsCommitDialog::~VcsCommitDialog() = default;
74

Callers

nothing calls this directly

Calls 6

setupUiMethod · 0.80
buttonMethod · 0.80
customWidgetMethod · 0.45
setModelMethod · 0.45
columnCountMethod · 0.45

Tested by

no test coverage detected