diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-07-23 23:40:48 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-07-24 21:46:11 +0530 |
| commit | 43f3261635e1667367cfd31a2f746832e94c3957 (patch) | |
| tree | a68d385c1bee08e8527e2d0c44d69ab14010a4c0 /src/App.hpp | |
| parent | f18749fc37ef0d5bfb6bf240740a401cce372d0c (diff) | |
| download | null-browser-43f3261635e1667367cfd31a2f746832e94c3957.tar.gz null-browser-43f3261635e1667367cfd31a2f746832e94c3957.zip | |
Refactor main into App class
Diffstat (limited to 'src/App.hpp')
| -rw-r--r-- | src/App.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/App.hpp b/src/App.hpp new file mode 100644 index 0000000..493a96c --- /dev/null +++ b/src/App.hpp @@ -0,0 +1,28 @@ +#pragma once + +#include <QApplication> +#include <qcommandlineparser.h> + +#include "Configuration.hpp" +#include "InstanceManager.hpp" +#include "utils.hpp" + +class App { +public: + App(); + void run(); + DELEGATE((&instance_manager), is_server, is_server) + +private: + InstanceManager instance_manager; + Configuration configuration; + QCommandLineParser cli_parser; + + void configure_cli_parser(); + void init_server(); + void init_client(); + + QString get_cli_config_dir() { return cli_parser.value("config-dir"); } + QString get_cli_lua_expr() { return cli_parser.value("expr"); } + QList<QString> get_cli_urls() { return cli_parser.positionalArguments(); } +}; |
