From dd080e231e1c022d8acaf85abc23161c6aa2ccff Mon Sep 17 00:00:00 2001 From: oulianov Date: Fri, 9 Oct 2026 14:32:37 +0200 Subject: [PATCH] Build with glaze 9 and open a project from the command line glaze 9 uses `emit` as an identifier, which Qt defines as a macro: hide the macro around the glaze includes. The Editor takes an optional project folder argument (EasyRPG or RPG Maker 2000/2003); without one it opens the last project as before. --- src/main.cpp | 22 ++++++++++++++++++--- src/qmlbinding/json_internals/json_t_impl.h | 4 ++++ src/qmlbinding/lcf_glaze.h | 4 ++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c8b83606..a74259a1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,6 +18,8 @@ #include "core.h" #include "ui/main_window.h" #include +#include +#include #include #include #include @@ -104,9 +106,23 @@ int main(int argc, char *argv[]) { s.showMessage("Loading main window..."); app.processEvents(); MainWindow w; - s.showMessage("Loading last project..."); - app.processEvents(); - w.LoadLastProject(); + + // a project folder on the command line, else the last opened project + QCommandLineParser parser; + parser.setApplicationDescription("EasyRPG Editor"); + parser.addHelpOption(); + parser.addPositionalArgument("project", QCoreApplication::translate("main", "Project folder to open (EasyRPG or RPG Maker 2000/2003)."), "[project]"); + parser.process(app); + const QStringList args = parser.positionalArguments(); + if (!args.isEmpty()) { + s.showMessage("Loading project..."); + app.processEvents(); + w.LoadProject(QDir(args.first()).absolutePath()); + } else { + s.showMessage("Loading last project..."); + app.processEvents(); + w.LoadLastProject(); + } s.clearMessage(); w.show(); #ifndef NDEBUG diff --git a/src/qmlbinding/json_internals/json_t_impl.h b/src/qmlbinding/json_internals/json_t_impl.h index 4675cddb..c5367e6c 100644 --- a/src/qmlbinding/json_internals/json_t_impl.h +++ b/src/qmlbinding/json_internals/json_t_impl.h @@ -21,7 +21,11 @@ #include #include +// glaze uses `emit` as a name, which Qt defines as a keyword macro +#pragma push_macro("emit") +#undef emit #include +#pragma pop_macro("emit") #include "common/dbstring.h" #include "lcf_glaze.h" diff --git a/src/qmlbinding/lcf_glaze.h b/src/qmlbinding/lcf_glaze.h index 8e1a6d35..962a05e9 100644 --- a/src/qmlbinding/lcf_glaze.h +++ b/src/qmlbinding/lcf_glaze.h @@ -18,7 +18,11 @@ #pragma once #include +// glaze uses `emit` as a name, which Qt defines as a keyword macro +#pragma push_macro("emit") +#undef emit #include +#pragma pop_macro("emit") #include #include #include