Archived
1
Fork 0
This repository has been archived on 2025-05-07. You can view files and clone it, but cannot push or open issues or pull requests.
redai/src/main.cpp

36 lines
893 B
C++
Raw Normal View History

2023-08-31 09:09:52 +02:00
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
//
// SPDX-License-Identifier: GPL-3.0-or-later
2023-03-27 12:49:53 -04:00
#include <QApplication>
#include <QCommandLineParser>
#include <QDir>
2023-03-27 12:49:53 -04:00
#include "MainWindow.h"
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QCommandLineParser parser;
2023-06-15 15:19:34 -04:00
parser.addPositionalArgument("site-path", QCoreApplication::translate("main", "Site directory."));
2023-03-27 12:49:53 -04:00
parser.process(app);
auto args = parser.positionalArguments();
if (args.empty()) {
2023-03-27 12:49:53 -04:00
return -1;
}
const QDir sitePath = args[0];
const QString defPath = sitePath.absoluteFilePath("art");
const QDir assetPath = sitePath.absoluteFilePath("assets");
const QString artAssetPath = assetPath.absoluteFilePath("art");
const QString dataPath = sitePath.absoluteFilePath("data");
2023-06-15 15:19:34 -04:00
MainWindow window(defPath, artAssetPath, dataPath);
2023-03-27 12:49:53 -04:00
window.show();
return QApplication::exec();
}