TDEHNS: Respect downloaded file extension.

This fixes a bug in Kopete and probably in some more places.

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/141/head
Mavridis Philippe 3 years ago
parent f6db22575a
commit ad5ff1e012
No known key found for this signature in database
GPG Key ID: F8D2D7E2F989A494

@ -69,10 +69,14 @@ void TDENewStuff::download()
mEngine->download(); mEngine->download();
} }
TQString TDENewStuff::downloadDestination( Entry * ) TQString TDENewStuff::downloadDestination( Entry *entry )
{ {
// Respect downloaded file's extension
TQString ext = entry->payload().fileName().section('.', 1);
if ( ! ext.isEmpty() ) ext = "." + ext;
return TDEGlobal::dirs()->saveLocation( "tmp" ) + return TDEGlobal::dirs()->saveLocation( "tmp" ) +
TDEApplication::randomString( 10 ); TDEApplication::randomString( 10 ) + ext;
} }
void TDENewStuff::upload() void TDENewStuff::upload()

Loading…
Cancel
Save