From cd1f97695be1245ab19058d4fbc34e5697cc5383 Mon Sep 17 00:00:00 2001 From: Robert Xu Date: Sat, 12 Nov 2011 18:13:39 -0500 Subject: fix up tdebase and add qt3 --- opensuse/core/qt3/qtimer-debug.diff | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 opensuse/core/qt3/qtimer-debug.diff (limited to 'opensuse/core/qt3/qtimer-debug.diff') diff --git a/opensuse/core/qt3/qtimer-debug.diff b/opensuse/core/qt3/qtimer-debug.diff new file mode 100644 index 000000000..5511f2a16 --- /dev/null +++ b/opensuse/core/qt3/qtimer-debug.diff @@ -0,0 +1,48 @@ +--- src/kernel/qeventloop_unix.cpp ++++ src/kernel/qeventloop_unix.cpp +@@ -514,6 +528,17 @@ + return (tm->tv_sec*1000) + (tm->tv_usec/1000); + } + ++static QString fullName(QObject* obj) ++{ ++ QString oname; ++ if (obj && obj->name()) ++ oname = QString(obj->name()) + "(" + QString(obj->className()) + ")"; ++ ++ if (obj && obj->parent()) ++ return fullName(obj->parent()) + "/" + oname; ++ return oname; ++} ++ + int QEventLoop::activateTimers() + { + if ( !timerList || !timerList->count() ) // no timers +@@ -549,9 +574,27 @@ + t->timeout += t->interval; + if ( t->timeout < currentTime ) + t->timeout = currentTime + t->interval; ++ // prefer system clock ticks for low resolution timers ++ // to save cpu power ++ if (t->interval.tv_sec * 1000 + t->interval.tv_usec / 1000 >= 1000) { ++ timeval drift; ++ drift.tv_sec = 0; ++ drift.tv_usec = (t->interval.tv_usec / 8) + (t->interval.tv_sec % 8) * 1000 * 1000 / 8; ++ timeval synced = t->timeout + drift; ++ if (synced.tv_usec < 2 * drift.tv_usec) ++ synced.tv_usec = 0; ++ t->timeout = synced; ++ } + insertTimer( t ); // relink timer + if ( t->interval.tv_usec > 0 || t->interval.tv_sec > 0 ) + n_act++; ++ ++ if (t->obj && getenv("QT_DEBUG_TIMER")) ++ qDebug("qtimer: %ld/%s %d ms for %p/%s %s", ++ getpid(), qApp && qApp->name() ? qApp->name() : "", ++ t->interval.tv_sec * 1000 + t->interval.tv_usec / 1000, ++ t->obj, fullName(t->obj).latin1(), t->obj->className()); ++ + QTimerEvent e( t->id ); + QApplication::sendEvent( t->obj, &e ); // send event + if ( timerList->findRef( begin ) == -1 ) -- cgit v1.2.3 From 27c9e783c6283f8916ebee3a23c6d1ba909a5126 Mon Sep 17 00:00:00 2001 From: Robert Xu Date: Sat, 19 Nov 2011 19:30:53 -0500 Subject: Thanks to Andrea Cascio for getting Qt3 3.3.8d building! --- opensuse/core/qt3/qtimer-debug.diff | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'opensuse/core/qt3/qtimer-debug.diff') diff --git a/opensuse/core/qt3/qtimer-debug.diff b/opensuse/core/qt3/qtimer-debug.diff index 5511f2a16..65db5f4f6 100644 --- a/opensuse/core/qt3/qtimer-debug.diff +++ b/opensuse/core/qt3/qtimer-debug.diff @@ -1,6 +1,6 @@ --- src/kernel/qeventloop_unix.cpp +++ src/kernel/qeventloop_unix.cpp -@@ -514,6 +528,17 @@ +@@ -517,6 +531,17 @@ return (tm->tv_sec*1000) + (tm->tv_usec/1000); } @@ -18,7 +18,7 @@ int QEventLoop::activateTimers() { if ( !timerList || !timerList->count() ) // no timers -@@ -549,9 +574,27 @@ +@@ -552,9 +577,27 @@ t->timeout += t->interval; if ( t->timeout < currentTime ) t->timeout = currentTime + t->interval; -- cgit v1.2.3