summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qeventdispatcher_blackberry.cpp31
-rw-r--r--src/corelib/kernel/qmetaobject.cpp2
-rw-r--r--src/corelib/kernel/qmetatype.cpp1
3 files changed, 23 insertions, 11 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_blackberry.cpp b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
index 69b4a8b172..3e958ee277 100644
--- a/src/corelib/kernel/qeventdispatcher_blackberry.cpp
+++ b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
@@ -271,6 +271,11 @@ void QEventDispatcherBlackberry::unregisterSocketNotifier(QSocketNotifier *notif
}
}
+static inline int timevalToMillisecs(const timeval &tv)
+{
+ return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
+}
+
int QEventDispatcherBlackberry::select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
timeval *timeout)
{
@@ -279,9 +284,6 @@ int QEventDispatcherBlackberry::select(int nfds, fd_set *readfds, fd_set *writef
BpsChannelScopeSwitcher channelSwitcher(d->bps_channel);
- // Make a note of the start time
- timeval startTime = qt_gettime();
-
// prepare file sets for bps callback
d->ioData->count = 0;
d->ioData->readfds = readfds;
@@ -298,15 +300,15 @@ int QEventDispatcherBlackberry::select(int nfds, fd_set *readfds, fd_set *writef
if (exceptfds)
FD_ZERO(exceptfds);
+ bps_event_t *event = 0;
+ unsigned int eventCount = 0;
+
// Convert timeout to milliseconds
int timeoutTotal = -1;
if (timeout)
- timeoutTotal = (timeout->tv_sec * 1000) + (timeout->tv_usec / 1000);
-
+ timeoutTotal = timevalToMillisecs(*timeout);
int timeoutLeft = timeoutTotal;
-
- bps_event_t *event = 0;
- unsigned int eventCount = 0;
+ timeval startTime = qt_gettime();
// This loop exists such that we can drain the bps event queue of all native events
// more efficiently than if we were to return control to Qt after each event. This
@@ -331,11 +333,20 @@ int QEventDispatcherBlackberry::select(int nfds, fd_set *readfds, fd_set *writef
// Clock source is monotonic, so we can recalculate how much timeout is left
if (timeoutTotal != -1) {
timeval t2 = qt_gettime();
- timeoutLeft = timeoutTotal - ((t2.tv_sec * 1000 + t2.tv_usec / 1000)
- - (startTime.tv_sec * 1000 + startTime.tv_usec / 1000));
+ timeoutLeft = timeoutTotal
+ - (timevalToMillisecs(t2) - timevalToMillisecs(startTime));
if (timeoutLeft < 0)
timeoutLeft = 0;
}
+
+ timeval tnext;
+ if (d->timerList.timerWait(tnext)) {
+ int timeoutNext = timevalToMillisecs(tnext);
+ if (timeoutNext < timeoutLeft || timeoutTotal == -1) {
+ timeoutTotal = timeoutLeft = timeoutNext;
+ startTime = qt_gettime();
+ }
+ }
}
// Wait for event or file to be ready
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 3616d0e825..b9bd74c2bd 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -472,7 +472,7 @@ int QMetaObject::constructorCount() const
/*!
Returns the number of methods in this class, including the number of
- properties provided by each base class. These include signals and slots
+ methods provided by each base class. These include signals and slots
as well as normal member functions.
Use code like the following to obtain a QStringList containing the methods
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 8a04b06c42..82b6ed54d1 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -240,6 +240,7 @@ struct DefinedTypesFilter {
\omitvalue PointerToQObject
\omitvalue WeakPointerToQObject
\omitvalue TrackingPointerToQObject
+ \omitvalue WasDeclaredAsMetaType
*/
/*!