<commit_before>#include "ReplayView.hpp"

#include "../Game/Replay.hpp"
#include "../Game/ParseError.hpp"
#include "../Game/GameReader.hpp"
#include "../Game/Players/Placeholder.hpp"

#include "../../app/FourInALine.hpp"
#include "../Settings/Sound.hpp"
#include "../Settings/View.hpp"
#include "../Settings/FourInALine.hpp"

#include "FileIO.hpp"

#include <QMessageBox>
#include <QWidget>
#include <QMessageBox>
#include <QFile>
#include <QTextStream>
#include <QFileDialog>
#include <QBuffer>

namespace GUI
{

/**
 * Creates a new replay view.
 *
 * @param manager View manager to use.
 */
ReplayView::ReplayView(ViewManager* manager)
    : AbstractView(manager), currentMoveNo(0)
{
	auto settings = ::FourInALine::getInstance()->getSettings();
	auto viewSettings = settings->getViewSettings();

	this->widget = new Widgets::Board(viewSettings->getTheme(), 0);

	this->updateThemeConnection = this->connect(viewSettings, &Settings::View::changed, [=]() {
		this->widget->setTheme(viewSettings->getTheme());
	});

	auto application = ::FourInALine::getInstance();
	auto soundSettings = application->getSettings()->getSoundSettings();

	this->connect(soundSettings, &::Settings::Sound::changed, this, &ReplayView::updateSoundSettings);
	this->updateSoundSettings();
}

/**
 * Frees all used resources.
 */
ReplayView::~ReplayView()
{
	QObject::disconnect(this->updateThemeConnection);
}

/**
 * Returns the central widget of this view.
 *
 * @return Widget for the view.
 */
QWidget* ReplayView::getWidget() const
{
	return this->widget;
}

/**
 * Returns whether there is a replay loaded or not.
 *
 * @return When a replay is loaded true, otherwise false.
 */
bool ReplayView::hasReplay() const
{
	return !this->replay.isNull();
}

/**
 * Returns whether the currently loaded replay has a next move or not.
 *
 * Returns false when no replay is loaded.
 *
 * @return When there is a next move true, otherwise false.
 */<commit_msg>Added missing delete.<commit_after>#include "ReplayView.hpp"

#include "../Game/Replay.hpp"
#include "../Game/ParseError.hpp"
#include "../Game/GameReader.hpp"
#include "../Game/Players/Placeholder.hpp"

#include "../../app/FourInALine.hpp"
#include "../Settings/Sound.hpp"
#include "../Settings/View.hpp"
#include "../Settings/FourInALine.hpp"

#include "FileIO.hpp"

#include <QMessageBox>
#include <QWidget>
#include <QMessageBox>
#include <QFile>
#include <QTextStream>
#include <QFileDialog>
#include <QBuffer>

namespace GUI
{

/**
 * Creates a new replay view.
 *
 * @param manager View manager to use.
 */
ReplayView::ReplayView(ViewManager* manager)
    : AbstractView(manager), currentMoveNo(0)
{
	auto settings = ::FourInALine::getInstance()->getSettings();
	auto viewSettings = settings->getViewSettings();

	this->widget = new Widgets::Board(viewSettings->getTheme(), 0);

	this->updateThemeConnection = this->connect(viewSettings, &Settings::View::changed, [=]() {
		this->widget->setTheme(viewSettings->getTheme());
	});

	auto application = ::FourInALine::getInstance();
	auto soundSettings = application->getSettings()->getSoundSettings();

	this->connect(soundSettings, &::Settings::Sound::changed, this, &ReplayView::updateSoundSettings);
	this->updateSoundSettings();
}

/**
 * Frees all used resources.
 */
ReplayView::~ReplayView()
{
	QObject::disconnect(this->updateThemeConnection);
	delete this->widget;
}

/**
 * Returns the central widget of this view.
 *
 * @return Widget for the view.
 */
QWidget* ReplayView::getWidget() const
{
	return this->widget;
}

/**
 * Returns whether there is a replay loaded or not.
 *
 * @return When a replay is loaded true, otherwise false.
 */
bool ReplayView::hasReplay() const
{
	return !this->replay.isNull();
}

/**
 * Returns whether the currently loaded replay has a next move or not.
 *
 * Returns false when no replay is loaded.
 *
 * @return When there is a next move true, otherwise false.
 */
{'fraction_non_alphanumeric': 0.16102564102564101, 'fraction_numerical': 0.0010256410256410256, 'mean_word_length': 4.857357357357357, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 50, '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': '5153964', 'n_tokens_mistral': 1230, 'n_tokens_neox': 1203, 'n_words': 306}