Bug #: 3828
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jul 2005 08:04:50 +0000 (08:04 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jul 2005 08:04:50 +0000 (08:04 +0000)
Submitted by: eseidel
Reviewed by: mjs
        * kwq/KWQDateTime.h: Necessary KDOM additions.
        (QTime::currentTime): Added.
        * kwq/KWQDateTime.mm:
        (QTime::addMSecs): Added.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=3828

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9586 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/kwq/KWQDateTime.h
WebCore/kwq/KWQDateTime.mm

index c170bd03636bb197815c14aac63fdac8018ef7d7..2e1ad344d8f8136a02d14cc5989f11212038e1ed 100644 (file)
@@ -1,3 +1,13 @@
+2005-07-05  Eric Seidel  <eseidel@apple.com>
+
+        Reviewed by mjs.
+
+        * kwq/KWQDateTime.h: Necessary KDOM additions.
+        (QTime::currentTime): Added.
+        * kwq/KWQDateTime.mm:
+        (QTime::addMSecs): Added.
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=3828
+
 2005-07-05  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by mjs.
index 8fde1a68ae863b4f8f8680bdd9c788433ca7ba34..0b3c491ae6de230b4471b1c7d40aec7f4f97250e 100644 (file)
@@ -40,10 +40,14 @@ public:
     QTime(int hours, int minutes);
 
     int msec() const;
+    QTime addMSecs(int msecs) const;
+    
     void start() { timeInSeconds = CFAbsoluteTimeGetCurrent(); }
     int elapsed() const;
     int restart();
     
+    static QTime currentTime() { return QTime(CFAbsoluteTimeGetCurrent()); }
+    
 private:
     CFAbsoluteTime timeInSeconds; 
     
index 520cd3640bc2fef61d0243a125fafca187c662d3..bbf63bf404f6d0a245ac703344c6e90147704e82 100644 (file)
@@ -52,6 +52,13 @@ int QTime::msec() const
     return (int)(seconds * 1000) % 1000;
 }
 
+QTime QTime::addMSecs(int msecs) const
+{
+    QTime newTime(*this);
+    newTime.timeInSeconds += ((double)msecs)/1000.0;
+    return newTime;
+}
+
 int QTime::elapsed() const
 {
     CFTimeInterval elapsed = CFAbsoluteTimeGetCurrent() - timeInSeconds;