2018-08-02 14:23:27 +02:00
|
|
|
#include "BrowserExtension.hpp"
|
|
|
|
#include "RunGui.hpp"
|
2018-06-28 19:46:45 +02:00
|
|
|
#include "singletons/Paths.hpp"
|
2018-08-02 14:23:27 +02:00
|
|
|
#include "singletons/Settings.hpp"
|
2017-01-11 01:08:20 +01:00
|
|
|
|
|
|
|
#include <QApplication>
|
2018-04-09 22:59:19 +02:00
|
|
|
#include <QStringList>
|
|
|
|
|
2018-08-02 14:23:27 +02:00
|
|
|
using namespace chatterino;
|
2018-04-09 22:59:19 +02:00
|
|
|
|
2018-08-02 14:23:27 +02:00
|
|
|
int main(int argc, char **argv)
|
2018-04-09 22:59:19 +02:00
|
|
|
{
|
2018-06-13 13:27:10 +02:00
|
|
|
QApplication a(argc, argv);
|
|
|
|
|
2018-08-06 21:17:03 +02:00
|
|
|
// convert char** to QStringList
|
2018-08-02 14:23:27 +02:00
|
|
|
auto args = QStringList();
|
2018-08-06 21:17:03 +02:00
|
|
|
std::transform(argv + 1, argv + argc, std::back_inserter(args),
|
|
|
|
[&](auto s) { return s; });
|
2018-04-09 22:59:19 +02:00
|
|
|
|
2018-08-02 14:23:27 +02:00
|
|
|
// run in gui mode or browser extension host mode
|
|
|
|
if (shouldRunBrowserExtensionHost(args)) {
|
|
|
|
runBrowserExtensionHost();
|
2018-04-20 00:15:57 +02:00
|
|
|
} else {
|
2018-08-02 14:23:27 +02:00
|
|
|
Paths paths;
|
|
|
|
Settings settings(paths);
|
2018-04-20 00:15:57 +02:00
|
|
|
|
2018-08-02 14:23:27 +02:00
|
|
|
runGui(a, paths, settings);
|
2018-05-28 18:25:19 +02:00
|
|
|
}
|
|
|
|
}
|