<commit_before>#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMessageBox>
#include <iostream>
#include <sstream>
#include <QCloseEvent>
#include <QColorDialog>
#include <chrono>
#include <thread>
#include "icononbuttonhandler.h"
#include "Video/shapes/shape.h"
#include "Analysis/MotionDetection.h"
#include "Analysis/AnalysisMethod.h"
#include "Analysis/analysiscontroller.h"

using namespace std;
using namespace cv;


/**
 * @brief MainWindow::MainWindow
 * @param parent a QWidget variable
 */
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow){
    ui->setupUi(this);
    video_slider = ui->video_slider;


    icon_on_button_handler = new IconOnButtonHandler();
    icon_on_button_handler->set_pictures_to_buttons(ui);

    // Setup a Bookmark View in the right sidebar in the GUI.
    bookmark_view = new BookmarkView(ui->document_list);

    setup_file_handler();

    // Add this object as a listener to video_frame.
    ui->video_frame->installEventFilter(this);
    ui->video_frame->setScaledContents(false);

    ui->project_tree->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(ui->project_tree, &QTreeWidget::customContextMenuRequested, this, &MainWindow::prepare_menu);

    //Creates and prepares the video_player.
    mvideo_player = new video_player(&mutex, &paused_wait, ui->video_frame);
    setup_video_player(mvideo_player);

    // TODO The following code is just here to test.
    // Remove when a proper implementation exists.
    m_acontroller = new AnalysisController("eng4k.mov",MOTION_DETECTION);
    m_acontroller->start();

    // Initially hide overlay and analysis toolbar
    ui->toolbar_overlay->hide();
    ui->toolbar_analysis->hide();

    // The video player is not in original size.
    original_size = false;
}


/**
 * @brief MainWindow::~MainWindow
 * Destructor
 */
MainWindow::~MainWindow() {

    delete icon_on_button_handler;
    delete file_handler;

    if (mvideo_player->is_paused())
        paused_wait.wakeOne();

    emit set_stop_video(); //Signaling the run function in mvideo_player to stop executing
    mvideo_player->wait(); //Waiting for video_player to finish executing
    delete mvideo_player;

    delete ui;
    delete bookmark_view;
}<commit_msg>Comment out run of analysis in mainwindow constructor<commit_after>#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMessageBox>
#include <iostream>
#include <sstream>
#include <QCloseEvent>
#include <QColorDialog>
#include <chrono>
#include <thread>
#include "icononbuttonhandler.h"
#include "Video/shapes/shape.h"
#include "Analysis/MotionDetection.h"
#include "Analysis/AnalysisMethod.h"
#include "Analysis/analysiscontroller.h"

using namespace std;
using namespace cv;


/**
 * @brief MainWindow::MainWindow
 * @param parent a QWidget variable
 */
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow){
    ui->setupUi(this);
    video_slider = ui->video_slider;


    icon_on_button_handler = new IconOnButtonHandler();
    icon_on_button_handler->set_pictures_to_buttons(ui);

    // Setup a Bookmark View in the right sidebar in the GUI.
    bookmark_view = new BookmarkView(ui->document_list);

    setup_file_handler();

    // Add this object as a listener to video_frame.
    ui->video_frame->installEventFilter(this);
    ui->video_frame->setScaledContents(false);

    ui->project_tree->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(ui->project_tree, &QTreeWidget::customContextMenuRequested, this, &MainWindow::prepare_menu);

    //Creates and prepares the video_player.
    mvideo_player = new video_player(&mutex, &paused_wait, ui->video_frame);
    setup_video_player(mvideo_player);

    // TODO The following code is just here to test.
    // Remove when a proper implementation exists.
    //m_acontroller = new AnalysisController("eng4k.mov",MOTION_DETECTION);
    //m_acontroller->start();

    // Initially hide overlay and analysis toolbar
    ui->toolbar_overlay->hide();
    ui->toolbar_analysis->hide();

    // The video player is not in original size.
    original_size = false;
}


/**
 * @brief MainWindow::~MainWindow
 * Destructor
 */
MainWindow::~MainWindow() {

    delete icon_on_button_handler;
    delete file_handler;

    if (mvideo_player->is_paused())
        paused_wait.wakeOne();

    emit set_stop_video(); //Signaling the run function in mvideo_player to stop executing
    mvideo_player->wait(); //Waiting for video_player to finish executing
    delete mvideo_player;

    delete ui;
    delete bookmark_view;
}
{'fraction_non_alphanumeric': 0.11202778983933999, 'fraction_numerical': 0.0004342162396873643, 'mean_word_length': 4.42, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 55, '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': '4974995', 'n_tokens_mistral': 1447, 'n_tokens_neox': 1395, 'n_words': 339}