Changeset View
Changeset View
Standalone View
Standalone View
kate/kateviewmanager.cpp
Show First 20 Lines • Show All 241 Lines • ▼ Show 20 Line(s) | 239 | Q_FOREACH(const QUrl & url, urls) { | |||
---|---|---|---|---|---|
242 | } | 242 | } | ||
243 | 243 | | |||
244 | const auto size = QFile(url.toLocalFile()).size(); | 244 | const auto size = QFile(url.toLocalFile()).size(); | ||
245 | if (size > FileSizeAboveToAskUserIfProceedWithOpen) { | 245 | if (size > FileSizeAboveToAskUserIfProceedWithOpen) { | ||
246 | fileListWithTooLargeFiles += QString::fromLatin1("<li>%1 (%2MB)</li>").arg(url.fileName()).arg(size / 1024 / 1024); | 246 | fileListWithTooLargeFiles += QString::fromLatin1("<li>%1 (%2MB)</li>").arg(url.fileName()).arg(size / 1024 / 1024); | ||
247 | } | 247 | } | ||
248 | } | 248 | } | ||
249 | if (!fileListWithTooLargeFiles.isEmpty()) { | 249 | if (!fileListWithTooLargeFiles.isEmpty()) { | ||
250 | const QString text = i18n("<p>You are attempting to open one or more large files:</p><ul>%1</ul><p>Do you want to proceed?</p><p><strong>Beware that kate may stop responding for some time when opening large files.</strong></p>"); | 250 | const QString text = i18n("<p>You are attempting to open one or more large files:</p><ul>%1</ul><p>Do you want to proceed?</p><p><strong>Beware that kate may stop responding for some time when opening large files.</strong></p>" | ||
251 | const auto ret = KMessageBox::warningYesNo(this, text.arg(fileListWithTooLargeFiles), i18n("Opening Large File"), KStandardGuiItem::cont(), KStandardGuiItem::stop()); | 251 | , fileListWithTooLargeFiles); | ||
252 | const auto ret = KMessageBox::warningYesNo(this, text, i18n("Opening Large File"), KStandardGuiItem::cont(), KStandardGuiItem::stop()); | ||||
252 | if (ret == KMessageBox::No) { | 253 | if (ret == KMessageBox::No) { | ||
253 | return; | 254 | return; | ||
254 | } | 255 | } | ||
255 | } | 256 | } | ||
256 | 257 | | |||
257 | // activate view of last opened document | 258 | // activate view of last opened document | ||
258 | KateDocumentInfo docInfo; | 259 | KateDocumentInfo docInfo; | ||
259 | docInfo.openedByUser = true; | 260 | docInfo.openedByUser = true; | ||
▲ Show 20 Lines • Show All 984 Lines • Show Last 20 Lines |