[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdepim/kmail
From:       Marc Mutz <Marc.Mutz () uni-bielefeld ! de>
Date:       2003-01-19 17:57:23
[Download RAW message or body]

CVS commit by mutz: 

code beautification


  M +8 -11     khtmlparthtmlwriter.cpp   1.4


--- kdepim/kmail/khtmlparthtmlwriter.cpp  #1.3:1.4
@@ -59,9 +59,7 @@ namespace KMail {
 
   void KHtmlPartHtmlWriter::queue( const QString & str ) {
-    uint pos = 0;
-    while ( str.length() > pos ) {
-      mHtmlQueue += str.mid( pos, 16384 );
-      pos += 16384;
-    }
+    static const uint chunksize = 16384;
+    for ( uint pos = 0 ; pos < str.length() ; pos += chunksize )
+      mHtmlQueue.push_back( str.mid( pos, chunksize ) );
   }
 
@@ -71,15 +69,14 @@ namespace KMail {
 
   void KHtmlPartHtmlWriter::slotWriteNextHtmlChunk() {
-    QStringList::Iterator it = mHtmlQueue.begin();
-    if ( it == mHtmlQueue.end() ) {
+    if ( mHtmlQueue.empty() ) {
       end();
       mHtmlPart->view()->viewport()->setUpdatesEnabled( true );
       mHtmlPart->view()->setUpdatesEnabled( true );
       mHtmlPart->view()->viewport()->repaint( false );
-      return;
-    }
-    write( *it );
-    mHtmlQueue.remove( it );
+    } else {
+      write( mHtmlQueue.front() );
+      mHtmlQueue.pop_front();
     mHtmlTimer.start( 0, true );
+    }
   }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic