Changeset View
Changeset View
Standalone View
Standalone View
src/drivers/sqlite/SqliteCursor.cpp
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Line(s) | 94 | } else if (t == KDbField::Date) { | |||
---|---|---|---|---|---|
95 | return QDate::fromString(text, Qt::ISODate); | 95 | return QDate::fromString(text, Qt::ISODate); | ||
96 | } else if (t == KDbField::Time) { | 96 | } else if (t == KDbField::Time) { | ||
97 | //QDateTime - a hack needed because QVariant(QTime) has broken isNull() | 97 | //QDateTime - a hack needed because QVariant(QTime) has broken isNull() | ||
98 | return KDbUtils::stringToHackedQTime(text); | 98 | return KDbUtils::stringToHackedQTime(text); | ||
99 | } else if (t == KDbField::DateTime) { | 99 | } else if (t == KDbField::DateTime) { | ||
100 | if (text.length() > 10) { | 100 | if (text.length() > 10) { | ||
101 | text[10] = QLatin1Char('T'); //for ISODate compatibility | 101 | text[10] = QLatin1Char('T'); //for ISODate compatibility | ||
102 | } | 102 | } | ||
103 | return QDateTime::fromString(text, Qt::ISODate); | 103 | return QDateTime::fromString(text, Qt::ISODateWithMs); | ||
104 | } else if (t == KDbField::Boolean) { | 104 | } else if (t == KDbField::Boolean) { | ||
105 | return sqliteStringToBool(text); | 105 | return sqliteStringToBool(text); | ||
106 | } else { | 106 | } else { | ||
107 | return QVariant(); //!< @todo | 107 | return QVariant(); //!< @todo | ||
108 | } | 108 | } | ||
109 | } else if (type == SQLITE_INTEGER) { | 109 | } else if (type == SQLITE_INTEGER) { | ||
110 | const KDbField::Type t = f->type(); // cache: evaluating type of expressions can be expensive | 110 | const KDbField::Type t = f->type(); // cache: evaluating type of expressions can be expensive | ||
111 | if (t == KDbField::BigInteger) { | 111 | if (t == KDbField::BigInteger) { | ||
▲ Show 20 Lines • Show All 234 Lines • Show Last 20 Lines |