Use KURL::List properly (no new without delete, so better no new at all,

and don't pass a path to KURL).

svn path=/trunk/kdenetwork/kmail/; revision=68291
wilder-work
David Faure 26 years ago
parent b4f451d328
commit 4472e95565
  1. 26
      kmreaderwin.cpp

@ -1512,19 +1512,23 @@ void KMReaderWin::slotAtmOpen()
} else if( choice == KMessageBox::No ) { // Open
if ( offer ) {
// There's a default service for this kind of file - use it
KURL::List *lst;
lst = new KURL::List(fileName);
KRun::run(*offer, *lst);
KURL::List lst;
KURL url;
url.setPath(fileName);
lst.append(url);
KRun::run(*offer, lst);
} else {
// There's no know service that handles this type of file, so open
// the "Open with..." dialog.
KFileOpenWithHandler *openhandler = new KFileOpenWithHandler();
KURL::List *lst;
lst = new KURL::List(fileName);
openhandler->displayOpenWithDialog(*lst);
KURL::List lst;
KURL url;
url.setPath(fileName);
lst.append(url);
openhandler->displayOpenWithDialog(lst);
}
} else { // Cancel
kdDebug() << "Cancelled opening attachment" << endl;
kdDebug() << "Canceled opening attachment" << endl;
}
}
@ -1542,9 +1546,11 @@ void KMReaderWin::slotAtmOpenWith()
QString fileName = getAtmFilename(msgPart.fileName(), msgPart.name());
KFileOpenWithHandler *openhandler = new KFileOpenWithHandler();
KURL::List *lst;
lst = new KURL::List(fileName);
openhandler->displayOpenWithDialog(*lst);
KURL::List lst;
KURL url;
url.setPath(fileName);
lst.append(url);
openhandler->displayOpenWithDialog(lst);
}

Loading…
Cancel
Save