diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-18 19:00:36 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-03-17 10:54:17 (GMT) |
commit | 0f771c62f5253a969f5a8a81bfd9254b9bd58b8f (patch) | |
tree | 1f5dcfcfc84fd74f7017710478dadacc18de822c /src/gui/kernel/qclipboard_x11.cpp | |
parent | ec5b7ea367389234697a98d7243243ec689be724 (diff) | |
download | Qt-0f771c62f5253a969f5a8a81bfd9254b9bd58b8f.zip Qt-0f771c62f5253a969f5a8a81bfd9254b9bd58b8f.tar.gz Qt-0f771c62f5253a969f5a8a81bfd9254b9bd58b8f.tar.bz2 |
Port QtGui uses of QTime as a stopwatch to QTimestamp
Diffstat (limited to 'src/gui/kernel/qclipboard_x11.cpp')
-rw-r--r-- | src/gui/kernel/qclipboard_x11.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp index 047bd09..2a9706b 100644 --- a/src/gui/kernel/qclipboard_x11.cpp +++ b/src/gui/kernel/qclipboard_x11.cpp @@ -65,7 +65,6 @@ #include "qapplication.h" #include "qdesktopwidget.h" #include "qbitmap.h" -#include "qdatetime.h" #include "qiodevice.h" #include "qbuffer.h" #include "qtextcodec.h" @@ -76,6 +75,7 @@ #include "qt_x11_p.h" #include "qx11info_x11.h" #include "qimagewriter.h" +#include "qtimestamp.h" #include "qvariant.h" #include "qdnd_p.h" #include <private/qwidget_p.h> @@ -516,8 +516,9 @@ static Bool checkForClipboardEvents(Display *, XEvent *e, XPointer) bool QX11Data::clipboardWaitForEvent(Window win, int type, XEvent *event, int timeout) { - QTime started = QTime::currentTime(); - QTime now = started; + QTimestamp started; + started.start(); + QTimestamp now = started; if (QAbstractEventDispatcher::instance()->inherits("QtMotif") || QApplication::clipboard()->property("useEventLoopWhenWaiting").toBool()) { @@ -545,9 +546,7 @@ bool QX11Data::clipboardWaitForEvent(Window win, int type, XEvent *event, int ti XSync(X11->display, false); usleep(50000); - now = QTime::currentTime(); - if (started > now) // crossed midnight - started = now; + now.start(); QEventLoop::ProcessEventsFlags flags(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers @@ -576,9 +575,7 @@ bool QX11Data::clipboardWaitForEvent(Window win, int type, XEvent *event, int ti if (XCheckIfEvent(X11->display, &e, checkForClipboardEvents, 0)) qApp->x11ProcessEvent(&e); - now = QTime::currentTime(); - if ( started > now ) // crossed midnight - started = now; + now.start(); XFlush(X11->display); |