diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-01-30 19:23:34 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-01-30 19:23:34 +0100 |
commit | 705249718c3172cf845f8525d9867a29fe1240fa (patch) | |
tree | 7fafee76b2d371284ebd9ad8ba011df1e7664eab /src/commandline.cpp | |
parent | Profile menu lists loadable profiles (diff) | |
download | smolbote-705249718c3172cf845f8525d9867a29fe1240fa.tar.xz |
Always connect to local socket
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"); |