<commit_before>/*!
 * This file is part of CameraPlus.
 *
 * Copyright (C) 2012-2013 <NAME> <<EMAIL>>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#if defined(QT4)
#include <QApplication>
#include <QDeclarativeView>
#include <QDeclarativeContext>
#include <QDeclarativeEngine>
#include <QtDeclarative>
#include <QGLWidget>
#elif defined(QT5)
#include <QGuiApplication>
#include <QQuickView>
#include <QQmlError>
#endif

#include "settings.h"
#include "filenaming.h"
#ifdef HARMATTAN
#include "quillitem.h"
#endif
#include "geocode.h"
#include "deviceinfo.h"
#include "soundvolumecontrol.h"
#include "displaystate.h"
#include "fsmonitor.h"
#include "cameraresources.h"
#include "compass.h"
#include "orientation.h"
#include "mountprotector.h"
#include "trackerstore.h"
#include "focusrectangle.h"
#include "sharehelper.h"
#include "deletehelper.h"
#include "galleryhelper.h"
#include "postcapturemodel.h"
#include "batteryinfo.h"
#include "gridlines.h"
#include "devicekeys.h"
#include "platformsettings.h"
#include "dbusservice.h"
#include "phoneprofile.h"
#include "platformquirks.h"
#include "stack.h"
#include <MDeclarativeCache>

#ifdef QMLJSDEBUGGER
#include "qt_private/qdeclarativedebughelper_p.h"
#endif /* QMLJSDEBUGGER */

#if defined(QT4)
#include <QAbstractFileEngineHandler>
#include "qmlfileengine.h"

class QmlFileEngineHandler : public QAbstractFileEngineHandler {
  QAbstractFileEngine *create(const QString& fileName) const {
    QString fn = fileName.toLower();
    if (fn.startsWith(':') && fn.endsWith(".qml")) {
      return new QmlFileEngine(fileName);
    }

    return 0;
  }
};
#endif

Q_DECL_EXPORT int main(int argc, char *argv[]) {
#ifdef QMLJSDEBUGGER
  QDeclarativeDebugHelper::enableDebugging();
#endif /* QMLJSDEBUGGER */

#if defined(QT4)
  QApplication::setAttribute(Qt::AA_X11InitThreads, true);
  QApplication *app = new QApplication(argc, argv);
  app->setApplicationName("cameraplus");
<commit_msg>Initialize X threads before we execute main<commit_after>/*!
 * This file is part of CameraPlus.
 *
 * Copyright (C) 2012-2013 <NAME> <<EMAIL>>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#if defined(QT4)
#include <QApplication>
#include <QDeclarativeView>
#include <QDeclarativeContext>
#include <QDeclarativeEngine>
#include <QtDeclarative>
#include <QGLWidget>
#elif defined(QT5)
#include <QGuiApplication>
#include <QQuickView>
#include <QQmlError>
#endif

#include "settings.h"
#include "filenaming.h"
#ifdef HARMATTAN
#include "quillitem.h"
#endif
#include "geocode.h"
#include "deviceinfo.h"
#include "soundvolumecontrol.h"
#include "displaystate.h"
#include "fsmonitor.h"
#include "cameraresources.h"
#include "compass.h"
#include "orientation.h"
#include "mountprotector.h"
#include "trackerstore.h"
#include "focusrectangle.h"
#include "sharehelper.h"
#include "deletehelper.h"
#include "galleryhelper.h"
#include "postcapturemodel.h"
#include "batteryinfo.h"
#include "gridlines.h"
#include "devicekeys.h"
#include "platformsettings.h"
#include "dbusservice.h"
#include "phoneprofile.h"
#include "platformquirks.h"
#include "stack.h"
#include <MDeclarativeCache>

#ifdef QMLJSDEBUGGER
#include "qt_private/qdeclarativedebughelper_p.h"
#endif /* QMLJSDEBUGGER */

#if defined(QT4)
#include <QAbstractFileEngineHandler>
#include "qmlfileengine.h"

class QmlFileEngineHandler : public QAbstractFileEngineHandler {
  QAbstractFileEngine *create(const QString& fileName) const {
    QString fn = fileName.toLower();
    if (fn.startsWith(':') && fn.endsWith(".qml")) {
      return new QmlFileEngine(fileName);
    }

    return 0;
  }
};
#endif

#ifdef HARMATTAN
#include <X11/Xlib.h>
class _XInitThreads {
public:
  _XInitThreads() {
    // XInitThreads() is required by gst-gltexture sink
    XInitThreads();
  }
};

static _XInitThreads __XInitThreads;
#endif

Q_DECL_EXPORT int main(int argc, char *argv[]) {
#ifdef QMLJSDEBUGGER
  QDeclarativeDebugHelper::enableDebugging();
#endif /* QMLJSDEBUGGER */

#if defined(QT4)
  QApplication::setAttribute(Qt::AA_X11InitThreads, true);
  QApplication *app = new QApplication(argc, argv);
  app->setApplicationName("cameraplus");

{'fraction_non_alphanumeric': 0.11283905967450271, 'fraction_numerical': 0.010488245931283906, 'mean_word_length': 5.40162037037037, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 34, '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': '5122491', 'n_tokens_mistral': 1820, 'n_tokens_neox': 1791, 'n_words': 549}