#include "system.h"
-RS_ScriptList * RS_ScriptList::uniqueInstance = NULL;
+ScriptList * ScriptList::uniqueInstance = NULL;
/**
* Default constructor.
*/
-RS_ScriptList::RS_ScriptList(): scriptIterator(scripts)
+ScriptList::ScriptList(): scriptIterator(scripts)
{
//Should be dealt with...
//#warning "!!! Need to deal with setAutoDelete() Qt3->Qt4 !!!"
//activeScript = NULL;
}
-/*virtual*/ RS_ScriptList::~RS_ScriptList()
+/*virtual*/ ScriptList::~ScriptList()
{
while (!scripts.isEmpty())
delete scripts.takeFirst();
/**
* @return Instance to the unique script list.
*/
-/*static*/ RS_ScriptList * RS_ScriptList::instance()
+/*static*/ ScriptList * ScriptList::instance()
{
if (uniqueInstance == NULL)
- uniqueInstance = new RS_ScriptList();
+ uniqueInstance = new ScriptList();
return uniqueInstance;
}
/**
- * Initializes the script list by creating RS_Script
+ * Initializes the script list by creating Script
* objects, one for each script that could be found.
*/
-void RS_ScriptList::init()
+void ScriptList::init()
{
- RS_DEBUG->print("RS_ScriptList::initScripts");
+ DEBUG->print("ScriptList::initScripts");
scripts.clear();
- QStringList list = RS_SYSTEM->getScriptList();
- RS_Script * script;
+ QStringList list = SYSTEM->getScriptList();
+ Script * script;
for(QStringList::Iterator it=list.begin(); it!=list.end(); ++it)
{
- RS_DEBUG->print("script: %s:", (*it).toLatin1().data());
+ DEBUG->print("script: %s:", (*it).toLatin1().data());
QFileInfo fi(*it);
- script = new RS_Script(fi.baseName(), fi.absoluteFilePath());
+ script = new Script(fi.baseName(), fi.absoluteFilePath());
scripts.append(script);
- RS_DEBUG->print("base: %s", fi.baseName().toLatin1().data());
- RS_DEBUG->print("path: %s", fi.absoluteFilePath().toLatin1().data());
+ DEBUG->print("base: %s", fi.baseName().toLatin1().data());
+ DEBUG->print("path: %s", fi.absoluteFilePath().toLatin1().data());
}
- //RS_Script* f = new RS_Script("normal");
+ //Script* f = new Script("normal");
//scripts.append(f);
}
/**
* Removes all scripts in the scriptlist.
*/
-void RS_ScriptList::clearScripts()
+void ScriptList::clearScripts()
{
scripts.clear();
}
-int RS_ScriptList::countScripts()
+int ScriptList::countScripts()
{
return scripts.count();
}
* Listeners are notified after the script was removed from
* the list but before it gets deleted.
*/
-void RS_ScriptList::removeScript(RS_Script * script)
+void ScriptList::removeScript(Script * script)
{
- RS_DEBUG->print("RS_ScriptList::removeScript()");
+ DEBUG->print("ScriptList::removeScript()");
// here the script is removed from the list but not deleted
// scripts.remove(script);
delete scripts.takeAt(i);
//for (uint i=0; i<scriptListListeners.count(); ++i) {
- // RS_ScriptListListener* l = scriptListListeners.at(i);
+ // ScriptListListener* l = scriptListListeners.at(i);
// l->scriptRemoved(script);
//}
* \p NULL if no such script was found. The script will be loaded into
* memory if it's not already.
*/
-RS_Script * RS_ScriptList::requestScript(const QString & name)
+Script * ScriptList::requestScript(const QString & name)
{
- RS_DEBUG->print("RS_ScriptList::requestScript %s", name.toLatin1().data());
+ DEBUG->print("ScriptList::requestScript %s", name.toLatin1().data());
QString name2 = name.toLower();
- RS_Script * foundScript = NULL;
+ Script * foundScript = NULL;
- RS_DEBUG->print("name2: %s", name2.toLatin1().data());
+ DEBUG->print("name2: %s", name2.toLatin1().data());
// Search our list of available scripts:
-// for(RS_Script * s=scripts.first(); s!=NULL; s=scripts.next())
+// for(Script * s=scripts.first(); s!=NULL; s=scripts.next())
for(int i=0; i<scripts.size(); i++)
{
- RS_Script * s = scripts[i];
+ Script * s = scripts[i];
if (s->getName() == name2)
{
}
//! @return First script of the list.
-RS_Script * RS_ScriptList::firstScript()
+Script * ScriptList::firstScript()
{
// return scripts.first();
scriptIterator.toFront();
/** @return Next script from the list after
* calling firstScript() or nextScript().
*/
-RS_Script * RS_ScriptList::nextScript()
+Script * ScriptList::nextScript()
{
// return scripts.next();
return scriptIterator.next();
* @return Pointer to the script with the given name or
* \p NULL if no such script was found.
*/
-//RS_Script* RS_ScriptList::loadScript(const QString& name) {
+//Script* ScriptList::loadScript(const QString& name) {
//}
/**
* Tests the script list and its ability to load scripts.
*/
-bool RS_ScriptList::test()
+bool ScriptList::test()
{
- //RS_ScriptList* l = RS_ScriptList::instance();
+ //ScriptList* l = ScriptList::instance();
- //std::cout << "RS_ScriptList: " << *l << std::endl;
+ //std::cout << "ScriptList: " << *l << std::endl;
return true;
}