Re: branches/work/kdepim-3.5.5+/kmail

Frank Thieme <[email protected]>
Newsgroups gmane.linux.debian.devel.qt-kde,gmane.comp.kde.devel.kmail
Message-ID <[email protected]>
On Sunday 18 March 2007 22:46, Allen Winter wrote:
> Sorry but this really isn't worth any further discussion or coding on my
> part as I am swamped with KDE4 stuff.  If Ingo agrees to a hidden option,
> and Frank provides the patch, I will commit.

I'm still impressed how easy the modification was....

Bye...Frank
kmail_user_agent2.diff (text/x-diff, 2.4 KB)
diff -ur kdepim-3.5.5.dfsg.1/kmail/headerstrategy.cpp kdepim-3.5.5.dfsg.1.new/kmail/headerstrategy.cpp
--- kdepim-3.5.5.dfsg.1/kmail/headerstrategy.cpp	2005-09-10 10:24:01.000000000 +0200
+++ kdepim-3.5.5.dfsg.1.new/kmail/headerstrategy.cpp	2007-03-13 21:47:52.653496072 +0100
@@ -60,7 +60,8 @@
 
   static const char * richHeaders[] = {
     "subject", "date", "from", "cc", "bcc", "to",
-    "organization", "organisation", "reply-to"
+    "organization", "organisation", "reply-to",
+    "user-agent", "x-mailer"
   };
   static const int numRichHeaders = sizeof richHeaders / sizeof *richHeaders;
 
diff -ur kdepim-3.5.5.dfsg.1/kmail/headerstyle.cpp kdepim-3.5.5.dfsg.1.new/kmail/headerstyle.cpp
--- kdepim-3.5.5.dfsg.1/kmail/headerstyle.cpp	2006-07-22 10:14:16.000000000 +0200
+++ kdepim-3.5.5.dfsg.1.new/kmail/headerstyle.cpp	2007-03-21 02:09:26.574020421 +0100
@@ -649,6 +649,23 @@
                             .arg(i18n("Date: "))
                     .arg( directionOf( message->dateStr() ) )
                             .arg(strToHtml(dateString)));
+    
+    if ( GlobalSettings::self()->showUserAgent() ) {
+      if ( strategy->showHeader( "user-agent" ) )
+        if ( ! message->headerField("User-Agent").isEmpty() )
+          headerStr.append(QString("<tr><th>%1</th>\n"
+                     "<td>%2</td></tr>\n")
+                      .arg(i18n("User-Agent: "))
+                      .arg( strToHtml( message->headerField("User-Agent") ) ) );
+
+      if ( strategy->showHeader( "x-mailer" ) )
+        if ( ! message->headerField("X-Mailer").isEmpty() )
+          headerStr.append(QString("<tr><th>%1</th>\n"
+                     "<td>%2</td></tr>\n")
+                      .arg(i18n("X-Mailer: "))
+                      .arg( strToHtml( message->headerField("X-Mailer") ) ) );
+    }
+
 
     // FIXME: Show status in synthetic header style field.  Decide whether this or current in brackets style is best and remove one.
     /*    if( strategy->showHeader( "status" ) )
diff -ur kdepim-3.5.5.dfsg.1/kmail/kmail.kcfg kdepim-3.5.5.dfsg.1.new/kmail/kmail.kcfg
--- kdepim-3.5.5.dfsg.1/kmail/kmail.kcfg	2006-01-19 17:55:47.000000000 +0100
+++ kdepim-3.5.5.dfsg.1.new/kmail/kmail.kcfg	2007-03-20 23:49:36.975924472 +0100
@@ -434,6 +434,10 @@
      <entry name="ChiasmusDecryptionOptions" type="String">
      </entry>
 
+     <entry name="ShowUserAgent" type="Bool">
+       <default>false</default>
+     </entry>
+
     </group>
 
     <group name="TextIndex">
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBGAIfcOUZy7Ywnge4RAvgAAJ0YGK/uoMj9vLOomcemKds/h7RTFwCfeWNz
lGT/SQOQsynrqWuCjgVfXuY=
=nlDp
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.