diff options
Diffstat (limited to 'src/commandline.cpp')
-rw-r--r-- | src/commandline.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/commandline.cpp b/src/commandline.cpp index e10e638..ffd7957 100644 --- a/src/commandline.cpp +++ b/src/commandline.cpp @@ -33,6 +33,17 @@ QString defaultUserConfigLocation() return path; } +constexpr const char *socketPath() +{ +#ifdef Q_OS_UNIX + // could be a path such as "/tmp/foo" + return "/tmp/smolbote.socket"; +#elif Q_OS_WIN32 + // could be a pipe path such as "\\.\pipe\foo" + return = "\\\\.\\pipe\\smolbote_socket"; +#endif +} + CommandLine::CommandLine() : QCommandLineParser() , helpOption(addHelpOption()) @@ -40,7 +51,7 @@ CommandLine::CommandLine() , configOption({ "c", "config" }, "Set configuration file.", "path", defaultUserConfigLocation()) , defaultConfigOption("default-config", "Set the default configuration file.", "path", "") , profileOption({ "p", "profile" }, "Use this profile.", "profile", "") - , socketOption("socket", "Local server socket", "name", "") + , socketOption("socket", "Local server socket", "name", socketPath()) , newWindowOption("in-new-window", "Open URL in new window") { setApplicationDescription("yet another no-frills browser"); |