<commit_before>/*
* Copyright (C) 2008-2012 <NAME> <<EMAIL>>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*/

#include "application.h"
#include "mainwindow.h"
#include <QNetworkProxy>
#include <QUrl>

#ifdef Q_WS_WIN
#include "qtwin.h"
#endif

static void setApplicationProxy(QUrl url)
{
    if (!url.isEmpty())
    {
        if (url.port() == -1)
            url.setPort(8080);
        QNetworkProxy proxy(QNetworkProxy::HttpProxy, url.host(), url.port(), url.userName(), url.password());
        QNetworkProxy::setApplicationProxy(proxy);
    }
}

int main (int argc, char* argv[])
{
    Application app(argc, argv);

    QStringList args = app.arguments();
    int index = args.indexOf("-proxy");
    if (index != -1)
        setApplicationProxy(QUrl(args.value(index + 1)));
    else
        setApplicationProxy(QUrl(qgetenv("http_proxy")));

    index = args.indexOf("-encoding");
    if (index != -1)
        Application::setEncoding(args.value(index + 1).toLocal8Bit());

    MainWindow window;
#ifdef Q_WS_WIN
    if (QtWin::isCompositionEnabled()) {
        QtWin::extendFrameIntoClientArea(&window);
        window.setContentsMargins(0, 0, 0, 0);
    }
#endif
    window.show();
    return app.exec();
}<commit_msg>desktop ex: revise cmd line args & env vars<commit_after>/*
* Copyright (C) 2008-2012 <NAME> <<EMAIL>>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*/

#include "application.h"
#include "mainwindow.h"
#include <QNetworkProxy>
#include <QUrl>

#ifdef Q_WS_WIN
#include "qtwin.h"
#endif

static void setApplicationProxy(QUrl url)
{
    if (!url.isEmpty())
    {
        if (url.port() == -1)
            url.setPort(8080);
        QNetworkProxy proxy(QNetworkProxy::HttpProxy, url.host(), url.port(), url.userName(), url.password());
        QNetworkProxy::setApplicationProxy(proxy);
    }
}

int main (int argc, char* argv[])
{
    Application app(argc, argv);
    MainWindow window;
    QStringList args = app.arguments();

    QUrl proxy;
    int index = args.indexOf("-proxy");
    if (index != -1)
        proxy = QUrl(args.value(index + 1));
    else
        proxy = QUrl(qgetenv("http_proxy"));
    if (!proxy.isEmpty())
        setApplicationProxy(proxy);

    QByteArray encoding;
    index = args.indexOf("-encoding");
    if (index != -1)
        encoding = args.value(index + 1).toLocal8Bit();
    else if (!qgetenv("COMMUNI_ENCODING").isEmpty())
        encoding = qgetenv("COMMUNI_ENCODING");
    if (!encoding.isEmpty())
        Application::setEncoding(encoding);

#ifdef Q_WS_WIN
    bool composition = QtWin::isCompositionEnabled();
    index = args.indexOf("-composition");
    if (index != -1)
        composition = args.value(index + 1).toInt();
    else if (!qgetenv("COMMUNI_COMPOSITION").isEmpty())
        composition = qgetenv("COMMUNI_COMPOSITION").toInt();
    if (composition) {
        QtWin::extendFrameIntoClientArea(&window);
        window.setContentsMargins(0, 0, 0, 0);
    }
#endif

    window.show();
    return app.exec();
}
{'fraction_non_alphanumeric': 0.12972972972972974, 'fraction_numerical': 0.012355212355212355, 'mean_word_length': 3.508120649651972, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3686420', 'n_tokens_mistral': 1199, 'n_tokens_neox': 1158, 'n_words': 359}