[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

User-Agent display in fancy headers



Hi,

after seeing some requests about this and waiting for this myself I looked 
in the source and hacked it in myself. I attach a diff for the latest 
debian testing release of kmail.

Maybe it's not elegant or cute, but it works for me and will hopefully 
integrated in the next releases. :)

Bye...Frank
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-13 22:41:40.941465719 +0100
@@ -650,6 +650,21 @@
                     .arg( directionOf( message->dateStr() ) )
                             .arg(strToHtml(dateString)));
 
+    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" ) )
       headerStr.append( QString( "<tr><th>%1</th>\n"

Attachment: pgpOf_qQpA4R0.pgp
Description: PGP signature


Reply to: