| 154 | } |
| 155 | |
| 156 | void 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 | |
| 183 | VcsEventWidget::VcsEventWidget( const QUrl& url, const VcsRevision& rev, KDevelop::IBasicVersionControl* iface, QWidget* parent ) |
| 184 | : QWidget(parent) |
nothing calls this directly
no test coverage detected