]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/actionblocksremove.cpp
In the middle of major refactoring...
[architektonas] / src / actions / actionblocksremove.cpp
similarity index 64%
rename from src/actions/rs_actionblocksremove.cpp
rename to src/actions/actionblocksremove.cpp
index f1aa15b5d71f11d31b92ca2f7e5c76fac0437737..9e9ffc2432c1aeaf1103e488000f38311aa08d2c 100644 (file)
@@ -1,4 +1,4 @@
-// rs_actionblocksremove.cpp
+// actionblocksremove.cpp
 //
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
@@ -12,7 +12,7 @@
 // JLH  06/03/2010  Added this text. :-)
 //
 
-#include "rs_actionblocksremove.h"
+#include "actionblocksremove.h"
 
 #include "rs_block.h"
 #include "rs_dialogfactory.h"
 #include "graphicview.h"
 #include "rs_insert.h"
 
-RS_ActionBlocksRemove::RS_ActionBlocksRemove(RS_EntityContainer & container, GraphicView & graphicView):
-       RS_ActionInterface("Remove Block", container, graphicView)
+ActionBlocksRemove::ActionBlocksRemove(RS_EntityContainer & container, GraphicView & graphicView):
+       ActionInterface("Remove Block", container, graphicView)
 {
 }
 
-RS_ActionBlocksRemove::~RS_ActionBlocksRemove()
+ActionBlocksRemove::~ActionBlocksRemove()
 {
 }
 
-void RS_ActionBlocksRemove::trigger()
+void ActionBlocksRemove::trigger()
 {
-       RS_DEBUG->print("RS_ActionBlocksRemove::trigger");
+       RS_DEBUG->print("ActionBlocksRemove::trigger");
 
-       if (graphic != NULL)
+       if (graphic)
        {
                RS_Block * block = RS_DIALOGFACTORY->requestBlockRemovalDialog(graphic->getBlockList());
 
                // list of containers that might refer to the block via inserts:
-//        Q3PtrList<RS_EntityContainer> containerList;
                QList<RS_EntityContainer *> containerList;
                containerList.append(graphic);
                RS_BlockList * blkLst = graphic->getBlockList();
 
-               for (uint bi = 0; bi < blkLst->count(); bi++)
+               for(uint bi=0; bi<blkLst->count(); bi++)
                        containerList.append(blkLst->at(bi));
 
-               if (block != NULL)
+               if (block)
                {
-//                     for (RS_EntityContainer * cont=containerList.first(); cont!=NULL;
-//                             cont=containerList.next())
-                       for (int i = 0; i < containerList.size(); i++)
+                       for(int i=0; i<containerList.size(); i++)
                        {
                                RS_EntityContainer * cont = containerList[i];
                                // remove all inserts from the graphic:
@@ -60,8 +57,9 @@ void RS_ActionBlocksRemove::trigger()
                                {
                                        done = true;
 
-                                       for (RS_Entity * e = cont->firstEntity(RS2::ResolveNone); e != NULL;
-                                            e = cont->nextEntity(RS2::ResolveNone))
+                                       for(RS_Entity * e=cont->firstEntity(RS2::ResolveNone); e!=NULL;
+                                            e=cont->nextEntity(RS2::ResolveNone))
+                                       {
                                                if (e->rtti() == RS2::EntityInsert)
                                                {
                                                        RS_Insert * ins = (RS_Insert *)e;
@@ -73,12 +71,13 @@ void RS_ActionBlocksRemove::trigger()
                                                                break;
                                                        }
                                                }
+                                       }
                                }
                                while (!done);
                        }
 
                        // close all windows that are editing this block:
-                       if (RS_DIALOGFACTORY != NULL)
+                       if (RS_DIALOGFACTORY)
                                RS_DIALOGFACTORY->closeEditBlockWindow(block);
 
                        // Now remove the block from the block list:
@@ -92,9 +91,8 @@ void RS_ActionBlocksRemove::trigger()
        RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
 }
 
-void RS_ActionBlocksRemove::init(int status)
+void ActionBlocksRemove::init(int status)
 {
-       RS_ActionInterface::init(status);
+       ActionInterface::init(status);
        trigger();
 }
-