<commit_before>/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (<EMAIL>)
**
** This file is part of mhome.
**
** If you have questions regarding the use of this file, please contact
** Nokia at <EMAIL>.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/

#include "mainwindow.h"
#include "homeapplication.h"
#include "x11wrapper.h"

int main(int argc, char *argv[])
{
    HomeApplication app(argc, argv, QString("meegotouchhome"));

    MainWindow *mainWindow = MainWindow::instance(true);
    mainWindow->show();

    // Tell X that changes in the properties and the substructure of the root
    // window are interesting. These are used to get the list of windows and
    // for getting window close events. Note that QWidget calls XSelectInput
    // as well so this call cannot be done in the HomeApplication constructor
    // since Qt's own call would then override this.
    X11Wrapper::XSelectInput(QX11Info::display(), DefaultRootWindow(QX11Info::display()), PropertyChangeMask | SubstructureNotifyMask);

    return app.exec();
}<commit_msg>Changes: Destroy the main window on exit<commit_after>/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (<EMAIL>)
**
** This file is part of mhome.
**
** If you have questions regarding the use of this file, please contact
** Nokia at <EMAIL>.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/

#include "mainwindow.h"
#include "homeapplication.h"
#include "x11wrapper.h"

int main(int argc, char *argv[])
{
    HomeApplication app(argc, argv, QString("meegotouchhome"));

    MainWindow *mainWindow = MainWindow::instance(true);
    mainWindow->show();
    QObject::connect(&app, SIGNAL(aboutToQuit()), mainWindow, SLOT(deleteLater()));

    // Tell X that changes in the properties and the substructure of the root
    // window are interesting. These are used to get the list of windows and
    // for getting window close events. Note that QWidget calls XSelectInput
    // as well so this call cannot be done in the HomeApplication constructor
    // since Qt's own call would then override this.
    X11Wrapper::XSelectInput(QX11Info::display(), DefaultRootWindow(QX11Info::display()), PropertyChangeMask | SubstructureNotifyMask);

    return app.exec();
}
{'fraction_non_alphanumeric': 0.18863131152746904, 'fraction_numerical': 0.00889171165449349, 'mean_word_length': 4.8441558441558445, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '4180806', 'n_tokens_mistral': 819, 'n_tokens_neox': 757, 'n_words': 336}