From c5ba98b0edb5cc9b2e78f3ea16a5acbd784fd1e2 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 25 Jan 2021 14:33:19 +0100 Subject: [PATCH] Core: skip text file size warning ... if the size exseeds our harcoded text file size limit and it is opened in the binary editor anyway. Fixes: QTCREATORBUG-15114 Change-Id: Ic806f425c2cf14632885c990bd5733a0abb17366 Reviewed-by: Eike Ziller --- src/plugins/coreplugin/editormanager/editormanager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 1731f6698be..c463e7db2e8 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -752,8 +752,9 @@ bool EditorManagerPrivate::skipOpeningBigTextFile(const QString &filePath) return false; const QFileInfo fileInfo(filePath); - const double fileSizeInMB = fileInfo.size() / 1000.0 / 1000.0; - if (fileSizeInMB > d->m_bigFileSizeLimitInMB) { + const qint64 fileSize = fileInfo.size(); + const double fileSizeInMB = fileSize / 1000.0 / 1000.0; + if (fileSizeInMB > d->m_bigFileSizeLimitInMB && fileSize < EditorManager::maxTextFileSize()) { const QString title = EditorManager::tr("Continue Opening Huge Text File?"); const QString text = EditorManager::tr( "The text file \"%1\" has the size %2MB and might take more memory to open"