not trivial) to BodyPartFormatter, calling back at
ObjectTreeParser::processFooBarSubtype() methods, as for app/* and
text/* before.
o add some triple-hashed comments about suspicious code
o in ObjectTreeParser::parseObjectTree(),
- replace repeated if(node)'s with a guard clause
- replace an occurrence of
if ( a || b ) {
if ( a ) foo; else bar;
}
with (hopefully equivalent :-)
if ( a ) foo; else if ( b ) bar;
- remove unneeded temp. var curNode and s/curNode/node/g;
- use new AttachmentStrategy::defaultDisplay() to get rid of an
else-if-cascade
o kill now unused ObjectTreeParser::processFooType() methods.
o In bodypartformatter.cpp, add the new BodyPartFormatter subclasses
and prepare for a table-driven (as opposed to switch'ing factory
methods.)
svn path=/trunk/kdepim/; revision=252732
#define kernel KMKernel::self()
to
#define kmkernel KMKernel::self()
because 'kernel' was a much to general term. We really shouldn't repeat the mistakes of the X developers.
I noticed this problem when I played around with KImageEffects. kimageeffects.h contains 'kernel' as parameter of some methods and so the compilation had to fail. We won't need KImageEffects in the near future, but at least we are now prepared and a clash with another 'kernel' can't happen anymore.
svn path=/trunk/kdepim/; revision=252621
BodyPartFormatter, intended to encapsulate the various
ObjectTreeParser::processFooBarSubtype() methods in per-mimetype
fashion. Currently, text/* and app/* are available, but they just call
back the ObjectTreeParser methods, which therefore are made public
until removed later.
svn path=/trunk/kdepim/; revision=251468
I doubt the user can sense the difference between "Bad" and "BAD" or "Good" and "GOOD".
Yet, bad should be emphasized. Doing so.
svn path=/trunk/kdepim/; revision=245755
Actually this fixes all handling of application/octet-stream attachments that are not part of multipart/encrypted
svn path=/trunk/kdepim/; revision=244943
has redraw problems with smart MTV mode in separate reader, though)
- Extract config profile loading from the Appearance page into a new
dialog: Better user experience and less special code in appearance
page to make sure ProfileTab::apply() is called first...
- Merge the groupware and folder config pages into a misc page
(the folder tag should probably be split into "folder" and
"behaviour")
- various small cleanups:
o s/QString()/QString::null/
o unused #includes in .h files
o added const'ness to tmps
o removed some tmps
o etc
svn path=/trunk/kdepim/; revision=242473
That's actually caused by a bug in the KHTML part. Remove some of the '\n' that Marc made KMail add to the HTML output to workaround this bug.
svn path=/trunk/kdepim/; revision=240749
This patch mostly concerns itself with the following two things:
1. Move code out from kmreaderwin (see new class CSSHelper, whose files
have already been committed).
Into this category fall the simplification and readability
enhancements of the HTML code (adding some newlines, simplifying the
HTML in favour of complicating the CSS a bit, using @media print)
2. Change the semantics of the mCodec member of KMMessage and
KMReaderWin.
To make it short: mCodec is not mOverrideCodec and only ever set to a
non-NULL value iff the codec is forced by the user selecting an
encoding from the Message menu. In all other cases, it's now
calculated from the message(parts). For that, the codec() and
setBodyFromUnicode() and bodyToUnicode() methods have been duplicated
in KMMessage from KMMsgPart (don't you just hate that?).
Walkthrough of the patch:
kmreaderwin.{h,cpp}
- Replace all c* and m*Font members by a single CSSHelper instance.
- readColorConfig(), parts of readConfg(), quoteFontTag() and htmlHead()
were moved from here to CSSHelper
- rename codec()/setCodec() to overrideCodec()/setOverrideCodec()
and provide an autoDetectEncoding() convenience method.
- Remove the QTextCodec parameter from setMsgPart. It now uses
overrideCodec() or the msgPart's own codec.
- s/isfixedFont/isFixedFont/
- split parseMsg( KMMessage*, bool ) into one for
onlyProcessHeaders=false (called again parseMsg(KMMessage*)) and one
for oPH=true (called parseMsgHeader()). The latter then reduces to
writeMsgHeader(), provided one accepts the minor regression that the
[vPart] link is not shown _for *nested*_ messages. This can be readded
later, once KMReaderWin is void of formatting code and OTP is
independent of a KMReaderWin parent. I've left the commented
parseMsgHeader in the momnt of it's death in commented out, so you can
see what I how I came to kill it off for an explicit writeMsgHeader().
- In the old new parseMsg(KMMessage*), there also happened significant
code simplification, mostly by realizing that the the colorbar and tmp
file handling belongs into parseMsg(void) and by removing the oPH=true
case. There's also an instance of simplifying code by using
bodyToUnicode(). At last, the <div id="header"></div> around
writeMsgHeader is superfluous (and wrong, since there is and never was
a div#header CSS selector), since the HeaderStyle's add that already.
- Apply "Inline Method" to writeHTMLStr()
- remove the QTextCodec param from showVCard(). This method is now a
nice one and uses bodyToUnicode()
- rename all fooCodec to fooOverrideCodec
- currently, mCSSHelper is destroyed and re-created whenever it the
config changes. I intend to make CSSHelper a fully functional
ConfigManager later.
- setOverrideCodec now calls update(true) only if the codec was actually
changed.
- In setMsgPart, there's code that "forgets" to strip off <head>, <body>
and <html> tags from HTML parts. I didn't do anything about that yet,
only added a triple-hash.
- Simplify slotAtmSave() by using more guard clauses and esp. by using
QString::section() and QString::replace(QChar,QChar) instead of
rolling our owns.
objecttreeparser.{h,cpp}:
- Use CSShelper
- Create a new CSS class "htmlWarn" for the HTML warning frame to get
rid of the embedded style information.
- simplify quotedHTML() by using new nonQuotedFontTag().
headerstyle.cpp:
- We begin by inserting some newlines to ease the reading of the
resultant HTML code.
- In the fancy header department, we remove almost all class attributes
from the HTML tags. Instead (see csshelper.cpp), we use CSS Selectors
to address the inner tags of the enclosing <div class="fancy header">
Note how that tag matches both the div.header (setting the margin) and
div.fancy.header selectors in csshelper.cpp
- We end with removing the workaround for the apparently long-standing
khtml bug that makes it ignore "padding" on <table>, viz. another
<div></div> pair around the table.
kmfldsearch.cpp:
- Reap fruits of (2).
kmmainwin.cpp:
- Consequence of setCodec -> setOverrideCodec() renaming
- move an #include up to the top
kmmessage.{h,cpp}:
- Copy setBodyFromUnicode(), bodyToUnicode() and rename fooCodec to
fooOverrideCodec.
- Note how the double housekeeping (mAutoDetectEncoding) goes away with
this.
- In html2source(), don't emit <br />, but <br> (we're using HTML 4.01,
not XHTML) and quote ' with ' (well, that's more XHTML-like)
kmreadermainwin.{h,cpp}:
- Since the QTextCodec* parameter was removed from
KMReaderWin::setMsgPart(), use now the explicit setOverrideCodec()
method to set the user-defined codec.
- Remove unused mCodec member
svn path=/trunk/kdepim/; revision=236540
- Fix FIXME added by me in the separate reader window when viewing
text/plain attachments.
- Comment out mShowCompleteMessage from reader win. The only usage of
it is in the ObjectTreeParser, and I don't see any regressions with
simply assuming it to always be true. It certainly doesn't break the
claimed usage of this hack.
- group fonts/color member variables together.
- Refactor HTML head composition from parseMsg() into htmlHead()
- Use new htmlHead() to fix#60688
CCMAIL:60688-done@bugs.kde.org
ObjectTreeParser:
- Moved mIsFirstTextPart member variable from readerwin to here
- Removed the hack that maps app/pgp to text/plain. Instead, just call
the t/p method from the app/pgp case.
- At the end of parseObjectTree(), change the last
htmlWriter()->write() to htmlWriter()->queue(), since everything
that is called in between uses queue(), too (see below)
KHtmlHtmlWriter:
- Keep state to be able to warn about incorrect usage patterns
- Move html view init/finish to begin() and end() from kmreaderwin
and objecttreeparser
svn path=/trunk/kdepim/; revision=235256
- Use HtmlStatusBar instead of home-brewn QLabel.
- Remove strToHtml (uses the equivalent LinkLocator method now).
object tree parser:
- Extract Method on processFooType to get processFooBarSubtype
methods.
- Use AttachmentStrategy::inlineNestedMessages()
- Created a new CryptPlugWrapperSaver that implements
reasource-allocation-is-initialization" for (re)setting the
cryptplug in some ObjectTreeParser methods.
both:
- Move writeBodyStr(), writePartIcon(), quotedHTML(),
sigStatusToString(), writeSigstat{Header,Footer}
from KMReaderWin to ObjectTreeParser.
There is one known regression (documented with a FIXME)
(see last hunk of kmreaderwin.cpp):
I had to #if 0 a call to writeBodyStr. This code needs to be ported to
use ObjectTreeParser first. The code is about the "view attachment"
feature.
Other than that, the changes should be behaviour-preserving (except
for the smart attachment mode now showing nested messages inline).
The patch is large, but consists almost purely of moving around code.
svn path=/trunk/kdepim/; revision=230897
o Fix display of t/p parts when using the smart attachment strategy:
They're now also shown inline if they have no filename associated with them.
Together, they fix display of multi-part text messages, such as Simon Josefsson's nice example mail, which has a tradition of having it's display being broken in KMail ;-)
svn path=/trunk/kdepim/; revision=223610
- Draw a nice frame around text attachments. The frame header contains the attachments name and the description. The name is an active URL which can be used the same way as the URL next to attachment icons, e. g. to easily save the attachment.
Some details:
kmreaderwin.*:
- Move the code which saves a message part to a temporary file from KMReaderWin::writePartIcon to a separate function KMReaderWin::writeMessagePartToTempFile.
- Change the HTML code which is generated for attachment icons resp. embedded images.
- Add note about improved threading to the list of new features.
- Change style for frame around embedded RFC822 attachments (why was the right border hidden??) and add style for frame around embedded text attachments.
objecttreeparser.cpp:
- replace !curNode->isAttachment() with curNode->hasContentDispositionInline() where appropriate
- fix the logic for displaying text message parts; a text message part is displayed inline if
- it's the first text part
- the attachment strategy is "inlined"
- the attachment strategy is "smart" and the cont. disp. of the msg part is "inline"
- we show only one mime part (i.e. the user selected some msg part in the mime tree viewer)
- draw frame around embedded text (non html) attachments, I should probably do the same for embedded text/html attachments
Backport will follow later.
svn path=/trunk/kdepim/; revision=213729
Some details:
partmetadata.h: PartMetaData gets an additional flag 'technicalProblem' which indicates technical problems during de/encryption, signing, signature verification
kmreaderwin.cpp: Add code to handle the new technicalProblem flag in writeSigstatHeader.
objecttreeparser.*:
- removed foundMatchingCryptPlug; instead kernel->cryptPlugList()->findForLibName() is used directly
- removed showMessageAndSetData; instead the messages are now creates directly in the code since they are too different
- get rid of the crypt plug error message boxes and instead generate error messages which are shown in the message status frames.
Probably most of the changed lines only got a different indention depth because some big if statements where removed.
svn path=/trunk/kdepim/; revision=212384
Fixes Simon Josefsson's nice test mail "Text with many charsets splitted into many MIME parts", except for the message parts where Qt doesn't have a text codec for (apparently):
charset=iso-2022-7bit
charset=devanagari
charset=lao
charset=thai-tis620
charset=tibetan
charset=viscii
svn path=/trunk/kdepim/; revision=208295
KHtmlPartHtmlWriter, which therefore becomes a QObject.
Add a new HtmlWriter::reset() method that KHtmlPartHtmlWriter
uses to stop it's timer and empty the html queue.
Don't delete mHtmlWriter in KMReaderWin dtor anymore, but rely on QObjects
destroying it's parents.
svn path=/trunk/kdepim/; revision=201105