aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/utils.qbs
diff options
context:
space:
mode:
authorhjk <[email protected]>2024-09-26 12:52:04 +0200
committerhjk <[email protected]>2024-09-27 07:31:48 +0000
commitf497ac4c3b8ad9c80c0172ea93aa969d49934141 (patch)
treee7041bde8a2774dfece4904496bde28db3ebc9d6 /src/libs/utils/utils.qbs
parentc74808ed47ce1a0a1449f2bd6f933eb8341b4415 (diff)
Utils: Introduce a dedicated Result class
Effectively wrapping a std::optional<QString> with the meaning that "no string" is a success result and "some string" is an error result and the string contents is an error message. This is meant to replace uses of expected_str<void> which effectively does the same, but has the peculiarity that a default constructed object means "success". The default constructor of Result is private, as "success" object Result::Ok should be used. Change-Id: If8a01b9f97a6ecd0785f5db19980605fefa5c4b5 Reviewed-by: Jarek Kobus <[email protected]>
Diffstat (limited to 'src/libs/utils/utils.qbs')
-rw-r--r--src/libs/utils/utils.qbs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs
index ce526dbdde4..79218ffd4fb 100644
--- a/src/libs/utils/utils.qbs
+++ b/src/libs/utils/utils.qbs
@@ -267,6 +267,8 @@ QtcLibrary {
"reloadpromptutils.h",
"removefiledialog.cpp",
"removefiledialog.h",
+ "result.cpp",
+ "result.h",
"savefile.cpp",
"savefile.h",
"scopedswap.h",