refactor: App::run remove unused args

This commit is contained in:
sithlord48 2025-09-30 17:02:32 -04:00 committed by Nick Bolton
parent 0bc82c3a57
commit 12ea23a3bd
8 changed files with 11 additions and 12 deletions

View file

@ -89,10 +89,10 @@ int main(int argc, char **argv)
if (parser.serverMode()) { if (parser.serverMode()) {
ServerApp app(&events, processName); ServerApp app(&events, processName);
return app.run(argc, argv); return app.run();
} else if (parser.clientMode()) { } else if (parser.clientMode()) {
ClientApp app(&events, processName); ClientApp app(&events, processName);
return app.run(argc, argv); return app.run();
} }
return s_exitSuccess; return s_exitSuccess;

View file

@ -62,7 +62,7 @@ App::~App()
s_instance = nullptr; s_instance = nullptr;
} }
int App::run(int argc, char **argv) int App::run()
{ {
#if MAC_OS_X_VERSION_10_7 #if MAC_OS_X_VERSION_10_7
// dock hide only supported on lion :( // dock hide only supported on lion :(
@ -83,7 +83,7 @@ int App::run(int argc, char **argv)
int result = s_exitFailed; int result = s_exitFailed;
try { try {
result = appUtil().run(argc, argv); result = appUtil().run();
} catch (ExitAppException &e) { } catch (ExitAppException &e) {
// instead of showing a nasty error, just exit with the error code. // instead of showing a nasty error, just exit with the error code.
// not sure if i like this behaviour, but it's probably better than // not sure if i like this behaviour, but it's probably better than

View file

@ -75,9 +75,8 @@ public:
return m_appUtil; return m_appUtil;
} }
int run(int argc, char **argv); int run();
int daemonMainLoop(int, const char **); int daemonMainLoop(int, const char **);
void setupFileLogging(); void setupFileLogging();
void loggingFilterWarning() const; void loggingFilterWarning() const;
void initApp() override; void initApp() override;

View file

@ -34,7 +34,7 @@ public:
} }
// Virtual Methods subclasses can impliment // Virtual Methods subclasses can impliment
virtual int run(int argc, char **argv) = 0; virtual int run() = 0;
virtual void startNode() = 0; virtual void startNode() = 0;
virtual std::vector<std::string> getKeyboardLayoutList() = 0; virtual std::vector<std::string> getKeyboardLayoutList() = 0;
virtual std::string getCurrentLanguageCode() = 0; virtual std::string getCurrentLanguageCode() = 0;

View file

@ -31,7 +31,7 @@ int startStatic()
return AppUtil::instance().app().start(); return AppUtil::instance().app().start();
} }
int AppUtilUnix::run(int argc, char **argv) int AppUtilUnix::run()
{ {
return app().runInner(&startStatic); return app().runInner(&startStatic);
} }

View file

@ -19,7 +19,7 @@ public:
explicit AppUtilUnix(const IEventQueue *); explicit AppUtilUnix(const IEventQueue *);
~AppUtilUnix() override = default; ~AppUtilUnix() override = default;
int run(int argc, char **argv) override; int run() override;
void startNode() override; void startNode() override;
std::vector<std::string> getKeyboardLayoutList() override; std::vector<std::string> getKeyboardLayoutList() override;
std::string getCurrentLanguageCode() override; std::string getCurrentLanguageCode() override;

View file

@ -102,7 +102,7 @@ static int foregroundStartupStatic(int argc, char **argv)
return AppUtil::instance().app().start(); return AppUtil::instance().app().start();
} }
int AppUtilWindows::run(int argc, char **argv) int AppUtilWindows::run()
{ {
if (!IsWindowsXPSP3OrGreater()) { if (!IsWindowsXPSP3OrGreater()) {
throw std::runtime_error("unsupported os version, xp sp3 or greater required"); throw std::runtime_error("unsupported os version, xp sp3 or greater required");
@ -121,7 +121,7 @@ int AppUtilWindows::run(int argc, char **argv)
startup = &foregroundStartupStatic; startup = &foregroundStartupStatic;
} }
return app().runInner(argc, argv, startup); return app().runInner(startup);
} }
AppUtilWindows &AppUtilWindows::instance() AppUtilWindows &AppUtilWindows::instance()

View file

@ -36,7 +36,7 @@ public:
int daemonNTStartup(); int daemonNTStartup();
int daemonNTMainLoop(); int daemonNTMainLoop();
int run(int argc, char **argv) override; int run() override;
void exitApp(int code) override; void exitApp(int code) override;
void startNode() override; void startNode() override;
std::vector<std::string> getKeyboardLayoutList() override; std::vector<std::string> getKeyboardLayoutList() override;