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

Method diffRevisions

kdevplatform/vcs/widgets/vcseventwidget.cpp:156–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156void VcsEventWidgetPrivate::diffRevisions()
157{
158 QModelIndexList l = m_ui->eventView->selectionModel()->selectedRows();
159 KDevelop::VcsEvent ev1 = m_logModel->eventForIndex( l.first() );
160 KDevelop::VcsEvent ev2 = m_logModel->eventForIndex( l.last() );
161 KDevelop::VcsJob* job = m_iface->diff( m_url, ev1.revision(), ev2.revision() );
162
163 auto* widget = new VcsDiffWidget( job );
164 widget->setRevisions( ev1.revision(), ev2.revision() );
165
166 auto dlg = new QDialog( q );
167 dlg->setWindowTitle( i18nc("@title:window", "Difference between Revisions") );
168
169 widget->connect(widget, &VcsDiffWidget::destroyed, dlg, &QDialog::deleteLater);
170
171 auto mainLayout = new QVBoxLayout(dlg);
172 auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
173 auto okButton = buttonBox->button(QDialogButtonBox::Ok);
174 okButton->setDefault(true);
175 okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
176 dlg->connect(buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept);
177 dlg->connect(buttonBox, &QDialogButtonBox::rejected, dlg, &QDialog::reject);
178 mainLayout->addWidget(buttonBox);
179 mainLayout->addWidget(widget);
180 dlg->show();
181}
182
183VcsEventWidget::VcsEventWidget( const QUrl& url, const VcsRevision& rev, KDevelop::IBasicVersionControl* iface, QWidget* parent )
184 : QWidget(parent)

Callers

nothing calls this directly

Calls 9

eventForIndexMethod · 0.80
setRevisionsMethod · 0.80
buttonMethod · 0.80
showMethod · 0.80
firstMethod · 0.45
lastMethod · 0.45
diffMethod · 0.45
revisionMethod · 0.45
addWidgetMethod · 0.45

Tested by

no test coverage detected