diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2021-06-27 14:55:31 +0300 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2021-06-27 14:56:44 +0300 |
commit | 9ef84b691c66df2934d44e0f219871298a9db033 (patch) | |
tree | d447944421c1df79c6eec120e76ee4f647ec398e /tdenewstuff | |
parent | 46247912ded4703cf9b598ccd987f41fd772016a (diff) | |
download | tdelibs-9ef84b691c66df2934d44e0f219871298a9db033.tar.gz tdelibs-9ef84b691c66df2934d44e0f219871298a9db033.zip |
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 ad5ff1e0125d57c5cb413387553092672843eeb6)
Diffstat (limited to 'tdenewstuff')
-rw-r--r-- | tdenewstuff/knewstuff.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tdenewstuff/knewstuff.cpp b/tdenewstuff/knewstuff.cpp index ad4f0fb98..3fb2b72ce 100644 --- a/tdenewstuff/knewstuff.cpp +++ b/tdenewstuff/knewstuff.cpp @@ -69,10 +69,14 @@ void TDENewStuff::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" ) + - TDEApplication::randomString( 10 ); + TDEApplication::randomString( 10 ) + ext; } void TDENewStuff::upload() |