]> source.dussan.org Git - tigervnc.git/commitdiff
Improved RfbPlayer::updatePos().
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Sun, 6 Feb 2005 07:29:51 +0000 (07:29 +0000)
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Sun, 6 Feb 2005 07:29:51 +0000 (07:29 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@147 3789f03b-4d11-0410-bbf8-ca57d06f2519

rfbplayer/rfbplayer.cxx

index aeb0b1fbe4bd2181187806e49745d614dc96d9c2..6b187117780da7e06216b615ffd9628a69fc7b83 100644 (file)
@@ -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