From 2234af0e6113622bcc819bc5e90ba7b7c2dd2fef Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 30 Apr 2025 07:13:50 +0200 Subject: [PATCH] Core: fix warning when opening big files Fixes: QTCREATORBUG-32875 Change-Id: I4fb1a77ba1816310be8a35342f523974b884ad9b Reviewed-by: Eike Ziller Reviewed-by: hjk --- src/plugins/coreplugin/editormanager/editormanager.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index cb882f9f000..19eddc4066e 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -818,12 +818,11 @@ bool EditorManagerPrivate::skipOpeningBigTextFile(const FilePath &filePath) .arg(filePath.fileName()) .arg(fileSizeInMB, 0, 'f', 2); - bool askAgain = true; - CheckableDecider decider(&askAgain); + auto shouldAskAgain = [] { return true; }; + auto doNotAskAgain = [] { systemSettings().warnBeforeOpeningBigFiles.setValue(false); }; - QMessageBox::StandardButton clickedButton - = CheckableMessageBox::question(title, text, decider); - systemSettings().warnBeforeOpeningBigFiles.setValue(askAgain); + QMessageBox::StandardButton clickedButton = CheckableMessageBox::question( + title, text, {shouldAskAgain, doNotAskAgain}); return clickedButton != QMessageBox::Yes; }