<commit_before>// /////////////////////////////////////////////////////////////////
// Generated by dtkPluginGenerator
// /////////////////////////////////////////////////////////////////

#include "qtdcmDataSource.h"

#include <medSql/medDatabaseImporter.h>
#include <medSql/medDatabaseController.h>
#include <medCore/medJobManager.h>
#include <medCore/medAbstractDataSourceFactory.h>
#include <medToolBox.h>

#include <QtDcm.h>
#include <QtDcmLocalDicomSettingsWidget.h>
#include <QtDcmServersDicomSettingsWidget.h>
#include <QtDcmManager.h>
#include <QtDcmPreferences.h>

#include <dtkCore/dtkAbstractDataReader.h>
#include <dtkCore/dtkAbstractDataFactory.h>
#include <dtkCore/dtkAbstractData.h>

#include <qtdcmDataSourcePreviewToolBox.h>
#include <qtdcmDataSourceImportToolBox.h>
#include <qtdcmDataSourceSerieInfoToolBox.h>
#include <qtdcmDataSourceServersSettingsToolBox.h>

// /////////////////////////////////////////////////////////////////
// qtdcmDataSourcePrivate
// /////////////////////////////////////////////////////////////////

class qtdcmDataSourcePrivate
{
public:
    QtDcm * mainWidget;
    QWidget * rightWidget;
    QtDcmLocalDicomSettingsWidget * localDicomSettingsWidget;
    QtDcmServersDicomSettingsWidget * serversDicomSettingsWidget;
    qtdcmDataSourcePreviewToolBox * previewToolBox;
    qtdcmDataSourceImportToolBox * importToolBox;
    qtdcmDataSourceSerieInfoToolBox * serieInfoToolBox;
    qtdcmDataSourceServersSettingsToolBox * serversSettingsToolBox;

    QList <medToolBox *> additional_toolboxes;

    ~qtdcmDataSourcePrivate();
};

qtdcmDataSourcePrivate::~qtdcmDataSourcePrivate()
{
    delete mainWidget;
    delete rightWidget;
}

// /////////////////////////////////////////////////////////////////
// qtdcmDataSource
// /////////////////////////////////////////////////////////////////

qtdcmDataSource::qtdcmDataSource ( void ) : medAbstractDataSource(), d ( new qtdcmDataSourcePrivate )
{
    d->mainWidget = NULL;
    d->rightWidget = NULL;

    // Create gui for the right Widget;
    d->localDicomSettingsWidget = new QtDcmLocalDicomSettingsWidget;

    QPushButton * localSettingsButton = new QPushButton;
    localSettingsButton->setText ( "Save settings" );
    localSettingsButton->setFocusPolicy ( Qt::NoFocus );
    localSettingsButton->setToolTip(tr("Save local Dicom settings"));
    localSettingsButton->setMaximumWidth ( 100 );
    QObject::connect ( localSettingsButton, SIGNAL ( clicked() ), this, SLOT ( onSaveLocalSettings() ) );

    QHBoxLayout * buttonLayout = new QHBoxLayout;
    buttonLayout->addStretch();
    buttonLayout->addWidget(localSettingsButton);
    buttonLayout->addStretch();

    QVBoxLayout * layout = new QVBoxLayout;
    layout->addWidget ( d->localDicomSettingsWidget );
    layout->addLayout(buttonLayout);
    layout->addStretch();

    d->rightWidget = new QWidget;
    d->rightWidget->setLayout ( layout );

    d->previewToolBox = new qtdcmDataSourcePreviewToolBox;
    d->importToolBox = new qtdcmDataSourceImportToolBox;
    d->serieInfoToolBox = new qtdcmDataSourceSerieInfoToolBox;
    d->serversSettingsToolBox = new qtdcmDataSourceServersSettingsToolBox;
    d->serversSettingsToolBox->switchMinimize();
<commit_msg>Delete all objects in qtdcmDataSource<commit_after>// /////////////////////////////////////////////////////////////////
// Generated by dtkPluginGenerator
// /////////////////////////////////////////////////////////////////

#include "qtdcmDataSource.h"

#include <medSql/medDatabaseImporter.h>
#include <medSql/medDatabaseController.h>
#include <medCore/medJobManager.h>
#include <medCore/medAbstractDataSourceFactory.h>
#include <medToolBox.h>

#include <QtDcm.h>
#include <QtDcmLocalDicomSettingsWidget.h>
#include <QtDcmServersDicomSettingsWidget.h>
#include <QtDcmManager.h>
#include <QtDcmPreferences.h>

#include <dtkCore/dtkAbstractDataReader.h>
#include <dtkCore/dtkAbstractDataFactory.h>
#include <dtkCore/dtkAbstractData.h>

#include <qtdcmDataSourcePreviewToolBox.h>
#include <qtdcmDataSourceImportToolBox.h>
#include <qtdcmDataSourceSerieInfoToolBox.h>
#include <qtdcmDataSourceServersSettingsToolBox.h>

// /////////////////////////////////////////////////////////////////
// qtdcmDataSourcePrivate
// /////////////////////////////////////////////////////////////////

class qtdcmDataSourcePrivate
{
public:
    QtDcm * mainWidget;
    QWidget * rightWidget;
    QtDcmLocalDicomSettingsWidget * localDicomSettingsWidget;
    QtDcmServersDicomSettingsWidget * serversDicomSettingsWidget;
    qtdcmDataSourcePreviewToolBox * previewToolBox;
    qtdcmDataSourceImportToolBox * importToolBox;
    qtdcmDataSourceSerieInfoToolBox * serieInfoToolBox;
    qtdcmDataSourceServersSettingsToolBox * serversSettingsToolBox;

    QList <medToolBox *> additional_toolboxes;
    
    QPushButton * localSettingsButton;

    ~qtdcmDataSourcePrivate();
};

qtdcmDataSourcePrivate::~qtdcmDataSourcePrivate()
{
    if (mainWidget)
        delete mainWidget;
    
    if (rightWidget)
        delete rightWidget;
    
    if (localSettingsButton)
        delete localSettingsButton;
    
    qDeleteAll(additional_toolboxes);
}

// /////////////////////////////////////////////////////////////////
// qtdcmDataSource
// /////////////////////////////////////////////////////////////////

qtdcmDataSource::qtdcmDataSource ( void ) : medAbstractDataSource(), d ( new qtdcmDataSourcePrivate )
{
    d->mainWidget = NULL;
    d->rightWidget = NULL;

    // Create gui for the right Widget;
    d->localDicomSettingsWidget = new QtDcmLocalDicomSettingsWidget;

    d->localSettingsButton = new QPushButton;
    d->localSettingsButton->setText ( "Save settings" );
    d->localSettingsButton->setFocusPolicy ( Qt::NoFocus );
    d->localSettingsButton->setToolTip(tr("Save local Dicom settings"));
    d->localSettingsButton->setMaximumWidth ( 100 );
    QObject::connect ( d->localSettingsButton, SIGNAL ( clicked() ), this, SLOT ( onSaveLocalSettings() ) );

    QHBoxLayout * buttonLayout = new QHBoxLayout;
    buttonLayout->addStretch();
    buttonLayout->addWidget(d->localSettingsButton);
    buttonLayout->addStretch();

    QVBoxLayout * layout = new QVBoxLayout;
    layout->addWidget ( d->localDicomSettingsWidget );
    layout->addLayout(buttonLayout);
    layout->addStretch();

    d->rightWidget = new QWidget;
    d->rightWidget->setLayout ( layout );

    d->previewToolBox = new qtdcmDataSourcePreviewToolBox;
    d->importToolBox = new qtdcmDataSourceImportToolBox;
    d->serieInfoToolBox = new qtdcmDataSourceSerieInfoToolBox;
    d->serversSettingsToolBox = new qtdcmDataSourceServersSettingsToolBox;
    d->serversSettingsToolBox->switchMinimize();

{'fraction_non_alphanumeric': 0.20500149745432764, 'fraction_numerical': 0.0008984725965858042, 'mean_word_length': 2.8340987370838118, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 92, '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': '955912', 'n_tokens_mistral': 1867, 'n_tokens_neox': 1841, 'n_words': 302}