| 124 | } |
| 125 | |
| 126 | void VcsEventWidgetPrivate::diffToPrevious() |
| 127 | { |
| 128 | KDevelop::VcsEvent ev = m_logModel->eventForIndex( m_contextIndex ); |
| 129 | KDevelop::VcsRevision prev = KDevelop::VcsRevision::createSpecialRevision(KDevelop::VcsRevision::Previous); |
| 130 | KDevelop::VcsJob* job = m_iface->diff( m_url, prev, ev.revision() ); |
| 131 | |
| 132 | auto* widget = new VcsDiffWidget( job ); |
| 133 | widget->setRevisions( prev, ev.revision() ); |
| 134 | auto* dlg = new QDialog( q ); |
| 135 | |
| 136 | widget->connect(widget, &VcsDiffWidget::destroyed, dlg, &QDialog::deleteLater); |
| 137 | |
| 138 | dlg->setWindowTitle( i18nc("@title:window", "Difference To Previous") ); |
| 139 | |
| 140 | auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); |
| 141 | auto mainWidget = new QWidget; |
| 142 | auto *mainLayout = new QVBoxLayout; |
| 143 | dlg->setLayout(mainLayout); |
| 144 | mainLayout->addWidget(mainWidget); |
| 145 | QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); |
| 146 | okButton->setDefault(true); |
| 147 | okButton->setShortcut(Qt::CTRL | Qt::Key_Return); |
| 148 | dlg->connect(buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept); |
| 149 | dlg->connect(buttonBox, &QDialogButtonBox::rejected, dlg, &QDialog::reject); |
| 150 | mainLayout->addWidget(widget); |
| 151 | mainLayout->addWidget(buttonBox); |
| 152 | |
| 153 | dlg->show(); |
| 154 | } |
| 155 | |
| 156 | void VcsEventWidgetPrivate::diffRevisions() |
| 157 | { |
nothing calls this directly
no test coverage detected