From d3fd429f82caca02dff71f77df47240def05edb2 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 14 Nov 2023 16:19:26 +0100 Subject: [PATCH] Remove redundant static uint32_t QWaylandDisplay::currentTimeMillisec() Fortunately it was unused. Its 32-bit unsigned return type, measuring time in milliseconds, wraps around every 50 days. If Qt Wayland ever does need to know the current time in milliseconds, I can recommend QDateTime::currentMSecsSinceEpoch(). Change-Id: I03e70e3c7060b1e8fb82fc2e151bb187b6598b96 Reviewed-by: David Edmundson --- src/plugins/platforms/wayland/qwaylanddisplay.cpp | 10 ---------- src/plugins/platforms/wayland/qwaylanddisplay_p.h | 2 -- 2 files changed, 12 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index 4294351449d..c9de9982834 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -858,16 +858,6 @@ void QWaylandDisplay::removeListener(RegistryListener listener, void *data) mRegistryListeners.erase(iter, mRegistryListeners.end()); } -uint32_t QWaylandDisplay::currentTimeMillisec() -{ - //### we throw away the time information - struct timeval tv; - int ret = gettimeofday(&tv, nullptr); - if (ret == 0) - return tv.tv_sec*1000 + tv.tv_usec/1000; - return 0; -} - void QWaylandDisplay::forceRoundTrip() { wl_display_roundtrip(mDisplay); diff --git a/src/plugins/platforms/wayland/qwaylanddisplay_p.h b/src/plugins/platforms/wayland/qwaylanddisplay_p.h index 951a6421794..62ef71bd084 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay_p.h +++ b/src/plugins/platforms/wayland/qwaylanddisplay_p.h @@ -226,8 +226,6 @@ public: QWaylandShm *shm() const { return mShm.data(); } - static uint32_t currentTimeMillisec(); - void forceRoundTrip(); bool supportsWindowDecoration() const;