summaryrefslogtreecommitdiffhomepage
path: root/proto-wine/ftnoir_protocol_wine.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2020-06-17 15:05:36 +0000
committerGitHub <noreply@github.com>2020-06-17 15:05:36 +0000
commit2493b7256c099e39bdf0d047cb288f3f39f7fa10 (patch)
tree5c8d466fe4efb53558ae8538c14b8d558e20a14a /proto-wine/ftnoir_protocol_wine.cpp
parent9135324f0031a18c5419babada6615a4eadc4882 (diff)
parent5e3cd6fbe898c6452e61b4edb8d78d4d158fc254 (diff)
Merge pull request #1103 from russell/proton
Proton directory discovery
Diffstat (limited to 'proto-wine/ftnoir_protocol_wine.cpp')
-rw-r--r--proto-wine/ftnoir_protocol_wine.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp
index aabaa30c..6652eb48 100644
--- a/proto-wine/ftnoir_protocol_wine.cpp
+++ b/proto-wine/ftnoir_protocol_wine.cpp
@@ -70,13 +70,17 @@ module_status wine::initialize()
if (s.proton_appid == 0)
return error(tr("Must specify application id for Proton (Steam Play)"));
- QProcessEnvironment make_steam_environ(const QString& proton_version, int appid);
- QString proton_path(const QString& proton_version);
+ std::tuple<QProcessEnvironment, QString, bool> make_steam_environ(const QString& proton_path, int appid);
+ QString proton_path(const QString& proton_path);
- wine_path = proton_path(s.proton_version);
- env = make_steam_environ(s.proton_version, s.proton_appid);
+ wine_path = proton_path(s.proton_path().toString());
+ auto [proton_env, error_string, success] = make_steam_environ(s.proton_path().toString(), s.proton_appid);
+ env = proton_env;
+
+ if (!success)
+ return error(error_string);
}
- else
+
{
QString wineprefix = "~/.wine";
if (!s.wineprefix->isEmpty())
@@ -85,7 +89,7 @@ module_status wine::initialize()
wineprefix = qgetenv("HOME") + wineprefix.mid(1);
if (wineprefix[0] != '/')
- error(tr("Wine prefix must be an absolute path (given '%1')").arg(wineprefix));
+ return error(tr("Wine prefix must be an absolute path (given '%1')").arg(wineprefix));
env.insert("WINEPREFIX", wineprefix);
}