diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-16 11:22:52 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-16 11:22:52 +0100 |
commit | 4a5b7ff7ec97f9078780ffc44d923d11a0aa18c1 (patch) | |
tree | 5d69f32b72176fa79bb6d6ef242453312cad891e /tracker-steamvr/steamvr.cpp | |
parent | 0b155e6016d162e9ead045d9e9e862c96b7a61bd (diff) |
tracker/steamvr: better error messages
Diffstat (limited to 'tracker-steamvr/steamvr.cpp')
-rw-r--r-- | tracker-steamvr/steamvr.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tracker-steamvr/steamvr.cpp b/tracker-steamvr/steamvr.cpp index 4c40d1a1..ff48ad3d 100644 --- a/tracker-steamvr/steamvr.cpp +++ b/tracker-steamvr/steamvr.cpp @@ -170,14 +170,19 @@ tt device_list::vr_init_() QString device_list::error_string(vr_error_t err) { - const char* str(vr::VR_GetVRInitErrorAsSymbol(err)); - return QString(str ? str : "No description"); -} + const char* str = vr::VR_GetVRInitErrorAsSymbol(err); + const char* desc = vr::VR_GetVRInitErrorAsEnglishDescription(err); -steamvr::steamvr() : device_index(-1) -{ + if (!desc) + desc = "No description"; + + if (str) + return QStringLiteral("%1: %2").arg(str, desc); + else + return { "Unknown error" }; } +steamvr::steamvr() = default; steamvr::~steamvr() = default; module_status steamvr::start_tracker(QFrame*) |