diff options
author | Russell Sim <russell.sim@gmail.com> | 2020-06-17 08:00:32 +0200 |
---|---|---|
committer | Russell Sim <russell.sim@gmail.com> | 2020-06-17 08:00:32 +0200 |
commit | 342dbc9724c451ce8fc96bb5437030b8c1875fee (patch) | |
tree | 2026a53ee348eee960be7fc1375d9a71ee131277 /proto-wine/ftnoir_protocol_wine.cpp | |
parent | 8444c609936606a361dd2681a6e2356e0d5ee81c (diff) |
Replace exception handling with error return value
Diffstat (limited to 'proto-wine/ftnoir_protocol_wine.cpp')
-rw-r--r-- | proto-wine/ftnoir_protocol_wine.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index 7052ea41..a9de7557 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -1,5 +1,4 @@ #include "ftnoir_protocol_wine.h" -#include "proton.h" #ifndef OTR_WINE_NO_WRAPPER # include "csv/csv.h" #endif @@ -71,15 +70,16 @@ 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_path, int appid); + 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_path().toString()); - try { - env = make_steam_environ(s.proton_path().toString(), s.proton_appid); - } catch(const ProtonException &e) { - return error(e.getMessage()); - } + qDebug() << 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); } { |