summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-file-operations.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-07-06 23:16:48 +0200
committerraveit65 <[email protected]>2016-07-11 12:53:14 +0200
commit80d463a721ce9191efdada8f1b041baea1af1643 (patch)
tree697e5c281256716e2526260655a2910e3f515da7 /libcaja-private/caja-file-operations.c
parentd866d7a3a5b778cbd413eaa67ad69c80e9277c6b (diff)
downloadcaja-80d463a721ce9191efdada8f1b041baea1af1643.tar.bz2
caja-80d463a721ce9191efdada8f1b041baea1af1643.tar.xz
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
Diffstat (limited to 'libcaja-private/caja-file-operations.c')
-rw-r--r--libcaja-private/caja-file-operations.c13
1 files changed, 6 insertions, 7 deletions
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;