]> Shamusworld >> Repos - architektonas/blobdiff - src/base/scriptlist.cpp
Removed unnecessary RS_ prefix from classes and whatnot.
[architektonas] / src / base / scriptlist.cpp
index 4b6b007f9f2d4afb31fae39fecd6e597741f64ca..4fc8d640d32895e141d3ee35ec959ef8b0b0558c 100644 (file)
 
 #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 !!!"
@@ -33,7 +33,7 @@ RS_ScriptList::RS_ScriptList(): scriptIterator(scripts)
     //activeScript = NULL;
 }
 
-/*virtual*/ RS_ScriptList::~RS_ScriptList()
+/*virtual*/ ScriptList::~ScriptList()
 {
        while (!scripts.isEmpty())
                delete scripts.takeFirst();
@@ -42,51 +42,51 @@ RS_ScriptList::RS_ScriptList(): scriptIterator(scripts)
 /**
  * @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();
 }
@@ -96,9 +96,9 @@ int RS_ScriptList::countScripts()
  * 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);
@@ -109,7 +109,7 @@ void RS_ScriptList::removeScript(RS_Script * 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);
     //}
 
@@ -127,20 +127,20 @@ void RS_ScriptList::removeScript(RS_Script * 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)
                {
@@ -154,7 +154,7 @@ RS_Script * RS_ScriptList::requestScript(const QString & name)
 }
 
 //! @return First script of the list.
-RS_Script * RS_ScriptList::firstScript()
+Script * ScriptList::firstScript()
 {
 //     return scripts.first();
        scriptIterator.toFront();
@@ -164,7 +164,7 @@ RS_Script * RS_ScriptList::firstScript()
 /** @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();
@@ -174,17 +174,17 @@ RS_Script * RS_ScriptList::nextScript()
  * @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;
 }