summaryrefslogtreecommitdiffhomepage
path: root/proto-wine/ftnoir_protocol_wine_dialog.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_dialog.cpp
parent9135324f0031a18c5419babada6615a4eadc4882 (diff)
parent5e3cd6fbe898c6452e61b4edb8d78d4d158fc254 (diff)
Merge pull request #1103 from russell/proton
Proton directory discovery
Diffstat (limited to 'proto-wine/ftnoir_protocol_wine_dialog.cpp')
-rw-r--r--proto-wine/ftnoir_protocol_wine_dialog.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp
index b590ee94..a954a752 100644
--- a/proto-wine/ftnoir_protocol_wine_dialog.cpp
+++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp
@@ -1,19 +1,30 @@
#include "ftnoir_protocol_wine.h"
#include <QDebug>
+#include <QDir>
+
#include "api/plugin-api.hpp"
-static const char* proton_versions[] = {
- "5.0", "4.11", "4.2", "3.16", "3.7",
+static const char* proton_paths[] = {
+ "/.steam/steam/steamapps/common",
+ "/.steam/root/compatibilitytools.d",
+ "/.local/share/Steam/steamapps/common",
};
FTControls::FTControls()
{
ui.setupUi(this);
- for (const char* version : proton_versions)
- ui.proton_version->addItem(version, QVariant{version});
-
- tie_setting(s.proton_version, ui.proton_version);
+ for (const char* path : proton_paths) {
+ QDir dir(QDir::homePath() + path);
+ dir.setFilter(QDir::Dirs);
+ dir.setNameFilters({ "Proton*" });
+ QFileInfoList list = dir.entryInfoList();
+ for (int i = 0; i < list.size(); ++i) {
+ QFileInfo fileInfo = list.at(i);
+ ui.proton_version->addItem(fileInfo.fileName(), QVariant{fileInfo.filePath()});
+ }
+ }
+ tie_setting(s.proton_path, ui.proton_version);
tie_setting(s.variant_wine, ui.variant_wine);
tie_setting(s.variant_proton, ui.variant_proton);
tie_setting(s.esync, ui.esync);
@@ -37,4 +48,3 @@ void FTControls::doCancel()
s.b->reload();
close();
}
-