Core: fix warning when opening big files

Fixes: QTCREATORBUG-32875
Change-Id: I4fb1a77ba1816310be8a35342f523974b884ad9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
David Schulz
2025-04-30 07:13:50 +02:00
parent cf83c0b651
commit 2234af0e61

View File

@@ -818,12 +818,11 @@ bool EditorManagerPrivate::skipOpeningBigTextFile(const FilePath &filePath)
.arg(filePath.fileName()) .arg(filePath.fileName())
.arg(fileSizeInMB, 0, 'f', 2); .arg(fileSizeInMB, 0, 'f', 2);
bool askAgain = true; auto shouldAskAgain = [] { return true; };
CheckableDecider decider(&askAgain); auto doNotAskAgain = [] { systemSettings().warnBeforeOpeningBigFiles.setValue(false); };
QMessageBox::StandardButton clickedButton QMessageBox::StandardButton clickedButton = CheckableMessageBox::question(
= CheckableMessageBox::question(title, text, decider); title, text, {shouldAskAgain, doNotAskAgain});
systemSettings().warnBeforeOpeningBigFiles.setValue(askAgain);
return clickedButton != QMessageBox::Yes; return clickedButton != QMessageBox::Yes;
} }