Berthold Stoeger fd8bd9d5c7 cleanup: use std::string in struct device
struct device is a core data structure and therefore shouldn't use QString.
QString stores as UTF-16 (which is a very questionable choice in itself).
However, the real problem is that this puts us in lifetime-management
hell when interfacing with C code: The UTF-16 has to be converted to
UTF-8, but when returning such a string, this puts burden on the caller
who has to free it. In fact, instead of looping over devices from C-code
we had a callback that sent down temporary C-strings with qPrintable.

In contrast, std::string is guaranteed to store its data as
contiguous null-terminated and C-compatible strings. Therefore,
replace the QString by std::string. Keep the QString just in
one place that formats a hexadecimal number to avoid any
potential change.

The disadvantage of using std::string is that it will crash
when constructed with a NULL argument, consistent with C-style
functions such as strcmp, etc. Arguably, NULL is different
from the empty string even though we treat both as the same.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-16 14:26:37 -07:00
..
2020-04-19 14:27:54 -07:00
2019-08-08 08:56:44 -07:00
2019-08-08 16:26:31 -07:00
2017-04-29 13:32:55 -07:00
2020-09-29 16:13:03 -07:00
2020-10-05 10:17:29 +02:00
2020-10-16 13:57:00 -07:00
2020-10-16 14:15:50 -07:00
2018-10-21 19:55:09 +03:00
2020-03-01 10:21:44 -08:00
2020-01-27 09:51:31 -08:00
2020-04-18 13:41:29 +02:00
2019-12-13 07:04:00 -05:00
2020-10-05 10:17:29 +02:00
2017-04-29 13:32:55 -07:00
2020-03-10 17:42:54 -07:00
2020-03-10 17:42:54 -07:00
2020-05-03 15:02:21 -07:00
2019-11-09 19:19:04 +01:00