X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Fqstring_helpers.cpp;h=4f63167b4305f665e9cb04403b346a94054a73ee;hb=4804f637400627ef031bca55b8395d68bf63122a;hp=1e421ca132552e08e624e8abfb22e27d336d85aa;hpb=1e4f4fcd914932ea3ecc223eece2b4bb4bb469ff;p=lyx.git diff --git a/src/support/qstring_helpers.cpp b/src/support/qstring_helpers.cpp index 1e421ca132..4f63167b43 100644 --- a/src/support/qstring_helpers.cpp +++ b/src/support/qstring_helpers.cpp @@ -12,7 +12,9 @@ #include -#include "support/docstring.h" +#include "support/qstring_helpers.h" + +#include "support/debug.h" #include "support/docstring.h" #include @@ -20,6 +22,12 @@ namespace lyx { +LyXErr & operator<<(LyXErr & err, QString const & str) +{ + return err << fromqstr(str); +} + + QString toqstr(char const * str) { return QString::fromUtf8(str); @@ -35,6 +43,8 @@ QString toqstr(docstring const & ucs4) { // If possible we let qt do the work, since this version does not // need to be superfast. + if (ucs4.empty()) + return QString(); return QString::fromUcs4((uint const *)ucs4.data(), ucs4.length()); }