aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/bin
diff options
context:
space:
mode:
authorRenaud Guezennec <renaud@rolisteam.org>2025-10-07 00:10:02 +0200
committerRenaud Guezennec <renaud@rolisteam.org>2025-11-10 02:39:57 +0000
commit19670fc751782d063fafd43c9be03ecc92572c6b (patch)
tree0c7a3a803324e7cc9f70a6f2f5ed41907b4468e8 /src/bin
parent46cb61e9f90a480b0277816ae8d42e5b0c91fe0c (diff)
downloadOneRoll-19670fc751782d063fafd43c9be03ecc92572c6b.tar.gz
OneRoll-19670fc751782d063fafd43c9be03ecc92572c6b.zip
Fix error and cpp style.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/cli/main.cpp7
-rw-r--r--src/bin/gui/mainwindow.h2
-rw-r--r--src/bin/mobile/maincontroller.cpp24
-rw-r--r--src/bin/webserver/diceserver.cpp4
4 files changed, 23 insertions, 14 deletions
diff --git a/src/bin/cli/main.cpp b/src/bin/cli/main.cpp
index 91fa1ef..a63f0ab 100644
--- a/src/bin/cli/main.cpp
+++ b/src/bin/cli/main.cpp
@@ -304,6 +304,7 @@ int startDiceParsing(QStringList& cmds, bool withColor, QString baseColor, EXPOR
DiceParser parser;
parser.insertAlias(new DiceAlias("L5R5R", QStringLiteral("L[-,⨀,⨀⬢,❂⬢,❁,❁⬢]")), 0);
parser.insertAlias(new DiceAlias("L5R5S", QStringLiteral("L[-,-,⨀,⨀,⨀❁,⨀⬢,⨀⬢,❂,❂⬢,❁,❁,❁]")), 1);
+ // parser.setVariableDictionary({{"air", "3"}});
int i= 2;
for(auto alias : array)
{
@@ -467,7 +468,7 @@ int main(int argc, char* argv[])
#endif
QStringList commands;
- QString cmd;
+ QString cmd, charactersheet;
QString dotFileStr;
bool colorb= true;
QSettings settings("rolisteam", "diceparser");
@@ -564,6 +565,10 @@ int main(int argc, char* argv[])
{
dotFileStr= optionParser.value(dotFile);
}
+ else if(optionParser.isSet(character))
+ {
+ charactersheet= optionParser.value(character);
+ }
if(optionParser.isSet(markdown))
{
format= MARKDOWN;
diff --git a/src/bin/gui/mainwindow.h b/src/bin/gui/mainwindow.h
index bd19b34..081d085 100644
--- a/src/bin/gui/mainwindow.h
+++ b/src/bin/gui/mainwindow.h
@@ -6,7 +6,7 @@
class DiceParser;
namespace Ui
{
- class MainWindow;
+class MainWindow;
}
class MainWindow : public QMainWindow
diff --git a/src/bin/mobile/maincontroller.cpp b/src/bin/mobile/maincontroller.cpp
index 6f301ff..c131436 100644
--- a/src/bin/mobile/maincontroller.cpp
+++ b/src/bin/mobile/maincontroller.cpp
@@ -7,17 +7,19 @@ MainControler::MainControler(QObject* parent) : QObject(parent)
{
m_diceParser= new DiceParser();
- qmlRegisterSingletonType("DiceParser", 1, 0, "Model", [](QQmlEngine* engine, QJSEngine* scriptEngine) -> QObject* {
- Q_UNUSED(engine)
- static CommandModel model;
- static bool initialized= false;
- if(!initialized)
- {
- model.insertCmd("L5R", "8D10e10k4");
- initialized= true;
- }
- return &model;
- });
+ qmlRegisterSingletonType("DiceParser", 1, 0, "Model",
+ [](QQmlEngine* engine, QJSEngine* scriptEngine) -> QObject*
+ {
+ Q_UNUSED(engine)
+ static CommandModel model;
+ static bool initialized= false;
+ if(!initialized)
+ {
+ model.insertCmd("L5R", "8D10e10k4");
+ initialized= true;
+ }
+ return &model;
+ });
}
void MainControler::initEngine(QQmlApplicationEngine* engine)
{
diff --git a/src/bin/webserver/diceserver.cpp b/src/bin/webserver/diceserver.cpp
index a3f094d..1871927 100644
--- a/src/bin/webserver/diceserver.cpp
+++ b/src/bin/webserver/diceserver.cpp
@@ -13,7 +13,9 @@ DiceServer::DiceServer(int port) : QObject(), m_diceParser(new DiceParser())
// using namespace ;
m_server= new qhttp::server::QHttpServer(this);
m_server->listen( // listening on 0.0.0.0:8080
- QHostAddress::Any, port, [=](qhttp::server::QHttpRequest* req, qhttp::server::QHttpResponse* res) {
+ QHostAddress::Any, port,
+ [=](qhttp::server::QHttpRequest* req, qhttp::server::QHttpResponse* res)
+ {
req->collectData(1024);
// qhttp::THeaderHash hash = req->headers();