summaryrefslogtreecommitdiffhomepage
path: root/proto-wine/ftnoir_protocol_wine_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'proto-wine/ftnoir_protocol_wine_dialog.cpp')
-rw-r--r--proto-wine/ftnoir_protocol_wine_dialog.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp
index b590ee94..76ccfdb5 100644
--- a/proto-wine/ftnoir_protocol_wine_dialog.cpp
+++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp
@@ -1,19 +1,32 @@
#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",
};
+static const QStringList proton_filter = { "Proton*" };
+
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_filter);
+ 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 +50,3 @@ void FTControls::doCancel()
s.b->reload();
close();
}
-