[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 21:43:52
[Download RAW message or body]
CVS commit by mutz:
"TODO: Implement this using the custom prefixes." -> done ;-)
M +6 -1 kmmessage.cpp 1.366
M +4 -0 kmmessage.h 1.123
M +2 -3 kmreaderwin.cpp 1.621
--- kdepim/kmail/kmmessage.cpp #1.365:1.366
@@ -956,4 +956,9 @@ QCString KMMessage::asQuotedString(const
}
+QString KMMessage::cleanSubject() const {
+ return cleanSubject( sReplySubjPrefixes + sForwardSubjPrefixes,
+ true, QString::null ).stripWhiteSpace();
+}
+
QString KMMessage::cleanSubject( const QStringList & prefixRegExps, bool replace, \
const QString & newPrefix ) const { bool recognized = false;
@@ -967,5 +972,5 @@ QString KMMessage::cleanSubject( const Q
QRegExp rx( bigRegExp, false /*case insens.*/ );
if ( !rx.isValid() ) {
- kdDebug(5006) << "prefix regexp is invalid!" << endl;
+ kdWarning(5006) << "prefix regexp is invalid!" << endl;
// try good ole Re/Fwd:
recognized = subject().startsWith( newPrefix );
--- kdepim/kmail/kmmessage.h #1.122:1.123
@@ -338,4 +338,8 @@ public:
const QString& newPrefix) const;
+ /** Return this mails subject, with all "forward" and "reply"
+ prefixes removed */
+ QString cleanSubject() const;
+
/** Return this mails subject, formatted for "forward" mails */
QString forwardSubject() const;
--- kdepim/kmail/kmreaderwin.cpp #1.620:1.621
@@ -1700,10 +1700,9 @@ QString KMReaderWin::writeMsgHeader(KMMe
// the "Re:" and "Fwd:" prefixes would always cause the subject to be
// considered left-to-right, they are ignored when determining its
-// direction. TODO: Implement this using the custom prefixes.
+// direction.
QString subjectDir;
if (!aMsg->subject().isEmpty()) {
- subjectDir = (KMMsgBase::skipKeyword(aMsg->subject())
- .isRightToLeft()) ? "rtl" : "ltr";
+ subjectDir = ( aMsg->cleanSubject().isRightToLeft() ) ? "rtl" : "ltr";
} else
subjectDir = i18n("No Subject").isRightToLeft() ? "rtl" : "ltr";
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic