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

List:       kde-commits
Subject:    KDE/kdepim/kmail
From:       Thomas McGuire <mcguire () kde ! org>
Date:       2008-10-01 12:27:17
Message-ID: 1222864037.216666.15136.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 866598 by tmcguire:

Get rid of some unused, pre-template stuff.


 M  +0 -2      kmcommands.cpp  
 M  +0 -1      kmfilteraction.cpp  
 M  +10 -98    kmmessage.cpp  
 M  +10 -20    kmmessage.h  
 M  +3 -3      templateparser.cpp  
 M  +6 -1      templatesconfiguration_base.ui  


--- trunk/KDE/kdepim/kmail/kmcommands.cpp #866597:866598
@@ -1306,7 +1306,6 @@
         if (id == 0)
           id = (*it)->headerField("X-KMail-Identity").trimmed().toUInt();
 
-        // msgText += (*it)->createForwardBody();
         linklist.append( (*it) );
       }
       if ( id == 0 )
@@ -1527,7 +1526,6 @@
       if (id == 0)
         id = msg->headerField( "X-KMail-Identity" ).trimmed().toUInt();
 
-      // msgText += msg->createForwardBody();
       linklist.append( msg );
     }
     if ( id == 0 )
--- trunk/KDE/kdepim/kmail/kmfilteraction.cpp #866597:866598
@@ -1481,7 +1481,6 @@
 
   msg->initFromMessage( aMsg );
 
-  // QString st = QString::fromUtf8( aMsg->createForwardBody() );
   TemplateParser parser( msg, TemplateParser::Forward,
                          aMsg->body(), false, false, false);
   parser.process( aMsg );
--- trunk/KDE/kdepim/kmail/kmmessage.cpp #866597:866598
@@ -86,7 +86,6 @@
   DwString emptyString;
 
   // Values that are set from the config file with KMMessage::readConfig()
-  QString replyLanguage, replyStr, replyAllStr, forwardStr, indentPrefixStr;
   bool smartQuote : 1, wordWrap : 1;
   int wrapCol;
   QStringList prefCharsets;
@@ -434,38 +433,23 @@
 //-----------------------------------------------------------------------------
 QString KMMessage::formatString(const QString& aStr) const
 {
-  QString result, str;
-  QChar ch;
-  uint j;
+  QString result;
 
   if (aStr.isEmpty())
     return aStr;
 
   unsigned int strLength(aStr.length());
   for (uint i=0; i<strLength;) {
-    ch = aStr[i++];
+    QChar ch = aStr[i++];
     if (ch == '%') {
       ch = aStr[i++];
       switch (ch.toLatin1()) {
-      case 'D':
-        /* I'm not too sure about this change. Is it not possible
-           to have a long form of the date used? I don't
-           like this change to a short XX/XX/YY date format.
-           At least not for the default. -sanders */
-        result += KMime::DateFormatter::formatDate( KMime::DateFormatter::Localized,
-            date(), s->replyLanguage, false );
-        break;
-      case 'e':
-        result += from();
-        break;
-      case 'F':
-        result += fromStrip();
-        break;
-      case 'f':
+      case 'f': // sender's initals
       {
-        str = fromStrip();
+        QString str = fromStrip();
 
-        for (j=0; str[j]>' '; j++)
+        uint j = 0;
+        for (; str[j]>' '; j++)
           ;
         unsigned int strLength(str.length());
         for (; j < strLength && str[j] <= ' '; j++)
@@ -478,27 +462,9 @@
             result += str[1];
       }
       break;
-      case 'T':
-        result += toStrip();
-        break;
-      case 't':
-        result += to();
-        break;
-      case 'C':
-        result += ccStrip();
-        break;
-      case 'c':
-        result += cc();
-        break;
-      case 'S':
-        result += subject();
-        break;
       case '_':
         result += ' ';
         break;
-      case 'L':
-        result += '\n';
-        break;
       case '%':
         result += '%';
         break;
@@ -830,8 +796,7 @@
     return result;
 }
 
-QString KMMessage::asQuotedString( const QString& aHeaderStr,
-                                   const QString& aIndentStr,
+QString KMMessage::asQuotedString( const QString& aIndentStr,
                                    const QString& selection /*.clear() */,
                                    bool aStripSignature /* = true */,
                                    bool allowDecryption /* = true */) const
@@ -851,10 +816,9 @@
   content.prepend( indentStr );
   content += '\n';
 
-  const QString headerStr = formatString( aHeaderStr );
   if ( s->smartQuote && s->wordWrap )
-    return headerStr + smartQuote( content, s->wrapCol );
-  return headerStr + content;
+    return smartQuote( content, s->wrapCol );
+  return content;
 }
 
 //-----------------------------------------------------------------------------
@@ -866,7 +830,7 @@
                                    const QString &tmpl /* = QString() */ )
 {
   KMMessage* msg = new KMMessage;
-  QString str, replyStr, mailingListStr, replyToStr, toStr;
+  QString str, mailingListStr, replyToStr, toStr;
   QStringList mailingListAddresses;
   QByteArray refStr, headerName;
   bool replyAll = true;
@@ -890,9 +854,6 @@
       mailingListAddresses << rx.cap(1) + '@' + rx.cap(2);
   }
 
-  // use the "On ... Joe User wrote:" header by default
-  replyStr = s->replyAllStr;
-
   switch( replyStrategy ) {
   case KMail::ReplySmart : {
     if ( !headerField( "Mail-Followup-To" ).isEmpty() ) {
@@ -908,7 +869,6 @@
     else {
       // doesn't seem to be a mailing list, reply to From: address
       toStr = from();
-      replyStr = s->replyStr; // reply to author, so use "On ... you wrote:"
       replyAll = false;
     }
     // strip all my addresses from the list of recipients
@@ -1035,7 +995,6 @@
     else if ( !from().isEmpty() ) {
       toStr = from();
     }
-    replyStr = s->replyStr; // reply to author, so use "On ... you wrote:"
     replyAll = false;
     break;
   }
@@ -1052,16 +1011,6 @@
   //In-Reply-To = original msg-id
   msg->setReplyToId(msgId());
 
-//  if (!noQuote) {
-//    if( selectionIsBody ){
-//      QByteArray cStr = selection.toLatin1();
-//      msg->setBody( cStr );
-//    }else{
-//      msg->setBody(asQuotedString(replyStr + '\n', s->indentPrefixStr, selection,
-//                                  s->smartQuote, allowDecryption).toUtf8());
-//    }
-//  }
-
   msg->setSubject( replySubject() );
 
   // If the reply shouldn't be blank, apply the template to the message
@@ -1169,30 +1118,6 @@
   return msg;
 }
 
-
-//-----------------------------------------------------------------------------
-QByteArray KMMessage::createForwardBody()
-{
-  QString tmp;
-  if (s->headerStrategy == HeaderStrategy::all()) {
-    tmp = "\n\n----------  " + s->forwardStr + "  ----------\n\n"
-      + headerAsString();
-  } else {
-    tmp = "\n\n----------  " + s->forwardStr + "  ----------\n\n"
-      + "Subject: " + subject() + '\n'
-      + "Date: "
-         + KMime::DateFormatter::formatDate( KMime::DateFormatter::Localized,
-                                             date(), s->replyLanguage, false )
-         + '\n'
-      + "From: " + from() + '\n'
-      + "To: " + to() + '\n'
-      + ( cc().isEmpty() ? QString() : ("Cc: " + cc() + '\n') )
-      + '\n';
-  }
-  return asQuotedString(tmp, "", QString(), false, false).toUtf8()
-    + "\n-------------------------------------------------------\n";
-}
-
 void KMMessage::sanitizeHeaders( const QStringList& whiteList )
 {
    // Strip out all headers apart from the content description and other
@@ -3901,20 +3826,7 @@
 
   KConfigGroup config( KMKernel::config(), "General" );
 
-  int languageNr = config.readEntry( "reply-current-language", 0 );
 
-  { // area for config group "KMMessage #n"
-    KConfigGroup config( KMKernel::config(), QString("KMMessage \
                #%1").arg(languageNr) );
-    s->replyLanguage = config.readEntry("language",KGlobal::locale()->language());
-    s->replyStr = config.readEntry("phrase-reply",
-      i18n("On %D, you wrote:"));
-    s->replyAllStr = config.readEntry("phrase-reply-all",
-      i18n("On %D, %F wrote:"));
-    s->forwardStr = config.readEntry("phrase-forward",
-      i18n("Forwarded Message"));
-    s->indentPrefixStr = config.readEntry("indent-prefix",">%_");
-  }
-
   { // area for config group "Composer"
     KConfigGroup config( KMKernel::config(), "Composer" );
     s->smartQuote = GlobalSettings::self()->smartQuote();
--- trunk/KDE/kdepim/kmail/kmmessage.h #866597:866598
@@ -174,9 +174,6 @@
    */
   KMMessage* createRedirect( const QString &toStr );
 
-  /** Create the forwarded body for the message. */
-  QByteArray createForwardBody();
-
   /** Create a new message that is a forward of this message, filling all
     required header fields with the proper values. The returned message
     is not stored in any folder. Marks this message as forwarded. */
@@ -818,23 +815,16 @@
   */
   QByteArray mboxMessageSeparator();
 
-  /** Returns message body with quoting header and indented by the
-    given indentation string. This is suitable for including the message
-    in another message of for replies, forwards. The header string is
-    a template where the following fields are replaced with the
-    corresponding values:
-    <pre>
-        %D: date of this message
-        %S: subject of this message
-        %F: sender (from) of this message
-        %%: a single percent sign
-    </pre>
-    No attachments are handled if includeAttach is false.
-    The signature is stripped if aStripSignature is true and
-    smart quoting is turned on. Signed or encrypted texts
-    get converted to plain text when allowDecryption is true. */
-  QString asQuotedString( const QString & headerStr,
-          const QString & indentStr,
+  /**
+   * Returns message body indented by the
+   * given indentation string. This is suitable for including the message
+   * in another message of for replies, forwards.
+   *
+   * No attachments are handled if includeAttach is false.
+   * The signature is stripped if aStripSignature is true and
+   * smart quoting is turned on. Signed or encrypted texts
+   * get converted to plain text when allowDecryption is true. */
+  QString asQuotedString( const QString & indentStr,
           const QString & selection=QString(),
           bool aStripSignature=true,
           bool allowDecryption=true) const;
--- trunk/KDE/kdepim/kmail/templateparser.cpp #866597:866598
@@ -291,7 +291,7 @@
         if ( mOrigMsg ) {
           QString str =
               pipe( pipe_cmd, mOrigMsg->asPlainText( mSmartQuote, mAllowDecryption ) \
                );
-          QString quote = mOrigMsg->asQuotedString( "", mQuoteString, str,
+          QString quote = mOrigMsg->asQuotedString( mQuoteString, str,
                                                     mSmartQuote, mAllowDecryption );
           if ( quote.endsWith( '\n' ) )
             quote.chop( 1 );
@@ -302,7 +302,7 @@
         kDebug(5006) <<"Command: QUOTE";
         i += strlen( "QUOTE" );
         if ( mOrigMsg ) {
-          QString quote = mOrigMsg->asQuotedString( "", mQuoteString, mSelection,
+          QString quote = mOrigMsg->asQuotedString( mQuoteString, mSelection,
                                                     mSmartQuote, mAllowDecryption );
           if ( quote.endsWith( '\n' ) )
             quote.chop( 1 );
@@ -313,7 +313,7 @@
         kDebug(5006) <<"Command: QHEADERS";
         i += strlen( "QHEADERS" );
         if ( mOrigMsg ) {
-          QString quote = mOrigMsg->asQuotedString( "", mQuoteString,
+          QString quote = mOrigMsg->asQuotedString( mQuoteString,
                                                     \
mOrigMsg->headerAsSendableString(),  mSmartQuote, false );
           if ( quote.endsWith( '\n' ) )
--- trunk/KDE/kdepim/kmail/templatesconfiguration_base.ui #866597:866598
@@ -290,7 +290,12 @@
      <item>
       <widget class="QLineEdit" name="lineEdit_quote" >
        <property name="whatsThis" >
-        <string>&lt;qt>The following placeholders are supported in the quote \
indicator:&lt;br />&lt;table>&lt;tr>    &lt;td>&lt;b>%D&lt;/b>: date&lt;/td>    \
&lt;td>&lt;b>%S&lt;/b>: subject&lt;/td>    &lt;td>&lt;/td>&lt;/tr>&lt;tr>    \
&lt;td>&lt;b>%e&lt;/b>: sender's address&lt;/td>    &lt;td>&lt;b>%F&lt;/b>: sender's \
name&lt;/td>    &lt;td>&lt;b>%f&lt;/b>: sender's initials&lt;/td>&lt;/tr>&lt;tr>    \
&lt;td>&lt;b>%T&lt;/b>: recipient's name&lt;/td>    &lt;td>&lt;b>%t&lt;/b>: \
recipient's name and address&lt;/td>    &lt;td>&lt;/td>&lt;/tr>&lt;tr>    \
&lt;td>&lt;b>%C&lt;/b>: carbon copy names&lt;/td>    &lt;td>&lt;b>%c&lt;/b>: carbon \
copy names and addresses&lt;/td>    &lt;td>&lt;/td>&lt;/tr>&lt;tr>    \
&lt;td>&lt;b>%%&lt;/b>: percent sign&lt;/td>    &lt;td>&lt;b>%_&lt;/b>: space&lt;/td> \
&lt;td>&lt;b>%L&lt;/b>: linebreak&lt;/td>&lt;/tr>&lt;/table>&lt;/qt></string> +       \
<string> +             &lt;qt&gt;The following placeholders are supported in the \
quote indicator: +             &lt;li&gt;%f: sender's initals&lt;/li&gt;
+             &lt;li&gt;%%: percent sign&lt;/li&gt;
+             &lt;li&gt;%_: space&lt;/li&gt;&lt;/qt&gt;
+           </string>
        </property>
       </widget>
      </item>


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

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