summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-08-19 09:52:55 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2010-08-19 09:52:55 (GMT)
commit872ccdcc090cec252cea2109d2fc9f2f2ee4c795 (patch)
tree7b14b977528cb6e833a765afce3c9bf6e55c94af /src/corelib/kernel
parent74d519f87e804b624ac76337fe2905d512d363fc (diff)
parentf6cfafde26b4735965be8df0d11e9d7c297c75b9 (diff)
downloadQt-872ccdcc090cec252cea2109d2fc9f2f2ee4c795.zip
Qt-872ccdcc090cec252cea2109d2fc9f2f2ee4c795.tar.gz
Qt-872ccdcc090cec252cea2109d2fc9f2f2ee4c795.tar.bz2
Merge remote branch 'qt/4.7' into lighthouse-4.7
Conflicts: src/opengl/qgl_p.h
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qbasictimer.cpp7
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp31
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix_p.h4
-rw-r--r--src/corelib/kernel/qmetaobject.cpp5
5 files changed, 25 insertions, 24 deletions
diff --git a/src/corelib/kernel/qbasictimer.cpp b/src/corelib/kernel/qbasictimer.cpp
index d176170..d595ac1 100644
--- a/src/corelib/kernel/qbasictimer.cpp
+++ b/src/corelib/kernel/qbasictimer.cpp
@@ -54,7 +54,8 @@ QT_BEGIN_NAMESPACE
This is a fast, lightweight, and low-level class used by Qt
internally. We recommend using the higher-level QTimer class
rather than this class if you want to use timers in your
- applications.
+ applications. Note that this timer is a repeating timer that
+ will send subsequent timer events unless the stop() function is called.
To use this class, create a QBasicTimer, and call its start()
function with a timeout interval and with a pointer to a QObject
@@ -88,8 +89,8 @@ QT_BEGIN_NAMESPACE
/*!
\fn bool QBasicTimer::isActive() const
- Returns true if the timer is running, has not yet timed
- out, and has not been stopped; otherwise returns false.
+ Returns true if the timer is running and has not been stopped; otherwise
+ returns false.
\sa start() stop()
*/
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 0a5e06e..512e193 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -2308,6 +2308,7 @@ void QCoreApplication::setLibraryPaths(const QStringList &paths)
if (!coreappdata()->app_libpaths)
coreappdata()->app_libpaths = new QStringList;
*(coreappdata()->app_libpaths) = paths;
+ locker.unlock();
QFactoryLoader::refreshAll();
}
@@ -2341,6 +2342,7 @@ void QCoreApplication::addLibraryPath(const QString &path)
if (!canonicalPath.isEmpty()
&& !coreappdata()->app_libpaths->contains(canonicalPath)) {
coreappdata()->app_libpaths->prepend(canonicalPath);
+ locker.unlock();
QFactoryLoader::refreshAll();
}
}
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index 0c336e7..72f3c0e 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -335,7 +335,7 @@ QTimerInfoList::QTimerInfoList()
}
#endif
- firstTimerInfo = currentTimerInfo = 0;
+ firstTimerInfo = 0;
}
timeval QTimerInfoList::updateCurrentTime()
@@ -453,7 +453,7 @@ bool QTimerInfoList::timerWait(timeval &tm)
// Find first waiting timer not already active
QTimerInfo *t = 0;
for (QTimerInfoList::const_iterator it = constBegin(); it != constEnd(); ++it) {
- if (!(*it)->inTimerEvent) {
+ if (!(*it)->activateRef) {
t = *it;
break;
}
@@ -482,7 +482,7 @@ void QTimerInfoList::registerTimer(int timerId, int interval, QObject *object)
t->interval.tv_usec = (interval % 1000) * 1000;
t->timeout = updateCurrentTime() + t->interval;
t->obj = object;
- t->inTimerEvent = false;
+ t->activateRef = 0;
timerInsert(t);
}
@@ -497,8 +497,8 @@ bool QTimerInfoList::unregisterTimer(int timerId)
removeAt(i);
if (t == firstTimerInfo)
firstTimerInfo = 0;
- if (t == currentTimerInfo)
- currentTimerInfo = 0;
+ if (t->activateRef)
+ *(t->activateRef) = 0;
// release the timer id
if (!QObjectPrivate::get(t->obj)->inThreadChangeEvent)
@@ -523,8 +523,8 @@ bool QTimerInfoList::unregisterTimers(QObject *object)
removeAt(i);
if (t == firstTimerInfo)
firstTimerInfo = 0;
- if (t == currentTimerInfo)
- currentTimerInfo = 0;
+ if (t->activateRef)
+ *(t->activateRef) = 0;
// release the timer id
if (!QObjectPrivate::get(t->obj)->inThreadChangeEvent)
@@ -560,10 +560,7 @@ int QTimerInfoList::activateTimers()
bool firstTime = true;
timeval currentTime;
int n_act = 0, maxCount = count();
-
- QTimerInfo *saveFirstTimerInfo = firstTimerInfo;
- QTimerInfo *saveCurrentTimerInfo = currentTimerInfo;
- firstTimerInfo = currentTimerInfo = 0;
+ firstTimerInfo = 0;
while (maxCount--) {
currentTime = updateCurrentTime();
@@ -575,7 +572,7 @@ int QTimerInfoList::activateTimers()
if (isEmpty())
break;
- currentTimerInfo = first();
+ QTimerInfo *currentTimerInfo = first();
if (currentTime < currentTimerInfo->timeout)
break; // no timer has expired
@@ -602,21 +599,19 @@ int QTimerInfoList::activateTimers()
if (currentTimerInfo->interval.tv_usec > 0 || currentTimerInfo->interval.tv_sec > 0)
n_act++;
- if (!currentTimerInfo->inTimerEvent) {
+ if (!currentTimerInfo->activateRef) {
// send event, but don't allow it to recurse
- currentTimerInfo->inTimerEvent = true;
+ currentTimerInfo->activateRef = &currentTimerInfo;
QTimerEvent e(currentTimerInfo->id);
QCoreApplication::sendEvent(currentTimerInfo->obj, &e);
if (currentTimerInfo)
- currentTimerInfo->inTimerEvent = false;
+ currentTimerInfo->activateRef = 0;
}
}
- firstTimerInfo = saveFirstTimerInfo;
- currentTimerInfo = saveCurrentTimerInfo;
-
+ firstTimerInfo = 0;
return n_act;
}
diff --git a/src/corelib/kernel/qeventdispatcher_unix_p.h b/src/corelib/kernel/qeventdispatcher_unix_p.h
index d38acf3..e1b6b1d 100644
--- a/src/corelib/kernel/qeventdispatcher_unix_p.h
+++ b/src/corelib/kernel/qeventdispatcher_unix_p.h
@@ -77,7 +77,7 @@ struct QTimerInfo {
timeval interval; // - timer interval
timeval timeout; // - when to sent event
QObject *obj; // - object to receive event
- bool inTimerEvent;
+ QTimerInfo **activateRef; // - ref from activateTimers
};
class QTimerInfoList : public QList<QTimerInfo*>
@@ -92,7 +92,7 @@ class QTimerInfoList : public QList<QTimerInfo*>
#endif
// state variables used by activateTimers()
- QTimerInfo *firstTimerInfo, *currentTimerInfo;
+ QTimerInfo *firstTimerInfo;
public:
QTimerInfoList();
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 79a38cd..9854e68 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1009,8 +1009,11 @@ QByteArray QMetaObject::normalizedSignature(const char *method)
int argdepth = 0;
int templdepth = 0;
while (*d) {
- if (argdepth == 1)
+ if (argdepth == 1) {
d = qNormalizeType(d, templdepth, result);
+ if (!*d) //most likely an invalid signature.
+ break;
+ }
if (*d == '(')
++argdepth;
if (*d == ')')