<commit_before>/* medDropSite.cpp --- 
 * 
 * Author: <NAME>
 * Copyright (C) 2008 - <NAME>, Inria.
 * Created: Fri Feb 19 17:41:43 2010 (+0100)
 * Version: $Id$
 * Last-Updated: Mon Feb 22 21:15:03 2010 (+0100)
 *           By: <NAME>
 *     Update #: 18
 */

/* Commentary: 
 * 
 */

/* Change log:
 * 
 */

#include "medViewPool.h"
#include <medMessageController.h>
#include <medAbstractView.h>
#include <medAbstractViewCollection.h>

#include <dtkCore/dtkAbstractData.h>
#include <dtkCore/dtkAbstractProcess.h>
#include <dtkCore/dtkAbstractProcessFactory.h>
#include <dtkCore/dtkSmartPointer.h>

#include "medMessageController.h"

class medViewPoolPrivate
{
public:
    QList< dtkSmartPointer<medAbstractView> > views;
    QMap< dtkSmartPointer<medAbstractView>, dtkSmartPointer<dtkAbstractData> > viewData;
    QHash<QString, QString>                  propertySet;
};

medViewPool::medViewPool(QObject *parent) : QObject (parent), d (new medViewPoolPrivate)
{
    connect(this,SIGNAL(showInfo(QObject*,const QString&,unsigned int)),
            medMessageController::instance(),SLOT(showInfo(QObject*,const QString&,unsigned int)));
    connect(this,SIGNAL(showError(QObject*,const QString&,unsigned int)),
            medMessageController::instance(),SLOT(showError(QObject*,const QString&,unsigned int)));
}

medViewPool::~medViewPool(void)
{
    qDebug() << "medViewPool::~medViewPool" << (void*)this;
    qDebug() << "view count: " << d->views.count();

    delete d;
    d = NULL;
}

void medViewPool::appendView (medAbstractView *vview)
{
    if (!vview)
        return;
    
    QList <medAbstractView *> viewsToAdd;

    if (medAbstractViewCollection *collection = qobject_cast <medAbstractViewCollection *> (vview)) {<commit_msg>Removing calls to qDebug() in destructor as logger can be dead before the object itself -> results in a crash<commit_after>/* medDropSite.cpp --- 
 * 
 * Author: <NAME>
 * Copyright (C) 2008 - <NAME>, Inria.
 * Created: Fri Feb 19 17:41:43 2010 (+0100)
 * Version: $Id$
 * Last-Updated: Mon Feb 22 21:15:03 2010 (+0100)
 *           By: <NAME>
 *     Update #: 18
 */

/* Commentary: 
 * 
 */

/* Change log:
 * 
 */

#include "medViewPool.h"
#include <medMessageController.h>
#include <medAbstractView.h>
#include <medAbstractViewCollection.h>

#include <dtkCore/dtkAbstractData.h>
#include <dtkCore/dtkAbstractProcess.h>
#include <dtkCore/dtkAbstractProcessFactory.h>
#include <dtkCore/dtkSmartPointer.h>

#include "medMessageController.h"

class medViewPoolPrivate
{
public:
    QList< dtkSmartPointer<medAbstractView> > views;
    QMap< dtkSmartPointer<medAbstractView>, dtkSmartPointer<dtkAbstractData> > viewData;
    QHash<QString, QString>                  propertySet;
};

medViewPool::medViewPool(QObject *parent) : QObject (parent), d (new medViewPoolPrivate)
{
    connect(this,SIGNAL(showInfo(QObject*,const QString&,unsigned int)),
            medMessageController::instance(),SLOT(showInfo(QObject*,const QString&,unsigned int)));
    connect(this,SIGNAL(showError(QObject*,const QString&,unsigned int)),
            medMessageController::instance(),SLOT(showError(QObject*,const QString&,unsigned int)));
}

medViewPool::~medViewPool(void)
{
    delete d;
    d = NULL;
}

void medViewPool::appendView (medAbstractView *vview)
{
    if (!vview)
        return;
    
    QList <medAbstractView *> viewsToAdd;

    if (medAbstractViewCollection *collection = qobject_cast <medAbstractViewCollection *> (vview)) {
{'fraction_non_alphanumeric': 0.13779187085615452, 'fraction_numerical': 0.021908330931104066, 'mean_word_length': 4.438871473354232, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 41, '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': '894161', 'n_tokens_mistral': 1210, 'n_tokens_neox': 1123, 'n_words': 231}