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>
(cherry picked from commit ad5ff1e012)
r14.0.x
Mavridis Philippe 3 years ago
parent 46247912de
commit 9ef84b691c
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