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

List:       kde-commits
Subject:    KDE/kdepim/kmail
From:       David Faure <faure () kde ! org>
Date:       2006-11-03 13:14:56
Message-ID: 1162559696.778634.5943.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 601503 by dfaure:

Fix RMB/View on text attachments showing no newlines. This has annoyed me for years, \
glad I finally get around fixing it :) Also fixed a queue/write mismatch which led to \
a runtime warning and to strange order of things in the code.


 M  +5 -3      kmreaderwin.cpp  


--- trunk/KDE/kdepim/kmail/kmreaderwin.cpp #601502:601503
@@ -2043,16 +2043,18 @@
   } else {
     htmlWriter()->begin( mCSSHelper->cssDefinitions( isFixedFont() ) );
     htmlWriter()->queue( mCSSHelper->htmlHead( isFixedFont() ) );
+    htmlWriter()->queue( "<pre>" );
 
     QString str = aMsgPart->bodyDecoded();
     // A QString cannot handle binary data. So if it's shorter than the
     // attachment, we assume the attachment is binary:
     if( str.length() < aMsgPart->decodedSize() ) {
-      str += QString::fromLatin1("\n") + i18np("[KMail: Attachment contains binary \
data. Trying to show first character.]", +      str.prepend( i18np("[KMail: \
                Attachment contains binary data. Trying to show first character.]",
           "[KMail: Attachment contains binary data. Trying to show first %n \
                characters.]",
-          str.length());
+                               str.length()) + QChar::fromLatin1('\n') );
     }
-    htmlWriter()->write( Qt::escape( str ) );
+    htmlWriter()->queue( Qt::escape( str ) );
+    htmlWriter()->queue( "</pre>" );
     htmlWriter()->queue("</body></html>");
     htmlWriter()->flush();
     mMainWindow->setWindowTitle(i18n("View Attachment: %1", pname));


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

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