summaryrefslogtreecommitdiffstats
path: root/tdenewstuff
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2021-06-27 14:55:31 +0300
committerMavridis Philippe <mavridisf@gmail.com>2021-06-27 14:55:31 +0300
commitad5ff1e0125d57c5cb413387553092672843eeb6 (patch)
tree46340db9d55f903ca744a692e7c0ac4acbddb845 /tdenewstuff
parentf6db22575a797892ac1771d9cba2a225cb2b1660 (diff)
downloadtdelibs-ad5ff1e0125d57c5cb413387553092672843eeb6.tar.gz
tdelibs-ad5ff1e0125d57c5cb413387553092672843eeb6.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>
Diffstat (limited to 'tdenewstuff')
-rw-r--r--tdenewstuff/knewstuff.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tdenewstuff/knewstuff.cpp b/tdenewstuff/knewstuff.cpp
index ad4f0fb9..3fb2b72c 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()