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"
kdbgstream kdDebug(int area=0)
void stopAction()
Stop the currently running scripts operations.
virtual void setItems(const TQStringList &lst)
TQString readType() const
virtual TDEActionCollection * actionCollection() const
ScriptLoader(TDEMainWindow *parent=0)
Default Constructor.
virtual TQString currentText() const
TDESelectAction * getScripts()
Return the a TDESelectAction with all of the scripts.
kndbgstream & endl(kndbgstream &s)
void runAction()
Run the current action.
TQString locate(const char *type, const TQString &filename, const TDEInstance *instance=TDEGlobal::instance())
TQString readName() const
This class is the base for all script engines.
static bool isDesktopFile(const TQString &path)