forked from qt-creator/qt-creator
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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user