summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qdatetime.cpp10
-rw-r--r--src/corelib/tools/qdatetime_p.h2
2 files changed, 5 insertions, 7 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 6ab4e3a118..6b3c2f9c26 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -2577,10 +2577,10 @@ QPair<QDate, QTime> QDateTimePrivate::getDateTime() const
QPair<QDate, QTime> result;
msecsToTime(m_msecs, &result.first, &result.second);
- if (isNullDate())
+ if (!isValidDate())
result.first = QDate();
- if (isNullTime())
+ if (!isValidTime())
result.second = QTime();
return result;
@@ -2979,7 +2979,7 @@ QDateTime &QDateTime::operator=(const QDateTime &other)
bool QDateTime::isNull() const
{
- return d->isNullDate() && d->isNullTime();
+ return !d->isValidDate() && !d->isValidTime();
}
/*!
@@ -3007,7 +3007,7 @@ bool QDateTime::isValid() const
QDate QDateTime::date() const
{
- if (d->isNullDate())
+ if (!d->isValidDate())
return QDate();
QDate dt;
msecsToTime(d->m_msecs, &dt, 0);
@@ -3022,7 +3022,7 @@ QDate QDateTime::date() const
QTime QDateTime::time() const
{
- if (d->isNullTime())
+ if (!d->isValidTime())
return QTime();
QTime tm;
msecsToTime(d->m_msecs, 0, &tm);
diff --git a/src/corelib/tools/qdatetime_p.h b/src/corelib/tools/qdatetime_p.h
index 3c9d453977..99a1e648e1 100644
--- a/src/corelib/tools/qdatetime_p.h
+++ b/src/corelib/tools/qdatetime_p.h
@@ -139,8 +139,6 @@ public:
void refreshDateTime();
// Get/set date and time status
- inline bool isNullDate() const { return !(m_status & ValidDate); }
- inline bool isNullTime() const { return !(m_status & ValidTime); }
inline bool isValidDate() const { return m_status & ValidDate; }
inline bool isValidTime() const { return m_status & ValidTime; }
inline bool isValidDateTime() const { return m_status & ValidDateTime; }