[gimp/gimp-2-10] app: don't use the deprecated GTimeVal in file-remote.c
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: don't use the deprecated GTimeVal in file-remote.c
- Date: Sat, 26 Oct 2019 19:35:12 +0000 (UTC)
commit 7caeb46e65bee61c0b42544989d0ca6d4c2162e6
Author: Michael Natterer <mitch gimp org>
Date: Sat Sep 14 12:22:04 2019 +0200
app: don't use the deprecated GTimeVal in file-remote.c
Use g_get_monotonic_time() instead.
(cherry picked from commit 3f84fbee1e0186b3fc4b84029413bda52c7450c3)
app/file/file-remote.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/app/file/file-remote.c b/app/file/file-remote.c
index 92d2931686..498115afe0 100644
--- a/app/file/file-remote.c
+++ b/app/file/file-remote.c
@@ -61,7 +61,7 @@ typedef struct
GimpProgress *progress;
GCancellable *cancellable;
gboolean cancel;
- GTimeVal last_time;
+ gint64 last_time;
} RemoteProgress;
@@ -333,14 +333,12 @@ file_remote_progress_callback (goffset current_num_bytes,
gpointer user_data)
{
RemoteProgress *progress = user_data;
- GTimeVal now;
+ gint64 now;
/* update the progress only up to 10 times a second */
- g_get_current_time (&now);
+ now = g_get_monotonic_time ();
- if (progress->last_time.tv_sec &&
- ((now.tv_sec - progress->last_time.tv_sec) * 1000 +
- (now.tv_usec - progress->last_time.tv_usec) / 1000) < 100)
+ if ((now - progress->last_time) / 1000 < 100)
return;
progress->last_time = now;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]