Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/shell/sessionchooserdialog.cpp
Context not available. | |||||
198 | 198 | | |||
---|---|---|---|---|---|
199 | QModelIndex index = m_model->index(m_deleteCandidateRow, 0); | 199 | QModelIndex index = m_model->index(m_deleteCandidateRow, 0); | ||
200 | const QString uuid = m_model->data(index, Qt::DisplayRole).toString(); | 200 | const QString uuid = m_model->data(index, Qt::DisplayRole).toString(); | ||
201 | QString sessionName = m_model->data(m_model->index(m_deleteCandidateRow,1), Qt::DisplayRole).toString(); | ||||
202 | sessionName.chop(3); | ||||
201 | 203 | | |||
apol: Why do you chop(3) there? | |||||
Otherwise I noticed it displayed "Hello World: " instead of just "Hello World" sagnikchaudhuri: Otherwise I noticed it displayed "Hello World: " instead of just "Hello World" | |||||
Thinking about it, it would probably be better to introduce an extra role in the item model which only contains the short name, if that is what you want to display. Chopping off 3 characters at the end will not always work I think. brauch: Thinking about it, it would probably be better to introduce an extra role in the item model… | |||||
202 | TryLockSessionResult result = SessionController::tryLockSession( uuid ); | 204 | TryLockSessionResult result = SessionController::tryLockSession( uuid ); | ||
203 | if( !result.lock ) { | 205 | if( !result.lock ) { | ||
Context not available. | |||||
205 | QString errText = i18nc("@info", "<p>Cannot delete a locked session."); | 207 | QString errText = i18nc("@info", "<p>Cannot delete a locked session."); | ||
206 | 208 | | |||
207 | if( result.runInfo.holderPid != -1 ) { | 209 | if( result.runInfo.holderPid != -1 ) { | ||
208 | errText += i18nc("@info", "<p>The session is locked by %1 on %2 (PID %3).", | 210 | errText += i18nc("@info", "<p>The session '%1' is locked by %2 on %3 (PID %4).", | ||
209 | result.runInfo.holderApp, result.runInfo.holderHostname, result.runInfo.holderPid); | 211 | sessionName, result.runInfo.holderApp, result.runInfo.holderHostname, result.runInfo.holderPid); | ||
210 | } | 212 | } | ||
211 | 213 | | |||
212 | KMessageBox::error( this, errText, errCaption ); | 214 | KMessageBox::error( this, errText, errCaption ); | ||
213 | return; | 215 | return; | ||
214 | } | 216 | } | ||
215 | 217 | | |||
216 | const QString text = i18nc("@info", "The session and all contained settings will be deleted. The projects will stay unaffected. Do you really want to continue?"); | 218 | const QString text = i18nc("@info", "The session '%1' and all contained settings will be deleted. The projects will stay unaffected. Do you really want to continue?",sessionName); | ||
brauch: missing a space after the comma | |||||
So should I upload another diff file containing the missing space, the changes @croick mentioned? sagnikchaudhuri: So should I upload another diff file containing the missing space, the changes @croick… | |||||
217 | const QString caption = i18nc("@title", "Delete Session"); | 219 | const QString caption = i18nc("@title", "Delete Session"); | ||
218 | const KGuiItem deleteItem = KStandardGuiItem::del(); | 220 | const KGuiItem deleteItem = KStandardGuiItem::del(); | ||
219 | const KGuiItem cancelItem = KStandardGuiItem::cancel(); | 221 | const KGuiItem cancelItem = KStandardGuiItem::cancel(); | ||
Context not available. | |||||
225 | m_deleteCandidateRow = -1; | 227 | m_deleteCandidateRow = -1; | ||
226 | } | 228 | } | ||
227 | } | 229 | } | ||
228 | | ||||
Context not available. | |||||
apol: Discard unrelated change | |||||
sagnikchaudhuri: Anything else needs to be done? |
Why do you chop(3) there?