void DirectoryContentsList::clear()
{
    stopSearching();

    if (files.size() > 0)
    {
        files.clear();
        changed();
    }
}
DirectoryContentsList::~DirectoryContentsList()
{
    stopSearching();
}
    maxDepthSpinBox = new QSpinBox;
    maxDepthSpinBox->setRange(1, INT_MAX);

    estimatedTimeLabel = new QLabel;
    estimatedTimeLabel->setStyleSheet("QLabel { color : red; }");

    connect(modeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setEstimatedTimeLabel(int)));
    connect(maxInvoledSingularitiesSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setEstimatedTimeLabel(int)));
    connect(maxDepthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setEstimatedTimeLabel(int)));
    setEstimatedTimeLabel();

    searchButton = new QPushButton(tr("Search"));
    connect(searchButton, SIGNAL(clicked()), this, SLOT(startSearch()));

    stopButton = new QPushButton(tr("Stop"));
    connect(stopButton, SIGNAL(clicked()), this, SLOT(stopSearching()));

    generateCandidatesButton = new QPushButton(tr("Generate pseudo-anosov candidates"));
    connect(generateCandidatesButton, SIGNAL(clicked()), this, SLOT(generateCandidates()));

    QHBoxLayout* lineLayout = new QHBoxLayout;
    lineLayout->addWidget(modeLabel);
    lineLayout->addWidget(modeComboBox);
    lineLayout->addWidget(maxInvoledSingularitiesLabel);
    lineLayout->addWidget(maxInvoledSingularitiesSpinBox);
    lineLayout->addWidget(maxDepthLabel);
    lineLayout->addWidget(maxDepthSpinBox);
    lineLayout->addStretch(1);


    QHBoxLayout* lineLayout2 = new QHBoxLayout;