[nostalgia/studio] Get Studio running with MSVC
This commit is contained in:
parent
74e6a4cbff
commit
debb3eb981
@ -91,7 +91,12 @@ ox::Error JsonReader::field(QJsonValueRef src, T *dest) {
|
|||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
ox::Error readJson(QString json, T *dest) {
|
ox::Error readJson(QString json, T *dest) {
|
||||||
auto obj = QJsonDocument::fromJson(json.toUtf8()).object();
|
QJsonParseError err;
|
||||||
|
auto obj = QJsonDocument::fromJson(json.toUtf8(), &err).object();
|
||||||
|
qDebug() << "JSON parsing error:" << err.errorString();
|
||||||
|
if (err.error) {
|
||||||
|
return OxError(1);
|
||||||
|
}
|
||||||
JsonReader rdr(obj);
|
JsonReader rdr(obj);
|
||||||
return model(&rdr, dest);
|
return model(&rdr, dest);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include <QDebug>
|
||||||
#include <ox/clargs/clargs.hpp>
|
#include <ox/clargs/clargs.hpp>
|
||||||
#include "mainwindow.hpp"
|
#include "mainwindow.hpp"
|
||||||
|
|
||||||
@ -16,15 +17,19 @@ int main(int argc, char **args) {
|
|||||||
ox::ClArgs clargs(argc, const_cast<const char**>(args));
|
ox::ClArgs clargs(argc, const_cast<const char**>(args));
|
||||||
QString argProfilePath = clargs.getString("profile").c_str();
|
QString argProfilePath = clargs.getString("profile").c_str();
|
||||||
|
|
||||||
NostalgiaStudioProfile config;
|
for (int i = 0; i < argc; i++) {
|
||||||
|
qDebug() << args[i];
|
||||||
|
}
|
||||||
QApplication app(argc, args);
|
QApplication app(argc, args);
|
||||||
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||||
|
|
||||||
MainWindow w(argProfilePath);
|
try {
|
||||||
app.setApplicationName(w.windowTitle());
|
MainWindow w(argProfilePath);
|
||||||
w.show();
|
app.setApplicationName(w.windowTitle());
|
||||||
QObject::connect(&app, &QApplication::aboutToQuit, &w, &MainWindow::onExit);
|
w.show();
|
||||||
|
QObject::connect(&app, &QApplication::aboutToQuit, &w, &MainWindow::onExit);
|
||||||
return app.exec();
|
return app.exec();
|
||||||
|
} catch (ox::Error err) {
|
||||||
|
oxPanic(err, "Unhandled ox::Error");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,8 @@ MainWindow::MainWindow(QString profilePath) {
|
|||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
file.open(QIODevice::ReadOnly);
|
file.open(QIODevice::ReadOnly);
|
||||||
QTextStream in(&file);
|
QTextStream in(&file);
|
||||||
readJson(in.readAll(), &m_profile);
|
oxThrowError(readJson(in.readAll(), &m_profile));
|
||||||
|
qDebug() << m_profile.appName;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto screenSize = QApplication::screens().first()->geometry();
|
auto screenSize = QApplication::screens().first()->geometry();
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"app_name": "Nostalgia Studio",
|
"app_name": "Nostalgia Studio",
|
||||||
"org_name": "Drinking Tea",
|
"org_name": "Drinking Tea",
|
||||||
"plugins": [
|
"plugins_path": [
|
||||||
{
|
"../lib/nostalgia/plugins",
|
||||||
"dir": "./",
|
"../Plugins",
|
||||||
"lib_name": "NostalgiaCore-Studio"
|
"../../../out/build/x64-Debug",
|
||||||
}
|
"../../../out/build/x64-Release"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user