summaryrefslogtreecommitdiffstats
path: root/tdenewstuff/knewstuff.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdenewstuff/knewstuff.cpp')
-rw-r--r--tdenewstuff/knewstuff.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tdenewstuff/knewstuff.cpp b/tdenewstuff/knewstuff.cpp
index ad4f0fb98..fe3358698 100644
--- a/tdenewstuff/knewstuff.cpp
+++ b/tdenewstuff/knewstuff.cpp
@@ -22,7 +22,7 @@
#include <tdeapplication.h>
#include <kdebug.h>
#include <tdelocale.h>
-#include <kstandarddirs.h>
+#include <tdestandarddirs.h>
#include "engine.h"
@@ -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()