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 <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2021-01-25 14:33:19 +01:00
parent f19baeb9a5
commit c5ba98b0ed

View File

@@ -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"