Hello Kopete developers.

I got irritated by the fact Kopete opens my Hotmail mailbox in Konqueror
every time I get a new mail, so I decided to do something about it.
By setting the default application for .html files to my preferred browser,
the issue was resolved but not the way I liked, so I decided to dive into
the code.

Basically I changed the KRun instance which opens the temporary .html-file
to KToolInvocation::
invokeBrowser(), so the temp file gets opened in the default browser.

You can find the section in /protocols/wlm/wlmaccount.cpp:
(line numbers refer to newest svn revision in trunk)

*Original:*
*1184*     void
*1185*     WlmAccount::slotInboxUrl (MSN::hotmailInfo & info)
*1186*     {
[...]
*1216*      if (tmpMailFile->open())
*1217*     {
*1218*     tmpMailFile->write(hotmailRequest.toUtf8());
*1219*     tmpMailFile->flush();
*1220*
*1221*     /* tmpMailFile->close() erases tmpMailFile->fileName property(),
so use it before closing file. */
*1222*     KRun *runner = new KRun( tmpMailFile->fileName(), 0, 0, true );
// false = non-local files
*1223*     runner->setRunExecutables( false ); //security
*
My changes:*
*1184*     void
*1185*     WlmAccount::slotInboxUrl (MSN::hotmailInfo & info)
*1186*     {
[...]
*1216*      if (tmpMailFile->open())
*1217*     {
*1218*     tmpMailFile->write(hotmailRequest.toUtf8());
*1219*     tmpMailFile->flush();
*1220*
*1221*     /* tmpMailFile->close() erases tmpMailFile->fileName property(),
so use it before closing file. */
*1222*     KToolInvocation::invokeBrowser(tmpMailFile->fileName()) ;
*1223*     tmpMailFile->close();

Line 37: #include <krun.h> can be removed, for obvious reasons.

I hope the code is readable this way. Anyway, thanks for Kopete and keep up
the good work!

Regards,
Pieter van der Kloet.

PS: You can regard this code as bugfix for bug # 130614, which is currently
set to FIXED. I didn't start a new bug report for this yet.
_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to