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

List:       kde-core-devel
Subject:    KApplication::invokeMailer() crash
From:       André_Wöbbeking <Woebbeking () onlinehome ! de>
Date:       2004-12-07 20:18:50
Message-ID: 200412072118.50965.Woebbeking () onlinehome ! de
[Download RAW message or body]

Hi,

the method crashes for me if it's called by 
KonqMainWindow::slotSendURL()  because "to" is QString::null. Can I 
commit the attached patch or should "to" be set to something like 
"unknown"? 


Cheers,
André

["invokeMailer.diff" (text/x-diff)]

Index: kapplication.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kapplication.cpp,v
retrieving revision 1.689
diff -u -3 -p -r1.689 kapplication.cpp
--- kapplication.cpp	2 Dec 2004 13:13:28 -0000	1.689
+++ kapplication.cpp	7 Dec 2004 20:11:21 -0000
@@ -2269,17 +2269,19 @@ void KApplication::invokeMailer(const QS
    cmdTokens.remove(cmdTokens.begin());
 
    KURL url;
-   url.setProtocol( "mailto" );
-   QStringList tos = QStringList::split( ',', to );
-   url.setPath( tos.first() );
-   tos.remove( tos.begin() );
    QStringList qry;
-   for (QStringList::ConstIterator it = tos.begin(); it != tos.end(); ++it)
-      qry.append( "to=" + KURL::encode_string( *it ) );
-   QStringList ccs = QStringList::split( ',', cc );
+   if (!to.isEmpty())
+   {
+     QStringList tos = QStringList::split( ',', to );
+     url.setPath( tos.first() );
+     tos.remove( tos.begin() );
+     for (QStringList::ConstIterator it = tos.begin(); it != tos.end(); ++it)
+       qry.append( "to=" + KURL::encode_string( *it ) );
+   }
+   const QStringList ccs = QStringList::split( ',', cc );
    for (QStringList::ConstIterator it = ccs.begin(); it != ccs.end(); ++it)
       qry.append( "cc=" + KURL::encode_string( *it ) );
-   QStringList bccs = QStringList::split( ',', bcc );
+   const QStringList bccs = QStringList::split( ',', bcc );
    for (QStringList::ConstIterator it = bccs.begin(); it != bccs.end(); ++it)
       qry.append( "bcc=" + KURL::encode_string( *it ) );
    for (QStringList::ConstIterator it = attachURLs.begin(); it != attachURLs.end(); ++it)


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

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