Update of /cvsroot/wpdev/wolfpack/unix
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13940/unix
Modified Files:
console_unix.cpp
Log Message:
0000309
Index: console_unix.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/unix/console_unix.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** console_unix.cpp 4 Sep 2004 15:19:39 -0000 1.13
--- console_unix.cpp 14 Sep 2004 18:05:16 -0000 1.14
***************
*** 223,226 ****
--- 223,236 ----
}
+ void cConsole::rollbackChars(unsigned int count) {
+ for (int i = 0; i < count; ++i) {
+ fprintf( stdout, "\b" );
+ }
+ fflush(stdout);
+
+ // Remove from the end of the linebuffer
+ linebuffer_.truncate(linebuffer_.length() - count);
+ }
+
//========================================================================================
// Send a message to the console
***************
*** 236,243 ****
QString temp = progress;
progress = QString::null;
! for ( uint i = 0; i < temp.length() + 4; ++i )
! {
! fprintf( stdout, "\b" );
! }
progress = temp;
}
--- 246,250 ----
QString temp = progress;
progress = QString::null;
! rollbackChars(temp.length() + 4);
progress = temp;
}
***************
*** 246,264 ****
fflush( stdout );
! if ( sMessage.contains( "\n" ) )
! {
! incompleteLine_.append( sMessage ); // Split by \n
! QStringList lines = QStringList::split( "\n", incompleteLine_, true );
!
! // Insert all except the last element
! for ( uint i = 0; i < lines.count() - 1; ++i )
! linebuffer_.push_back( lines[i] );
!
! incompleteLine_ = lines[lines.count() - 1];
! }
! else
! {
! incompleteLine_.append( sMessage );
! }
// Resend the Progress message if neccesary.
--- 253,257 ----
fflush( stdout );
! linebuffer_.append(sMessage);
// Resend the Progress message if neccesary.
|