From: george82 Date: Sun, 6 Feb 2005 07:29:51 +0000 (+0000) Subject: Improved RfbPlayer::updatePos(). X-Git-Tag: v0.0.90~384^2~688 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4432549cdaa5adfb718585c22fea23f5d002527d;p=tigervnc.git Improved RfbPlayer::updatePos(). git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@147 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- 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