Avoid UTF8->UTF16->UTF8 roundtrip when logging on mobile

Make writeToAppLogFile() take an std::string parameter to avoid
an unnecessary UTF8->UTF16->UTF8 (std::string->QString->char *)
roundtrip.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-11-30 16:28:49 +01:00 committed by bstoeger
parent 7d1e0ef0d1
commit 4d4c250589
3 changed files with 8 additions and 8 deletions

View file

@ -12,7 +12,7 @@
#endif
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
extern void writeToAppLogFile(QString logText);
extern void writeToAppLogFile(const std::string &logText);
#endif
int verbose;
@ -26,7 +26,7 @@ void report_info(const char *fmt, ...)
LOG_MSG("INFO: %s\n", s.c_str());
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
writeToAppLogFile(s.c_str());
writeToAppLogFile(s);
#endif
}
@ -41,7 +41,7 @@ int report_error(const char *fmt, ...)
LOG_MSG("ERROR: %s\n", s.c_str());
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
writeToAppLogFile(s.c_str());
writeToAppLogFile(s);
#endif
/* if there is no error callback registered, don't produce errors */