<commit_before>#include "QmitkFunctionality.h"

#include <qlcdnumber.h>
#include <qslider.h>
#include <itkCommand.h>


QmitkFunctionality::QmitkFunctionality(QObject *parent, const char *name, mitk::DataTreeIteratorBase* dataIt) : 
  QObject(parent, name), m_Available(false), m_Activated(false), m_DataTreeIterator(NULL), m_TreeChangedWhileInActive(false), m_ObserverTag(0)
{
  setDataTree(dataIt);
}

QmitkFunctionality::~QmitkFunctionality()
{

}

QString QmitkFunctionality::getFunctionalityName()
{
	return name();
}

void QmitkFunctionality::activated()
{
  m_Activated = true;
  if(m_TreeChangedWhileInActive)
  {
    treeChanged();
    m_TreeChangedWhileInActive = false;
  }
}

void QmitkFunctionality::deactivated()
{
  m_Activated = false;
}

bool QmitkFunctionality::isActivated()
{
	return m_Activated;
}

bool QmitkFunctionality::isAvailable()
{
  return m_Available;
}

void QmitkFunctionality::setAvailability(bool available)
{
	this->m_Available=available;
	emit availabilityChanged(this);
	emit availabilityChanged();
}

void QmitkFunctionality::setDataTree(mitk::DataTreeIteratorBase* it)
{
  if(m_DataTreeIterator.IsNotNull()! )
  {
    m_DataTreeIterator->GetTree()->RemoveObserver(m_ObserverTag);
  }
	m_DataTreeIterator = it;
  if(m_DataTreeIterator.IsNotNull())
  {
    itk::ReceptorMemberCommand<QmitkFunctionality>::Pointer command = itk::ReceptorMemberCommand<QmitkFunctionality>::New();
    command->SetCallbackFunction(this, &QmitkFunctionality::treeChanged);
    m_ObserverTag = m_DataTreeIterator->GetTree()->AddObserver(itk::TreeChangeEvent<mitk::DataTreeBase>(), command);
  }
}

mitk::DataTreeIteratorBase* QmitkFunctionality::getDataTree()
{
	return m_DataTreeIterator.GetPointer();
}

void QmitkFunctionality::treeChanged(const itk::EventObject & treeChangedEvent)
{
  if(isActivated())
  {
    m_TreeChangedWhileInActive = false;
    treeChanged();
  }
  else
    m_TreeChangedWhileInActive = true;
}
<commit_msg>FIX: bug during warning fix<commit_after>#include "QmitkFunctionality.h"

#include <qlcdnumber.h>
#include <qslider.h>
#include <itkCommand.h>


QmitkFunctionality::QmitkFunctionality(QObject *parent, const char *name, mitk::DataTreeIteratorBase* dataIt) : 
  QObject(parent, name), m_Available(false), m_Activated(false), m_DataTreeIterator(NULL), m_TreeChangedWhileInActive(false), m_ObserverTag(0)
{
  setDataTree(dataIt);
}

QmitkFunctionality::~QmitkFunctionality()
{

}

QString QmitkFunctionality::getFunctionalityName()
{
	return name();
}

void QmitkFunctionality::activated()
{
  m_Activated = true;
  if(m_TreeChangedWhileInActive)
  {
    treeChanged();
    m_TreeChangedWhileInActive = false;
  }
}

void QmitkFunctionality::deactivated()
{
  m_Activated = false;
}

bool QmitkFunctionality::isActivated()
{
	return m_Activated;
}

bool QmitkFunctionality::isAvailable()
{
  return m_Available;
}

void QmitkFunctionality::setAvailability(bool available)
{
	this->m_Available=available;
	emit availabilityChanged(this);
	emit availabilityChanged();
}

void QmitkFunctionality::setDataTree(mitk::DataTreeIteratorBase* it)
{
  if(m_DataTreeIterator.IsNotNull() )
  {
    m_DataTreeIterator->GetTree()->RemoveObserver(m_ObserverTag);
  }
	m_DataTreeIterator = it;
  if(m_DataTreeIterator.IsNotNull())
  {
    itk::ReceptorMemberCommand<QmitkFunctionality>::Pointer command = itk::ReceptorMemberCommand<QmitkFunctionality>::New();
    command->SetCallbackFunction(this, &QmitkFunctionality::treeChanged);
    m_ObserverTag = m_DataTreeIterator->GetTree()->AddObserver(itk::TreeChangeEvent<mitk::DataTreeBase>(), command);
  }
}

mitk::DataTreeIteratorBase* QmitkFunctionality::getDataTree()
{
	return m_DataTreeIterator.GetPointer();
}

void QmitkFunctionality::treeChanged(const itk::EventObject & treeChangedEvent)
{
  if(isActivated())
  {
    m_TreeChangedWhileInActive = false;
    treeChanged();
  }
  else
    m_TreeChangedWhileInActive = true;
}

{'fraction_non_alphanumeric': 0.12215691285458727, 'fraction_numerical': 0.0005111167901865576, 'mean_word_length': 7.24, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1555560', 'n_tokens_mistral': 1333, 'n_tokens_neox': 1326, 'n_words': 178}