19 #include "scriptloader.h"
21 #include <tdeapplication.h>
22 #include <tdeparts/part.h>
23 #include <tdeparts/componentfactory.h>
24 #include <tdeglobal.h>
26 #include <tdeconfig.h>
27 #include <kdesktopfile.h>
28 #include <kstandarsdirs.h>
29 #include <tdestdaccel.h>
33 #include <tqfileinfo.h>
48 ScriptLoader::~ScriptLoader()
57 TQStringList pluginList =
"";
59 TQString searchPath = kapp->name();
60 searchPath +=
"/scripts/";
61 TQDir d(
locate(
"data", searchPath));
63 const QFileInfoList *fileList = d.entryInfoList(
"*.desktop");
64 QFileInfoListIterator it ( *fileList );
67 while( (fi=it.current()))
74 KScriptInterface *tmpIface = KParts::ComponentFactory::createInstanceFromQuery<KScriptInterface>(desktop.
readType() );
77 m_scripts.append(tmpIface);
78 m_scripts.current()->setScript(desktop.
readURL());
81 pluginList.append(desktop.
readName());
104 #include "scriptloader.moc"
static bool isDesktopFile(const TQString &path)
TQString readType() const
TQString readName() const
This class is the base for all script engines.
virtual TDEActionCollection * actionCollection() const
void runAction()
Run the current action.
TDESelectAction * getScripts()
Return the a TDESelectAction with all of the scripts.
void stopAction()
Stop the currently running scripts operations.
ScriptLoader(TDEMainWindow *parent=0)
Default Constructor.
virtual TQString currentText() const
virtual void setItems(const TQStringList &lst)
kndbgstream & endl(kndbgstream &s)
kdbgstream kdDebug(int area=0)
TQString locate(const char *type, const TQString &filename, const TDEInstance *instance=TDEGlobal::instance())