19 #include "scriptloader.h" 21 #include <kapplication.h> 22 #include <kparts/part.h> 23 #include <kparts/componentfactory.h> 27 #include <kdesktopfile.h> 28 #include <kstandarsdirs.h> 29 #include <kstdaccel.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" ScriptLoader(KMainWindow *parent=0)
Default Constructor.
TQString locate(const char *type, const TQString &filename, const KInstance *instance=KGlobal::instance())
virtual KActionCollection * actionCollection() const
KSelectAction * getScripts()
Return the a KSelectAction with all of the scripts.
kdbgstream kdDebug(int area=0)
void stopAction()
Stop the currently running scripts operations.
TQString readType() const
virtual void setItems(const TQStringList &lst)
kndbgstream & endl(kndbgstream &s)
void runAction()
Run the current action.
TQString readName() const
This class is the base for all script engines.
static bool isDesktopFile(const TQString &path)
virtual TQString currentText() const