[Kde-pim] Review Request: Remove all the signature blocks.

Jaime Torres jtamate at gmail.com
Mon Mar 23 12:22:47 GMT 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/403/
-----------------------------------------------------------

(Updated 2009-03-23 05:22:46.901123)


Review request for KDE PIM.


Changes
-------

Remove unseen spaces.


Summary
-------

Remove all the signature blocks.
The algorithm is:
Look for the prefixes before the "-- " marks (i.e. the text before it in the line).
foreach line, if the line contains "-- ", start to delete lines until the prefix changes.

(it should also work with c code if the -- is not followed by a space).


This addresses bug 72316.
    https://bugs.kde.org/show_bug.cgi?id=72316


Diffs (updated)
-----

  /trunk/KDE/kdepim/kmail/kmmessage.cpp 940552 

Diff: http://reviewboard.kde.org/r/403/diff


Testing
-------

If checked with the following code:
const QString mail="text1\n-- \nSignature Block1\nSignature Block1\n\n> text2\n"\
                   "> -- \n> Signature Block 2\n> Signature Block 2\n"\
                   ">> text3\n>> text3\n>> -- \n>> Signature Block 3\n>> Signature Block 3\n"\
                   "> text4\n> -- \n> Signature Block 4\n"\
                   "text5\n-- \nSignature Block 5\n";
const QString mail1="text1\n-- \nSignature Block1\nSignature Block1\n\n"\
				   ">text2\n>-- \n>Signature Block 2\n>Signature Block 2\n" \
                   ">>text3\n>>text3\n>>-- \n>>Signature Block 3\n>>Signature Block 3\n"\
                   ">text4\n>-- \n>Signature Block 4\n>Signature Block 4\n"\
                   "text5\n-- \nSignature Block 5\n";
                   
const QString mail2="Text 1\n-- \nFirst sign\n\n\n> From: bla\n"\
"> Texto 2\n\n> AquĆ­ algo de texto.\n\n> --\n> Signature Block 2\n\n> Adios\n"\
"\n>> Texto 3\n\n>> --\n>> Signature block 3\n";

const QString mail3="-- \n-- ACME, Inc\n-- Joe User\n-- PHB\n-- Tel.: 555 1234\n--";

	QString res=stripSignature(mail,1);
	cout<<"res:"<<res.toStdString()<<endl;
	res=stripSignature(mail1,1);
	cout<<"res:"<<res.toStdString()<<endl;
	res=stripSignature(mail2,1);
	cout<<"res:"<<res.toStdString()<<endl;
	res=stripSignature(mail3,1);
	cout<<"res:"<<res.toStdString()<<endl;


Thanks,

Jaime

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list