Changeset View
Changeset View
Standalone View
Standalone View
project/projectitemlineedit.cpp
Show First 20 Lines • Show All 196 Lines • ▼ Show 20 Line(s) | 175 | { | |||
---|---|---|---|---|---|
197 | connect(buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject); | 197 | connect(buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject); | ||
198 | mainLayout->addWidget(buttonBox); | 198 | mainLayout->addWidget(buttonBox); | ||
199 | 199 | | |||
200 | if (m_suggestion) { | 200 | if (m_suggestion) { | ||
201 | const QModelIndex idx = proxymodel->proxyIndexFromItem(m_suggestion->projectItem()); | 201 | const QModelIndex idx = proxymodel->proxyIndexFromItem(m_suggestion->projectItem()); | ||
202 | view->selectionModel()->select(idx, QItemSelectionModel::ClearAndSelect); | 202 | view->selectionModel()->select(idx, QItemSelectionModel::ClearAndSelect); | ||
203 | } | 203 | } | ||
204 | 204 | | |||
205 | int res = dialog.exec(); | 205 | if(dialog.exec() == QDialog::Accepted && view->selectionModel()->hasSelection()) { | ||
206 | | ||||
207 | if(res==QDialog::Accepted && view->selectionModel()->hasSelection()) { | | |||
208 | QModelIndex idx=proxymodel->mapToSource(view->selectionModel()->selectedIndexes().first()); | 206 | QModelIndex idx=proxymodel->mapToSource(view->selectionModel()->selectedIndexes().first()); | ||
209 | 207 | | |||
210 | setText(KDevelop::joinWithEscaping(model->pathFromIndex(idx), sep, escape)); | 208 | setText(KDevelop::joinWithEscaping(model->pathFromIndex(idx), sep, escape)); | ||
211 | selectAll(); | 209 | selectAll(); | ||
212 | return true; | 210 | return true; | ||
213 | } | 211 | } | ||
214 | return false; | 212 | return false; | ||
215 | } | 213 | } | ||
Show All 36 Lines |