2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Provide access to un-joined argument list in Core::Launcher

This allows to re-use the variable in Linux-specific code
This commit is contained in:
Ilya Fedin
2023-06-13 06:03:19 +04:00
committed by John Preston
parent a7bd097b2f
commit af00247362
5 changed files with 9 additions and 13 deletions

View File

@@ -46,14 +46,13 @@ private:
} // namespace
Launcher::Launcher(int argc, char *argv[])
: Core::Launcher(argc, argv)
, _arguments(argv, argv + argc) {
: Core::Launcher(argc, argv) {
}
int Launcher::exec() {
for (auto i = begin(_arguments), e = end(_arguments); i != e; ++i) {
if (*i == "-webviewhelper" && std::distance(i, e) > 1) {
Webview::WebKitGTK::SetSocketPath(*(i + 1));
for (auto i = arguments().begin(), e = arguments().end(); i != e; ++i) {
if (*i == u"-webviewhelper"_q && std::distance(i, e) > 1) {
Webview::WebKitGTK::SetSocketPath((i + 1)->toStdString());
return Webview::WebKitGTK::Exec();
}
}

View File

@@ -21,8 +21,6 @@ private:
void initHook() override;
bool launchUpdater(UpdaterLaunch action) override;
std::vector<std::string> _arguments;
};
} // namespace Platform