]> Shamusworld >> Repos - architektonas/blobdiff - src/base/rs_layerlist.cpp
Adding missing implementation.
[architektonas] / src / base / rs_layerlist.cpp
index def554bbad67b5b64e281161bc4cabb20b47e640..56c169e8c26ac58a0500875dca1ffee3205ee9a1 100644 (file)
@@ -3,7 +3,9 @@
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
 // Extensively rewritten and refactored by James L. Hammons
-// (C) 2010 Underground Software
+// Portions copyright (C) 2001-2003 RibbonSoft
+// Copyright (C) 2010 Underground Software
+// See the README and GPLv2 files for licensing and warranty information
 //
 // JLH = James L. Hammons <jlhamm@acm.org>
 //
 
 #include "rs_layerlist.h"
 
-#include "rs_layer.h"
-#include "rs_layerlistlistener.h"
+//#include "rs_layerlistlistener.h"
+#include "rs_debug.h"
 #include "rs_entity.h"
+#include "rs_layer.h"
 
 /**
  * Default constructor.
@@ -98,6 +101,7 @@ void RS_LayerList::activate(RS_Layer * layer, bool notify)
 
        activeLayer = layer;
 
+#if 0
        if (notify)
        {
                for(int i=0; i<layerListListeners.count(); ++i)
@@ -107,6 +111,7 @@ void RS_LayerList::activate(RS_Layer * layer, bool notify)
                        RS_DEBUG->print("RS_LayerList::activate listener notified");
                }
        }
+#endif
 
        RS_DEBUG->print("RS_LayerList::activate end");
 }
@@ -139,17 +144,19 @@ void RS_LayerList::add(RS_Layer * layer)
        {
                layers.append(layer);
 
+#if 0
                // notify listeners
                for(int i=0; i<layerListListeners.count(); ++i)
                {
                        RS_LayerListListener * l = layerListListeners.at(i);
                        l->layerAdded(layer);
                }
+#endif
 
                setModified(true);
 
                // if there was no active layer so far, activate this one.
-               if (activeLayer ==NULL)
+               if (activeLayer == NULL)
                        activate(layer);
        }
        else
@@ -184,11 +191,13 @@ void RS_LayerList::remove(RS_Layer * layer)
        if (idx != -1)
                layers.takeAt(idx);
 
+#if 0
        for(int i=0; i<layerListListeners.count(); ++i)
        {
                RS_LayerListListener * l = layerListListeners.at(i);
                l->layerRemoved(layer);
        }
+#endif
 
        setModified(true);
 
@@ -207,16 +216,18 @@ void RS_LayerList::remove(RS_Layer * layer)
  */
 void RS_LayerList::edit(RS_Layer * layer, const RS_Layer & source)
 {
-       if (layer == NULL)
+       if (!layer)
                return;
 
        *layer = source;
 
+#if 0
        for(int i=0; i<layerListListeners.count(); ++i)
        {
                RS_LayerListListener * l = layerListListeners.at(i);
                l->layerEdited(layer);
        }
+#endif
 
        setModified(true);
 }
@@ -231,7 +242,6 @@ RS_Layer * RS_LayerList::find(const QString & name)
 
        RS_Layer * ret = NULL;
 
-//     for(RS_Layer * l=layers.first(); l!=NULL; l=layers.next())
        for(int i=0; i<layers.size(); i++)
        {
                RS_Layer * l = layers[i];
@@ -330,17 +340,19 @@ void RS_LayerList::toggle(const QString & name)
  */
 void RS_LayerList::toggle(RS_Layer * layer)
 {
-       if (layer == NULL)
+       if (!layer)
                return;
 
        layer->toggle();
 
+#if 0
        // Notify listeners:
        for(int i=0; i < layerListListeners.count(); ++i)
        {
                RS_LayerListListener * l = layerListListeners.at(i);
                l->layerToggled(layer);
        }
+#endif
 }
 
 /**
@@ -349,17 +361,19 @@ void RS_LayerList::toggle(RS_Layer * layer)
  */
 void RS_LayerList::toggleLock(RS_Layer * layer)
 {
-       if (layer == NULL)
+       if (!layer)
                return;
 
        layer->toggleLock();
 
+#if 0
        // Notify listeners:
        for(int i=0; i<layerListListeners.count(); ++i)
        {
                RS_LayerListListener * l = layerListListeners.at(i);
                l->layerToggled(layer);
        }
+#endif
 }
 
 /**
@@ -372,13 +386,16 @@ void RS_LayerList::freezeAll(bool freeze)
        for(uint l=0; l<count(); l++)
                at(l)->freeze(freeze);
 
+#if 0
        for(int i=0; i<layerListListeners.count(); ++i)
        {
                RS_LayerListListener * l = layerListListeners.at(i);
                l->layerToggled(NULL);
        }
+#endif
 }
 
+#if 0
 /**
  * adds a LayerListListener to the list of listeners. Listeners
  * are notified when the layer list changes.
@@ -402,6 +419,7 @@ void RS_LayerList::removeListener(RS_LayerListListener * listener)
        if (i != -1)
                layerListListeners.takeAt(i);
 }
+#endif
 
 /**
  * Sets the layer lists modified status to 'm'.