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

List:       kde-devel
Subject:    Re: KMail and mailto:
From:       Don Sanders <dsanders () cch ! com ! au>
Date:       1999-10-17 1:25:41
[Download RAW message or body]

On Sun, 17 Oct 1999, Markus Goetz wrote:
> Hi,
> 
> i use Netscape as Browser and KMail as MUA.
> So when i want to mail something to somebody that has a mailto: link on his
> homepage, i use the right mouse button on this mailto: link to copy the url to
> clipboard. Then i choose new mail in kmail and paste this thing.
> But then there is mailto:bla@bla in the TO field. Now i have to remove this
> mailto: thing, without removing it my mail won't get delivered :(((
> So can't kmail automatically remove the mailto: ??

No it can't. It's a computer program and pretty much only does what its begin
programmed to do. Sometimes I ask it to clean my bathroom and it just flat out
ignores me.

Not that it would be hard to program it to do this. I mean once you figured out
where the To: address was stored you could do something like (refering to the
html qt docs in qt/doc/qstring.html)

QString myRawString = theToField;
while (myRawString.find("mailto:") != -1)
  myRawString.replace(myRawString.find("mailto:"), 7, "" );
theToField = myRawString;

In fact you probably want to do the same thing for the CC and BCC fields. So
you might right to wrap this up as its own method (eg function).
say 
QString stripMailto( QString str );

Now I happen to know the right place to start looking for where to do this is
kmcomposewin.cpp (in the kmail sources, you know it's an open source program
and this is an email list for kde development). Unfortunately there are no docs
on where to look you just have to figure it out for yourself....

bool KMComposeWin::applyChanges(void)

looks like a good place to do it, I would replace

  mMsg->setTo(to());
  mMsg->setFrom(from());
  mMsg->setCc(cc());
  mMsg->setSubject(subject());
  mMsg->setReplyTo(replyTo());
  mMsg->setBcc(bcc());

with
  mMsg->setTo(stripMailto(to()));
  mMsg->setFrom(from());
  mMsg->setCc(stripMailto(cc()));
  mMsg->setSubject(subject());
  mMsg->setReplyTo(replyTo());
  mMsg->setBcc(stripMailto(bcc()));

Now I haven't tested any of this and don't plan to as this isn't a problem for
me. But if it was a problem for me I would try and do something like this, test
it out for a while (a few weeks maybe) and then email the maintainer or someone
with cvs access (you can use webcvs from www.kde.org to see who has access to
kmail) a patch.

BFN,
Don.

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

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