From 80d463a721ce9191efdada8f1b041baea1af1643 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Wed, 6 Jul 2016 23:16:48 +0200 Subject: all: don't use deprecated GMutex/GThread API Also, threads area always enabled, so we can remove the G_THREADS_ENABLED conditionals. Require GLib 2.31 for this. taken from: https://git.gnome.org/browse/nautilus/commit/?h=gnome-3-4&id=0594aa1 Note, this fixes a Wimplicit-function-declaration warning in caja-search-engine-simple --- libcaja-private/caja-file-operations.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'libcaja-private/caja-file-operations.c') diff --git a/libcaja-private/caja-file-operations.c b/libcaja-private/caja-file-operations.c index e310de1f..534b3b9f 100644 --- a/libcaja-private/caja-file-operations.c +++ b/libcaja-private/caja-file-operations.c @@ -176,8 +176,7 @@ typedef struct { } TransferInfo; #define SECONDS_NEEDED_FOR_RELIABLE_TRANSFER_RATE 15 -#define NSEC_PER_SEC 1000000000 -#define NSEC_PER_MSEC 1000000 +#define NSEC_PER_MICROSEC 1000 #define MAXIMUM_DISPLAYED_FILE_NAME_LENGTH 50 @@ -1405,12 +1404,12 @@ report_delete_progress (CommonJob *job, int files_left; double elapsed, transfer_rate; int remaining_time; - guint64 now; + gint64 now; char *files_left_s; - now = g_get_monotonic_time () * 1000; + now = g_get_monotonic_time (); if (transfer_info->last_report_time != 0 && - ABS ((gint64)(transfer_info->last_report_time - now)) < 100 * NSEC_PER_MSEC) { + ABS ((gint64)(transfer_info->last_report_time - now)) < 100 * NSEC_PER_MICROSEC) { return; } transfer_info->last_report_time = now; @@ -2878,10 +2877,10 @@ report_copy_progress (CopyMoveJob *copy_job, is_move = copy_job->is_move; - now = g_get_monotonic_time () * 1000; + now = g_get_monotonic_time (); if (transfer_info->last_report_time != 0 && - ABS ((gint64)(transfer_info->last_report_time - now)) < 100 * NSEC_PER_MSEC) { + ABS ((gint64)(transfer_info->last_report_time - now)) < 100 * NSEC_PER_MICROSEC) { return; } transfer_info->last_report_time = now; -- cgit v1.2.1