From 8ffecc252dba12e7208ea25c654e198151217dd7 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 25 Mar 2011 17:45:43 +0200 Subject: Add --hxx-prologue to qt options for new traits --- odb/qt.options | 3 +++ odb/qt/mysql/qdatetime-traits.hxx | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/odb/qt.options b/odb/qt.options index bafd94e..bb51aab 100644 --- a/odb/qt.options +++ b/odb/qt.options @@ -7,3 +7,6 @@ --odb-epilogue '#include ' --hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' +--hxx-prologue '#include ' \ No newline at end of file diff --git a/odb/qt/mysql/qdatetime-traits.hxx b/odb/qt/mysql/qdatetime-traits.hxx index 2ed8139..75cb05e 100644 --- a/odb/qt/mysql/qdatetime-traits.hxx +++ b/odb/qt/mysql/qdatetime-traits.hxx @@ -41,16 +41,16 @@ namespace odb static void set_image (MYSQL_TIME& i, bool& is_null, const QDateTime& v) { - if (v.is_null ()) + if (v.isNull ()) is_null = true; else { is_null = false; const QDate& d (v.date ()); - i.year = d.year; - i.month = d.month; - i.day = d.day; + i.year = d.year (); + i.month = d.month (); + i.day = d.day (); const QTime& t (v.time ()); i.hour = t.hour (); @@ -60,6 +60,7 @@ namespace odb } }; + template <> class default_value_traits { public: @@ -77,23 +78,23 @@ namespace odb else { v.setDate (QDate (i.year, i.month, i.day)); - v.setDate (QTime (i.hour, i.minute, i.second)); + v.setTime (QTime (i.hour, i.minute, i.second)); } } static void set_image (MYSQL_TIME& i, bool& is_null, const QDateTime& v) { - if (v.is_null ()) + if (v.isNull ()) is_null = true; else { is_null = false; const QDate& d (v.date ()); - i.year = d.year; - i.month = d.month; - i.day = d.day; + i.year = d.year (); + i.month = d.month (); + i.day = d.day (); const QTime& t (v.time ()); i.hour = t.hour (); -- cgit v1.1