summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-02-19 16:04:55 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-03-17 10:54:18 (GMT)
commite0c97f943e80488c7e674075d40a27822b7e8c78 (patch)
tree94c8f352214c5a20ea779568a76798d3280d7508 /src/corelib/tools
parent500b55813c591c35a63d76cb0f6809578c9ec053 (diff)
downloadQt-e0c97f943e80488c7e674075d40a27822b7e8c78.zip
Qt-e0c97f943e80488c7e674075d40a27822b7e8c78.tar.gz
Qt-e0c97f943e80488c7e674075d40a27822b7e8c78.tar.bz2
Remove unnecessary functions from the QTimestamp API.
If necesary, we can add them back later. But let's not add functions we don't need right now.
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qtimestamp.h13
-rw-r--r--src/corelib/tools/qtimestamp_generic.cpp10
-rw-r--r--src/corelib/tools/qtimestamp_mac.cpp17
-rw-r--r--src/corelib/tools/qtimestamp_symbian.cpp11
-rw-r--r--src/corelib/tools/qtimestamp_unix.cpp11
-rw-r--r--src/corelib/tools/qtimestamp_win.cpp14
6 files changed, 0 insertions, 76 deletions
diff --git a/src/corelib/tools/qtimestamp.h b/src/corelib/tools/qtimestamp.h
index 1e913f0..de87ad8 100644
--- a/src/corelib/tools/qtimestamp.h
+++ b/src/corelib/tools/qtimestamp.h
@@ -64,9 +64,7 @@ public:
bool hasExpired(qint64 timeout) const;
qint64 msecsTo(const QTimestamp &other) const;
- void addMSecs(int ms);
qint64 secsTo(const QTimestamp &other) const;
- void addSecs(int secs);
bool operator==(const QTimestamp &other) const
{ return t1 == other.t1 && t2 == other.t2; }
@@ -74,17 +72,6 @@ public:
{ return !(*this == other); }
friend bool Q_CORE_EXPORT operator<(const QTimestamp &v1, const QTimestamp &v2);
- friend qint64 operator-(const QTimestamp &v1, const QTimestamp &v2)
- { return v2.msecsTo(v1); }
-
- friend QTimestamp &operator+=(QTimestamp &ts, qint64 ms)
- { ts.addMSecs(ms); return ts; }
- friend QTimestamp operator+(const QTimestamp &ts, qint64 ms)
- { QTimestamp copy(ts); return copy += ms; }
- friend QTimestamp &operator-=(QTimestamp &ts, qint64 ms)
- { ts.addMSecs(-ms); return ts; }
- friend QTimestamp operator-(const QTimestamp &ts, qint64 ms)
- { QTimestamp copy(ts); return copy -= ms; }
private:
qint64 t1;
diff --git a/src/corelib/tools/qtimestamp_generic.cpp b/src/corelib/tools/qtimestamp_generic.cpp
index 9930932..c80ac34 100644
--- a/src/corelib/tools/qtimestamp_generic.cpp
+++ b/src/corelib/tools/qtimestamp_generic.cpp
@@ -78,21 +78,11 @@ qint64 QTimestamp::msecsTo(const QTimestamp &other) const
return diff;
}
-void QTimestamp::addMSecs(int ms)
-{
- t1 += ms;
-}
-
qint64 QTimestamp::secsTo(const QTimestamp &other) const
{
return msecsTo(other) / 1000;
}
-void QTimestamp::addSecs(int secs)
-{
- t1 += secs * 1000;
-}
-
bool operator<(const QTimestamp &v1, const QTimestamp &v2)
{
return v1.t1 < v2.t1;
diff --git a/src/corelib/tools/qtimestamp_mac.cpp b/src/corelib/tools/qtimestamp_mac.cpp
index a80e7ee..02f0fa7 100644
--- a/src/corelib/tools/qtimestamp_mac.cpp
+++ b/src/corelib/tools/qtimestamp_mac.cpp
@@ -66,13 +66,6 @@ static qint64 absoluteToMSecs(qint64 cpuTime)
return absoluteToNSecs(cpuTime) / 1000000;
}
-static qint64 msecsToAbsolute(qint64 ms)
-{
- if (info.denom == 0)
- mach_timebase_info(&info);
- return ms * 1000000 * info.denom / info.numer;
-}
-
timeval qt_gettime()
{
timeval tv;
@@ -109,21 +102,11 @@ qint64 QTimestamp::msecsTo(const QTimestamp &other) const
return absoluteToMSecs(other.t1 - t1);
}
-void QTimestamp::addMSecs(int ms)
-{
- t1 += msecsToAbsolute(ms);
-}
-
qint64 QTimestamp::secsTo(const QTimestamp &other) const
{
return msecsTo(other) / 1000;
}
-void QTimestamp::addSecs(int secs)
-{
- t1 += msecsToAbsolute(secs * 1000);
-}
-
bool operator<(const QTimestamp &v1, const QTimestamp &v2)
{
return v1.t1 < v2.t1;
diff --git a/src/corelib/tools/qtimestamp_symbian.cpp b/src/corelib/tools/qtimestamp_symbian.cpp
index e78597c..1d7b6ff 100644
--- a/src/corelib/tools/qtimestamp_symbian.cpp
+++ b/src/corelib/tools/qtimestamp_symbian.cpp
@@ -93,22 +93,11 @@ qint64 QTimestamp::msecsTo(const QTimestamp &other) const
return difference(other.t1, t1);
}
-void QTimestamp::addMSecs(int ms)
-{
- // simulate a 32-bit rollover
- t1 = quint32(t1 + ms);
-}
-
qint64 QTimestamp::secsTo(const QTimestamp &other) const
{
return msecsTo(other) / 1000;
}
-void QTimestamp::addSecs(int secs)
-{
- addMSecs(secs * 1000);
-}
-
bool operator<(const QTimestamp &v1, const QTimestamp &v2)
{
return difference(v1.t1, v2.t1) < 0;
diff --git a/src/corelib/tools/qtimestamp_unix.cpp b/src/corelib/tools/qtimestamp_unix.cpp
index 75371e7..507c861 100644
--- a/src/corelib/tools/qtimestamp_unix.cpp
+++ b/src/corelib/tools/qtimestamp_unix.cpp
@@ -156,22 +156,11 @@ qint64 QTimestamp::msecsTo(const QTimestamp &other) const
return secs * 1000 + fraction / fractionAdjustment();
}
-void QTimestamp::addMSecs(int ms)
-{
- t1 += ms / 1000;
- t2 += ms % 1000 * fractionAdjustment();
-}
-
qint64 QTimestamp::secsTo(const QTimestamp &other) const
{
return other.t1 - t1;
}
-void QTimestamp::addSecs(int secs)
-{
- t1 += secs;
-}
-
bool operator<(const QTimestamp &v1, const QTimestamp &v2)
{
return v1.t1 < v2.t1 || (v1.t1 == v2.t1 && v1.t2 < v2.t2);
diff --git a/src/corelib/tools/qtimestamp_win.cpp b/src/corelib/tools/qtimestamp_win.cpp
index 34bf7a7..1aea5cf 100644
--- a/src/corelib/tools/qtimestamp_win.cpp
+++ b/src/corelib/tools/qtimestamp_win.cpp
@@ -116,25 +116,11 @@ qint64 QTimestamp::msecsTo(const QTimestamp &other) const
return difference(other.t1, t1);
}
-void QTimestamp::addMSecs(int ms)
-{
- t1 += ms;
-
- // do we need to simulate rolling over?
- if (!ptrGetTickCount64)
- t1 = quint32(t1);
-}
-
qint64 QTimestamp::secsTo(const QTimestamp &other) const
{
return msecsTo(other) / 1000;
}
-void QTimestamp::addSecs(int secs)
-{
- addMSecs(secs * 1000);
-}
-
bool operator<(const QTimestamp &v1, const QTimestamp &v2)
{
return difference(v1.t1, v2.t1) < 0;