]> Shamusworld >> Repos - architektonas/blobdiff - src/base/blocklist.cpp
Removed unnecessary RS_ prefix from classes and whatnot.
[architektonas] / src / base / blocklist.cpp
index 98045470d4d5e8d3b27b425a8fbec70cfe6217a2..31d8601a4a8689e8ca975452c6ab59927e114de0 100644 (file)
@@ -25,7 +25,7 @@
  *              If so, the blocks will be deleted when the block
  *              list is deleted.
  */
-RS_BlockList::RS_BlockList(bool owner)
+BlockList::BlockList(bool owner)
 {
        this->owner = owner;
        //blocks.setAutoDelete(owner);
@@ -36,14 +36,14 @@ RS_BlockList::RS_BlockList(bool owner)
        setModified(false);
 }
 
-/*virtual*/ RS_BlockList::~RS_BlockList()
+/*virtual*/ BlockList::~BlockList()
 {
 }
 
 /**
  * Removes all blocks in the blocklist.
  */
-void RS_BlockList::clear()
+void BlockList::clear()
 {
        blocks.clear();
        setModified(true);
@@ -52,7 +52,7 @@ void RS_BlockList::clear()
 /**
  * @return Number of blocks available.
  */
-uint RS_BlockList::count()
+uint BlockList::count()
 {
        return blocks.count();
 }
@@ -60,7 +60,7 @@ uint RS_BlockList::count()
 /**
  * @return Block at given position or NULL if i is out of range.
  */
-RS_Block * RS_BlockList::at(uint i)
+Block * BlockList::at(uint i)
 {
        return blocks.at(i);
 }
@@ -69,9 +69,9 @@ RS_Block * RS_BlockList::at(uint i)
  * Activates the given block.
  * Listeners are notified.
  */
-void RS_BlockList::activate(const QString & name)
+void BlockList::activate(const QString & name)
 {
-       RS_DEBUG->print("RS_BlockList::activateBlock");
+       DEBUG->print("BlockList::activateBlock");
 
        activate(find(name));
 }
@@ -80,14 +80,14 @@ void RS_BlockList::activate(const QString & name)
  * Activates the given block.
  * Listeners are notified.
  */
-void RS_BlockList::activate(RS_Block * block)
+void BlockList::activate(Block * block)
 {
-       RS_DEBUG->print("RS_BlockList::activateBlock");
+       DEBUG->print("BlockList::activateBlock");
        activeBlock = block;
 
        /*
                for (uint i=0; i<blockListListeners.count(); ++i) {
-                       RS_BlockListListener* l = blockListListeners.at(i);
+                       BlockListListener* l = blockListListeners.at(i);
                if (l!=NULL) {
                        l->blockActivated(activeBlock);
                }
@@ -96,7 +96,7 @@ void RS_BlockList::activate(RS_Block * block)
 }
 
 //! @return The active block of NULL if no block is activated.
-RS_Block * RS_BlockList::getActive()
+Block * BlockList::getActive()
 {
        return activeBlock;
 }
@@ -110,15 +110,15 @@ RS_Block * RS_BlockList::getActive()
  *
  * @return false: block already existed and was deleted.
  */
-bool RS_BlockList::add(RS_Block * block, bool notify)
+bool BlockList::add(Block * block, bool notify)
 {
-       RS_DEBUG->print("RS_BlockList::add()");
+       DEBUG->print("BlockList::add()");
 
        if (block == NULL)
                return false;
 
        // check if block already exists:
-       RS_Block * b = find(block->getName());
+       Block * b = find(block->getName());
 
        if (b == NULL)
        {
@@ -148,12 +148,12 @@ bool RS_BlockList::add(RS_Block * block, bool notify)
  * used after adding a lot of blocks without auto-update or simply
  * to force an update of GUI blocklists.
  */
-void RS_BlockList::addNotification()
+void BlockList::addNotification()
 {
 #if 0
        for(int i=0; i<blockListListeners.count(); ++i)
        {
-               RS_BlockListListener * l = blockListListeners.at(i);
+               BlockListListener * l = blockListListeners.at(i);
                l->blockAdded(NULL);
        }
 #endif
@@ -164,9 +164,9 @@ void RS_BlockList::addNotification()
  * Listeners are notified after the block was removed from
  * the list but before it gets deleted.
  */
-void RS_BlockList::remove(RS_Block * block)
+void BlockList::remove(Block * block)
 {
-       RS_DEBUG->print("RS_BlockList::removeBlock()");
+       DEBUG->print("BlockList::removeBlock()");
 
        // here the block is removed from the list but not deleted
 //     blocks.remove(block);
@@ -175,7 +175,7 @@ void RS_BlockList::remove(RS_Block * block)
 #if 0
        for(int i=0; i<blockListListeners.count(); ++i)
        {
-               RS_BlockListListener * l = blockListListeners.at(i);
+               BlockListListener * l = blockListListeners.at(i);
                l->blockRemoved(block);
        }
 #endif
@@ -203,7 +203,7 @@ void RS_BlockList::remove(RS_Block * block)
  * @retval true block was successfully renamed.
  * @retval false block couldn't be renamed.
  */
-bool RS_BlockList::rename(RS_Block * block, const QString & name)
+bool BlockList::rename(Block * block, const QString & name)
 {
        if (block != NULL)
        {
@@ -224,11 +224,11 @@ bool RS_BlockList::rename(RS_Block * block, const QString & name)
  * Listeners are notified.
  */
 /*
-void RS_BlockList::editBlock(RS_Block* block, const RS_Block& source) {
+void BlockList::editBlock(Block* block, const Block& source) {
        *block = source;
 
        for (uint i=0; i<blockListListeners.count(); ++i) {
-               RS_BlockListListener* l = blockListListeners.at(i);
+               BlockListListener* l = blockListListeners.at(i);
 
                l->blockEdited(block);
        }
@@ -239,13 +239,13 @@ void RS_BlockList::editBlock(RS_Block* block, const RS_Block& source) {
  * @return Pointer to the block with the given name or
  * \p NULL if no such block was found.
  */
-RS_Block * RS_BlockList::find(const QString & name)
+Block * BlockList::find(const QString & name)
 {
-       //RS_DEBUG->print("RS_BlockList::find");
+       //DEBUG->print("BlockList::find");
 
        for(uint i=0; i<count(); i++)
        {
-               RS_Block * b = at(i);
+               Block * b = at(i);
 
                if (b->getName() == name)
                        return b;
@@ -259,7 +259,7 @@ RS_Block * RS_BlockList::find(const QString & name)
  *
  * @param suggestion Suggested name the new name will be based on.
  */
-QString RS_BlockList::newName(const QString & suggestion)
+QString BlockList::newName(const QString & suggestion)
 {
        QString name;
 
@@ -278,7 +278,7 @@ QString RS_BlockList::newName(const QString & suggestion)
  * Switches on / off the given block.
  * Listeners are notified.
  */
-void RS_BlockList::toggle(const QString & name)
+void BlockList::toggle(const QString & name)
 {
        toggle(find(name));
 }
@@ -287,7 +287,7 @@ void RS_BlockList::toggle(const QString & name)
  * Switches on / off the given block.
  * Listeners are notified.
  */
-void RS_BlockList::toggle(RS_Block * block)
+void BlockList::toggle(Block * block)
 {
        if (block == NULL)
                return;
@@ -298,7 +298,7 @@ void RS_BlockList::toggle(RS_Block * block)
        // Notify listeners:
        for(int i=0; i<blockListListeners.count(); ++i)
        {
-               RS_BlockListListener * l = blockListListeners.at(i);
+               BlockListListener * l = blockListListeners.at(i);
 
                l->blockToggled(block);
        }
@@ -310,7 +310,7 @@ void RS_BlockList::toggle(RS_Block * block)
  *
  * @param freeze true: freeze, false: defreeze
  */
-void RS_BlockList::freezeAll(bool freeze)
+void BlockList::freezeAll(bool freeze)
 {
        for(uint l=0; l<count(); l++)
                at(l)->freeze(freeze);
@@ -318,7 +318,7 @@ void RS_BlockList::freezeAll(bool freeze)
 #if 0
        for(int i=0; i<blockListListeners.count(); ++i)
        {
-               RS_BlockListListener * l = blockListListeners.at(i);
+               BlockListListener * l = blockListListeners.at(i);
                l->blockToggled(NULL);
        }
 #endif
@@ -329,13 +329,13 @@ void RS_BlockList::freezeAll(bool freeze)
  * Listeners are notified.
  */
 /*
-void RS_BlockList::toggleBlock(const QString& name) {
-       RS_Block* block = findBlock(name);
+void BlockList::toggleBlock(const QString& name) {
+       Block* block = findBlock(name);
        block->toggle();
 
     // Notify listeners:
        for (uint i=0; i<blockListListeners.count(); ++i) {
-               RS_BlockListListener* l = blockListListeners.at(i);
+               BlockListListener* l = blockListListeners.at(i);
 
                l->blockToggled(block);
        }
@@ -347,7 +347,7 @@ void RS_BlockList::toggleBlock(const QString& name) {
  * are notified when the block list changes.
  */
 #if 0
-void RS_BlockList::addListener(RS_BlockListListener * listener)
+void BlockList::addListener(BlockListListener * listener)
 {
        blockListListeners.append(listener);
 }
@@ -355,7 +355,7 @@ void RS_BlockList::addListener(RS_BlockListListener * listener)
 /**
  * removes a BlockListListener from the list of listeners.
  */
-void RS_BlockList::removeListener(RS_BlockListListener * listener)
+void BlockList::removeListener(BlockListListener * listener)
 {
        blockListListeners.removeAll(listener);
 }
@@ -364,7 +364,7 @@ void RS_BlockList::removeListener(RS_BlockListListener * listener)
 /**
  * Sets the layer lists modified status to 'm'.
  */
-void RS_BlockList::setModified(bool m)
+void BlockList::setModified(bool m)
 {
        modified = m;
 }
@@ -373,7 +373,7 @@ void RS_BlockList::setModified(bool m)
  * @retval true The layer list has been modified.
  * @retval false The layer list has not been modified.
  */
-/*virtual*/ bool RS_BlockList::isModified() const
+/*virtual*/ bool BlockList::isModified() const
 {
        return modified;
 }
@@ -381,13 +381,13 @@ void RS_BlockList::setModified(bool m)
 /**
  * Dumps the blocks to stdout.
  */
-std::ostream & operator<<(std::ostream & os, RS_BlockList & b)
+std::ostream & operator<<(std::ostream & os, BlockList & b)
 {
        os << "Blocklist: \n";
 
        for(uint i=0; i<b.count(); ++i)
        {
-               RS_Block * blk = b.at(i);
+               Block * blk = b.at(i);
 
                os << *blk << "\n";
        }