22#include <tdeapplication.h>
25#include <tdestandarddirs.h>
33TDEAction* 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);
54 return mEngine->
type();
62TDENewStuff::~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.
void download()
Initiates the download process, retrieving provider lists and invoking the download dialog.
TQString type() const
Returns the previously set data type.
TQWidget * parentWidget() const
Returns the previously set parent widget.
void upload(const TQString &fileName=TQString::null, const TQString &previewName=TQString::null)
Initiates the upload process, invoking the provider selection dialog and the file upload dialog.
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.