diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-01 15:38:43 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-01 15:38:43 (GMT) |
commit | e9ab8493053a7dd56cde058e736f46feafb378d0 (patch) | |
tree | a4222a567646a7661b76b62dac6675e6a5b86f23 | |
parent | 06db44a5d521fe6238e39c9846f7cb2d43b43eb0 (diff) | |
parent | f8d71ee8c5f29eabb759ff4b0d5c8a153023a254 (diff) | |
download | Qt-e9ab8493053a7dd56cde058e736f46feafb378d0.zip Qt-e9ab8493053a7dd56cde058e736f46feafb378d0.tar.gz Qt-e9ab8493053a7dd56cde058e736f46feafb378d0.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
QDeclarative: Fix QPerformanceTimer on Symbian
-rw-r--r-- | src/declarative/declarative.pro | 2 | ||||
-rw-r--r-- | src/declarative/qml/qperformancetimer.cpp | 55 |
2 files changed, 29 insertions, 28 deletions
diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro index f3a7db9..27ceaf0 100644 --- a/src/declarative/declarative.pro +++ b/src/declarative/declarative.pro @@ -26,7 +26,7 @@ include(debugger/debugger.pri) symbian: { TARGET.UID3=0x2001E623 - LIBS += -lefsrv + LIBS += -lefsrv -lhal } linux-g++-maemo:DEFINES += QDECLARATIVEVIEW_NOBACKGROUND diff --git a/src/declarative/qml/qperformancetimer.cpp b/src/declarative/qml/qperformancetimer.cpp index f249798..9d76b26 100644 --- a/src/declarative/qml/qperformancetimer.cpp +++ b/src/declarative/qml/qperformancetimer.cpp @@ -45,14 +45,15 @@ #include <sys/time.h> #include <unistd.h> #include <mach/mach_time.h> -#elif defined(Q_OS_UNIX) -#include <sys/time.h> -#include <time.h> -#include <unistd.h> #elif defined(Q_OS_SYMBIAN) #include <e32std.h> #include <sys/time.h> #include <hal.h> +#include <hal_data.h> +#elif defined(Q_OS_UNIX) +#include <sys/time.h> +#include <time.h> +#include <unistd.h> #elif defined(Q_OS_WIN) #include <windows.h> #endif @@ -84,6 +85,29 @@ qint64 QPerformanceTimer::elapsed() const return absoluteToNSecs(cpu_time - t1); } +////////////////////////////// Symbian ////////////////////////////// +#elif defined(Q_OS_SYMBIAN) + +static qint64 getTimeFromTick(quint64 elapsed) +{ + static TInt freq = 0; + if (!freq) + HAL::Get(HALData::EFastCounterFrequency, freq); + + return (elapsed * 1000000000) / freq; +} + +void QPerformanceTimer::start() +{ + t1 = User::FastCounter(); +} + +qint64 QPerformanceTimer::elapsed() const +{ + return getTimeFromTick(User::FastCounter() - t1); +} + + ////////////////////////////// Unix ////////////////////////////// #elif defined(Q_OS_UNIX) @@ -158,29 +182,6 @@ qint64 QPerformanceTimer::elapsed() const return sec * Q_INT64_C(1000000000) + frac; } -////////////////////////////// Symbian ////////////////////////////// -#elif defined(Q_OS_SYMBIAN) - -static qint64 getTimeFromTick(quint64 elapsed) -{ - static TInt freq; - if (!freq) - HAL::Get(HALData::EFastCounterFrequency, freq); - - // ### not sure on units - return elapsed / freq; -} - -void QPerformanceTimer::start() -{ - t1 = User::FastCounter(); -} - -qint64 QPerformanceTimer::elapsed() const -{ - return getTimeFromTick(User::FastCounter() - t1); -} - ////////////////////////////// Windows ////////////////////////////// #elif defined(Q_OS_WIN) |