Mercurial > public > ostc_companion
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 1:0b3630a29ad8 | 2:177f640940f2 |
|---|---|
| 35 | 35 |
| 36 #include "Exception.h" | 36 #include "Exception.h" |
| 37 | 37 |
| 38 #include <QString> | 38 #include <QString> |
| 39 | 39 |
| 40 | |
| 41 Exception::Exception(const QString& msg) | |
| 42 : _msg(msg.toStdString()) {} | |
| 43 | |
| 44 Exception::Exception(const char* msg) | |
| 45 : _msg(msg) {} | |
| 46 | |
| 47 const char* Exception::what() const noexcept { | |
| 48 return _msg.c_str(); | |
| 49 } | |
| 50 | |
| 51 #if 0 | |
| 40 Exception::Exception(const char* msg) | 52 Exception::Exception(const char* msg) |
| 41 : _msg(strdup(msg)) | 53 : _msg(strdup(msg)) |
| 42 {} | 54 {} |
| 43 | 55 |
| 44 Exception::Exception(const QString& msg) | 56 Exception::Exception(const QString& msg) |
| 52 | 64 |
| 53 const char* Exception::what() const throw() | 65 const char* Exception::what() const throw() |
| 54 { | 66 { |
| 55 return _msg; | 67 return _msg; |
| 56 } | 68 } |
| 69 #endif |
