From 9e9bbf215cb72467ec71be144b24b177e31afe0a Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 8 Apr 2025 17:17:23 +0200 Subject: Utils: Replace Result class by type alias to std::expected ... to be able to conveniently return also non-void cases without being exposed to the syntax of expected. The price for the more general approach is some uglification of the void case: The previous 'Result' is now equivalent to 'Result<>', which needs to be spelled out in function signatures, and some changes to the special cases. Change-Id: Ic5026e237ef2077a0765cdb8287122cae99d699f Reviewed-by: Marcus Tillmanns Reviewed-by: Eike Ziller --- src/plugins/qmldesigner/documentmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/qmldesigner/documentmanager.cpp') diff --git a/src/plugins/qmldesigner/documentmanager.cpp b/src/plugins/qmldesigner/documentmanager.cpp index 72234568f07..14053312a70 100644 --- a/src/plugins/qmldesigner/documentmanager.cpp +++ b/src/plugins/qmldesigner/documentmanager.cpp @@ -317,7 +317,7 @@ bool DocumentManager::createFile(const QString &filePath, const QString &content TextFileFormat textFileFormat; textFileFormat.setCodecName(Core::EditorManager::defaultTextCodecName()); - return textFileFormat.writeFile(FilePath::fromString(filePath), contents); + return textFileFormat.writeFile(FilePath::fromString(filePath), contents).has_value(); } void DocumentManager::addFileToVersionControl(const QString &directoryPath, const QString &newFilePath) -- cgit v1.2.3