21 #include <tdeaction.h>
22 #include <tdeapplication.h>
24 #include <tdelocale.h>
25 #include <kstandarddirs.h>
29 #include "knewstuff.h"
33 TDEAction* KNS::standardAction(
const TQString& what,
34 const TQObject *recvr,
35 const char *slot, TDEActionCollection* parent,
38 return new TDEAction(i18n(
"Download New %1").arg(what),
"knewstuff",
39 0, recvr, slot, parent, name);
44 mEngine =
new Engine(
this, type, parentWidget );
49 mEngine =
new Engine(
this, type, providerList, parentWidget );
54 return mEngine->type();
59 return mEngine->parentWidget();
62 TDENewStuff::~TDENewStuff()
75 TQString ext = entry->
payload().fileName().section(
'.', 1);
76 if ( ! ext.isEmpty() ) ext =
"." + ext;
78 return TDEGlobal::dirs()->saveLocation(
"tmp" ) +
79 TDEApplication::randomString( 10 ) + ext;
89 mEngine->upload(fileName, previewName);
Central class combining all possible TDENewStuff operations.
TDENewStuff data entry container.
KURL payload(const TQString &lang=TQString::null) const
Retrieve the file name of the object.
virtual TQString downloadDestination(KNS::Entry *entry)
Return a filename which should be used as destination for downloading the specified new stuff entry.
TQString type() const
Return type of data.
TQWidget * parentWidget() const
Return parent widget.
void upload()
Start upload process.
TDENewStuff(const TQString &type, TQWidget *parentWidget=0)
Constructor.
void download()
Start download process.
Handles security releated issues, like signing, verifying.