Mercurial > public > ostc_companion
diff Utils/Exception.cpp @ 2:177f640940f2
Update exception class and cleanup redifinitions
During firmware download and exception caused the application to stop.
Rootcause was the defference between QT5 and QT6 exception and string
handling which is updated now. In addition some old definitions were
removed to avoid compiler warnings.
| author | Ideenmodellierer |
|---|---|
| date | Fri, 28 Nov 2025 19:57:35 +0100 |
| parents | 0b3630a29ad8 |
| children |
line wrap: on
line diff
--- a/Utils/Exception.cpp Thu Nov 27 18:40:28 2025 +0100 +++ b/Utils/Exception.cpp Fri Nov 28 19:57:35 2025 +0100 @@ -37,6 +37,18 @@ #include <QString> + +Exception::Exception(const QString& msg) + : _msg(msg.toStdString()) {} + +Exception::Exception(const char* msg) + : _msg(msg) {} + +const char* Exception::what() const noexcept { + return _msg.c_str(); +} + +#if 0 Exception::Exception(const char* msg) : _msg(strdup(msg)) {} @@ -54,3 +66,4 @@ { return _msg; } +#endif
