From 4432549cdaa5adfb718585c22fea23f5d002527d Mon Sep 17 00:00:00 2001 From: george82 Date: Sun, 6 Feb 2005 07:29:51 +0000 Subject: [PATCH] Improved RfbPlayer::updatePos(). git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@147 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- rfbplayer/rfbplayer.cxx | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/rfbplayer/rfbplayer.cxx b/rfbplayer/rfbplayer.cxx index aeb0b1fb..6b187117 100644 --- a/rfbplayer/rfbplayer.cxx +++ b/rfbplayer/rfbplayer.cxx @@ -929,25 +929,7 @@ void RfbPlayer::updatePos(long newPos) { char timePos[30] = "\0"; double sliderPos = newPos; newPos /= 1000; - time_pos_m = newPos / 60; - time_pos_s = newPos % 60; - if (time_pos_m < 10) { - strcat(timePos, "0"); - _itoa(time_pos_m, timePos+1, 10); - } else { - _itoa(time_pos_m, timePos, 10); - } - strcat(timePos, "m:"); - if (time_pos_s < 10) { - strcat(timePos, "0"); - _itoa(time_pos_s, timePos+strlen(timePos), 10); - } else { - _itoa(time_pos_s, timePos+strlen(timePos), 10); - } - strcat(timePos, "s "); - strcat(timePos, "("); - strcat(timePos, fullSessionTime); - strcat(timePos, ")"); + sprintf(timePos, "%.2um:%.2us (%s)", newPos/60, newPos%60, fullSessionTime); SetWindowText(timeStatic, timePos); // Update the position of slider -- 2.39.5