Changeset View
Changeset View
Standalone View
Standalone View
src/document/katedocument.cpp
Show First 20 Lines • Show All 4196 Lines • ▼ Show 20 Line(s) | |||||
4197 | } | 4197 | } | ||
4198 | 4198 | | |||
4199 | bool KTextEditor::DocumentPrivate::documentReload() | 4199 | bool KTextEditor::DocumentPrivate::documentReload() | ||
4200 | { | 4200 | { | ||
4201 | if (url().isEmpty()) { | 4201 | if (url().isEmpty()) { | ||
4202 | return false; | 4202 | return false; | ||
4203 | } | 4203 | } | ||
4204 | 4204 | | |||
4205 | // typically, the message for externally modified files is visible. Since it | | |||
4206 | // does not make sense showing an additional dialog, just hide the message. | | |||
4207 | delete m_modOnHdHandler; | | |||
4208 | | ||||
4209 | if (m_modOnHd && m_fileChangedDialogsActivated) { | | |||
4210 | QWidget *parentWidget(dialogParent()); | | |||
4211 | | ||||
4212 | int i = KMessageBox::warningYesNoCancel | | |||
4213 | (parentWidget, reasonedMOHString() + QLatin1String("\n\n") + i18n("What do you want to do?"), | | |||
4214 | i18n("File Was Changed on Disk"), | | |||
4215 | KGuiItem(i18n("&Reload File"), QStringLiteral("view-refresh")), | | |||
4216 | KGuiItem(i18n("&Ignore Changes"), QStringLiteral("dialog-warning"))); | | |||
4217 | | ||||
4218 | if (i != KMessageBox::Yes) { | | |||
4219 | if (i == KMessageBox::No) { | | |||
4220 | m_modOnHd = false; | | |||
4221 | m_modOnHdReason = OnDiskUnmodified; | | |||
4222 | m_prevModOnHdReason = OnDiskUnmodified; | | |||
4223 | emit modifiedOnDisk(this, m_modOnHd, m_modOnHdReason); | | |||
4224 | } | | |||
4225 | | ||||
4226 | // reset some flags only valid for one reload! | | |||
4227 | m_userSetEncodingForNextReload = false; | | |||
4228 | return false; | | |||
4229 | } | | |||
4230 | } | | |||
4231 | | ||||
4232 | emit aboutToReload(this); | 4205 | emit aboutToReload(this); | ||
4233 | 4206 | | |||
4234 | QList<KateDocumentTmpMark> tmp; | 4207 | QList<KateDocumentTmpMark> tmp; | ||
4235 | 4208 | | |||
4236 | for (QHash<int, KTextEditor::Mark *>::const_iterator i = m_marks.constBegin(); i != m_marks.constEnd(); ++i) { | 4209 | for (QHash<int, KTextEditor::Mark *>::const_iterator i = m_marks.constBegin(); i != m_marks.constEnd(); ++i) { | ||
4237 | KateDocumentTmpMark m; | 4210 | KateDocumentTmpMark m; | ||
4238 | 4211 | | |||
4239 | m.line = line(i.value()->line); | 4212 | m.line = line(i.value()->line); | ||
▲ Show 20 Lines • Show All 1742 Lines • Show Last 20 Lines |