Changeset View
Changeset View
Standalone View
Standalone View
src/document/katedocument.cpp
Show First 20 Lines • Show All 4239 Lines • ▼ Show 20 Line(s) | 4239 | { | |||
---|---|---|---|---|---|
4240 | if (url().isEmpty()) { | 4240 | if (url().isEmpty()) { | ||
4241 | return false; | 4241 | return false; | ||
4242 | } | 4242 | } | ||
4243 | 4243 | | |||
4244 | // typically, the message for externally modified files is visible. Since it | 4244 | // typically, the message for externally modified files is visible. Since it | ||
4245 | // does not make sense showing an additional dialog, just hide the message. | 4245 | // does not make sense showing an additional dialog, just hide the message. | ||
4246 | delete m_modOnHdHandler; | 4246 | delete m_modOnHdHandler; | ||
4247 | 4247 | | |||
4248 | if (m_modOnHd && m_fileChangedDialogsActivated) { | | |||
4249 | QWidget *parentWidget(dialogParent()); | | |||
4250 | | ||||
4251 | int i = KMessageBox::warningYesNoCancel | | |||
4252 | (parentWidget, reasonedMOHString() + QLatin1String("\n\n") + i18n("What do you want to do?"), | | |||
4253 | i18n("File Was Changed on Disk"), | | |||
4254 | KGuiItem(i18n("&Reload File"), QStringLiteral("view-refresh")), | | |||
4255 | KGuiItem(i18n("&Ignore Changes"), QStringLiteral("dialog-warning"))); | | |||
4256 | | ||||
4257 | if (i != KMessageBox::Yes) { | | |||
4258 | if (i == KMessageBox::No) { | | |||
4259 | m_modOnHd = false; | | |||
4260 | m_modOnHdReason = OnDiskUnmodified; | | |||
4261 | m_prevModOnHdReason = OnDiskUnmodified; | | |||
4262 | emit modifiedOnDisk(this, m_modOnHd, m_modOnHdReason); | | |||
4263 | } | | |||
4264 | | ||||
4265 | // reset some flags only valid for one reload! | | |||
4266 | m_userSetEncodingForNextReload = false; | | |||
4267 | return false; | | |||
4268 | } | | |||
4269 | } | | |||
4270 | | ||||
4271 | emit aboutToReload(this); | 4248 | emit aboutToReload(this); | ||
4272 | 4249 | | |||
4273 | QList<KateDocumentTmpMark> tmp; | 4250 | QList<KateDocumentTmpMark> tmp; | ||
4274 | 4251 | | |||
4275 | for (QHash<int, KTextEditor::Mark *>::const_iterator i = m_marks.constBegin(); i != m_marks.constEnd(); ++i) { | 4252 | for (QHash<int, KTextEditor::Mark *>::const_iterator i = m_marks.constBegin(); i != m_marks.constEnd(); ++i) { | ||
4276 | KateDocumentTmpMark m; | 4253 | KateDocumentTmpMark m; | ||
4277 | 4254 | | |||
4278 | m.line = line(i.value()->line); | 4255 | m.line = line(i.value()->line); | ||
▲ Show 20 Lines • Show All 1742 Lines • Show Last 20 Lines |