diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2014-02-01 06:53:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2014-02-01 06:53:03 +0200 |
commit | 1039d51ecde835ef842a6596083e771f7f367fc7 (patch) | |
tree | b7fc158dfe49ecfb0875766a9662274bbdf18dc8 | |
parent | 4d9bde105203653492573d6d52b307c3ce42419b (diff) |
Don't use toStdString() since it may not be available
-rw-r--r-- | odb/qt/date-time/sqlite/qdate-time-traits.hxx | 5 | ||||
-rw-r--r-- | odb/qt/date-time/sqlite/qdate-traits.hxx | 5 | ||||
-rw-r--r-- | odb/qt/date-time/sqlite/qtime-traits.hxx | 6 |
3 files changed, 13 insertions, 3 deletions
diff --git a/odb/qt/date-time/sqlite/qdate-time-traits.hxx b/odb/qt/date-time/sqlite/qdate-time-traits.hxx index c62d513..5c9511f 100644 --- a/odb/qt/date-time/sqlite/qdate-time-traits.hxx +++ b/odb/qt/date-time/sqlite/qdate-time-traits.hxx @@ -56,8 +56,11 @@ namespace odb { is_null = false; + // Cannot use toStdString() here since Qt could have been + // configured without the STL compatibility support. + // std::string s ( - v.toString ("yyyy-MM-ddTHH:mm:ss.zzz").toStdString ()); + v.toString ("yyyy-MM-ddTHH:mm:ss.zzz").toLatin1 ().constData ()); n = s.size (); if (n > i.capacity ()) diff --git a/odb/qt/date-time/sqlite/qdate-traits.hxx b/odb/qt/date-time/sqlite/qdate-traits.hxx index 80879a7..b1d03d0 100644 --- a/odb/qt/date-time/sqlite/qdate-traits.hxx +++ b/odb/qt/date-time/sqlite/qdate-traits.hxx @@ -57,7 +57,10 @@ namespace odb { is_null = false; - std::string s (v.toString ("yyyy-MM-dd").toStdString ()); + // Cannot use toStdString() here since Qt could have been + // configured without the STL compatibility support. + // + std::string s (v.toString ("yyyy-MM-dd").toLatin1 ().constData ()); n = s.size (); if (n > i.capacity ()) diff --git a/odb/qt/date-time/sqlite/qtime-traits.hxx b/odb/qt/date-time/sqlite/qtime-traits.hxx index 391df35..ad64ab5 100644 --- a/odb/qt/date-time/sqlite/qtime-traits.hxx +++ b/odb/qt/date-time/sqlite/qtime-traits.hxx @@ -57,7 +57,11 @@ namespace odb { is_null = false; - std::string s (v.toString ("HH:mm:ss.zzz").toStdString ()); + // Cannot use toStdString() here since Qt could have been + // configured without the STL compatibility support. + // + std::string s ( + v.toString ("HH:mm:ss.zzz").toLatin1 ().constData ()); n = s.size (); if (n > i.capacity ()) |