]> Shamusworld >> Repos - architektonas/blobdiff - src/widgets/qg_blockwidget.cpp
Removed useless *Listener class and references.
[architektonas] / src / widgets / qg_blockwidget.cpp
index 1c94e2296c4e7e4266346c543ffe8e318adbd44b..4be0f714a4f9d4ca068307dd3460a11a3df75c13 100644 (file)
 
 #include "qg_blockwidget.h"
 
+#include "qg_actionhandler.h"
+#include "rs_block.h"
+#include "rs_blocklist.h"
+#include "rs_debug.h"
+
 /**
  * Constructor.
  */
@@ -173,12 +178,12 @@ void QG_BlockWidget::update()
 
        RS_Block * activeBlock = NULL;
 
-       if (blockList != NULL)
+       if (blockList)
                activeBlock = blockList->getActive();
 
        listBox->clear();
 
-       if (blockList == NULL)
+       if (!blockList)
        {
                RS_DEBUG->print("QG_BlockWidget::update(): blockList is NULL");
                return;
@@ -218,7 +223,7 @@ void QG_BlockWidget::highlightBlock(RS_Block * block)
 {
        RS_DEBUG->print("QG_BlockWidget::highlightBlock()");
 
-       if (block == NULL || listBox == NULL)
+       if (!block || !listBox)
                return;
 
        blockList->activate(block);
@@ -228,10 +233,8 @@ void QG_BlockWidget::highlightBlock(RS_Block * block)
        {
                QListWidgetItem * item = listBox->item(i);
 
-//             if (listBox->text(i) == name)
                if (item->text() == name)
                {
-//                     listBox->setCurrentItem(i);
                        listBox->setCurrentRow(i);
                        break;
                }
@@ -294,7 +297,7 @@ void QG_BlockWidget::slotActivated(void)
        QString blockName = listBox->currentItem()->text();
        RS_DEBUG->print("QG_BlockWidget::slotActivated(): %s", blockName.toLatin1().data());
 
-       if (blockList == NULL)
+       if (!blockList)
                return;
 
        lastBlock = blockList->getActive();
@@ -317,7 +320,7 @@ void QG_BlockWidget::slotMouseButtonClicked(QListWidgetItem * item)
        }
        else
        {
-               if (item != NULL && blockList != NULL)
+               if (item && blockList)
                        lastBlock = blockList->find(item->text());
        }
 }