<commit_before>/* Copyright (c) 2013-2014 <NAME>
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef QGBA_APP_H
#define QGBA_APP_H

#include <QApplication>
#include <QFileDialog>
#include <QThread>

#include "ConfigController.h"
#include "MultiplayerController.h"

struct NoIntroDB;

#include <mgba/core/log.h>

mLOG_DECLARE_CATEGORY(QT);

namespace QGBA {

class GameController;
class Window;

#ifdef USE_SQLITE3
class GameDBParser : public QObject {
Q_OBJECT

public:
	GameDBParser(NoIntroDB* db, QObject* parent = nullptr);

public slots:
	void parseNoIntroDB();

private:
	NoIntroDB* m_db;
};
#endif


class GBAApp : public QApplication {
Q_OBJECT

public:
	GBAApp(int& argc, char* argv[]);
	~GBAApp();
	static GBAApp* app();

	static QString dataDir();

	Window* newWindow();

	QString getOpenFileName(QWidget* owner, const QString& title, const QString& filter = QString());
	QString getSaveFileName(QWidget* owner, const QString& title, const QString& filter = QString());
	QString getOpenDirectoryName(QWidget* owner, const QString& title);

	QFileDialog* getOpenFileDialog(QWidget* owner, const QString& title, const QString& filter = QString());
	QFileDialog* getSaveFileDialog(QWidget* owner, const QString& title, const QString& filter = QString());

	const NoIntroDB* gameDB() const { return m_db; }
	bool reloadGameDB();

protected:
	bool event(QEvent*);

private:
	class FileDialog : public QFileDialog {
	public:
		FileDialog(GBAApp* app, QWidget* parent = nullptr, const QString& caption = QString(),
		           const QString& filter = QString());
		virtual int exec() override;

	private:
		GBAApp* m_app;
	};

	Window* newWindowInternal();

	void pauseAll(QList<int>* paused);
	void continueAll(const QList<int>* paused);

	ConfigController m_configController;
	Window* m_windows[MAX_GBAS];
	MultiplayerController m_multiplayer;

#ifdef USE_SQLITE3
	NoIntroDB* m_db;
	QThread m_parseThread;
#endif
};

}

#endif<commit_msg>Qt: Fix non-SQLITE build<commit_after>/* Copyright (c) 2013-2014 <NAME>
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef QGBA_APP_H
#define QGBA_APP_H

#include <QApplication>
#include <QFileDialog>
#include <QThread>

#include "ConfigController.h"
#include "MultiplayerController.h"

struct NoIntroDB;

#include <mgba/core/log.h>

mLOG_DECLARE_CATEGORY(QT);

namespace QGBA {

class GameController;
class Window;

#ifdef USE_SQLITE3
class GameDBParser : public QObject {
Q_OBJECT

public:
	GameDBParser(NoIntroDB* db, QObject* parent = nullptr);

public slots:
	void parseNoIntroDB();

private:
	NoIntroDB* m_db;
};
#endif


class GBAApp : public QApplication {
Q_OBJECT

public:
	GBAApp(int& argc, char* argv[]);
	~GBAApp();
	static GBAApp* app();

	static QString dataDir();

	Window* newWindow();

	QString getOpenFileName(QWidget* owner, const QString& title, const QString& filter = QString());
	QString getSaveFileName(QWidget* owner, const QString& title, const QString& filter = QString());
	QString getOpenDirectoryName(QWidget* owner, const QString& title);

	QFileDialog* getOpenFileDialog(QWidget* owner, const QString& title, const QString& filter = QString());
	QFileDialog* getSaveFileDialog(QWidget* owner, const QString& title, const QString& filter = QString());

	const NoIntroDB* gameDB() const { return m_db; }
	bool reloadGameDB();

protected:
	bool event(QEvent*);

private:
	class FileDialog : public QFileDialog {
	public:
		FileDialog(GBAApp* app, QWidget* parent = nullptr, const QString& caption = QString(),
		           const QString& filter = QString());
		virtual int exec() override;

	private:
		GBAApp* m_app;
	};

	Window* newWindowInternal();

	void pauseAll(QList<int>* paused);
	void continueAll(const QList<int>* paused);

	ConfigController m_configController;
	Window* m_windows[MAX_GBAS];
	MultiplayerController m_multiplayer;

	NoIntroDB* m_db;
#ifdef USE_SQLITE3
	QThread m_parseThread;
#endif
};

}

#endif
{'fraction_non_alphanumeric': 0.11166311805062692, 'fraction_numerical': 0.006624083274189733, 'mean_word_length': 5.301043219076006, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '323949', 'n_tokens_mistral': 1454, 'n_tokens_neox': 1396, 'n_words': 422}