MCPcopy Create free account
hub / github.com/Selectively11/CloudRedirect / checkPrerequisites

Method checkPrerequisites

ui-linux/src/deployer.cpp:91–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89QString Deployer::deployedVersion() const { return m_deployedVersion; }
90
91void Deployer::checkPrerequisites()
92{
93 QString home = realHomePath();
94
95 QString slsDir = xdgDataHome() + "/SLSsteam";
96 m_slssteamInstalled = QFile::exists(slsDir + "/SLSsteam.so");
97
98 m_slsCloudBlocked = true;
99 if (m_slssteamInstalled) {
100 QStringList configPaths = {
101 xdgConfigHome() + "/SLSsteam/config.yaml",
102 home + "/.var/app/com.valvesoftware.Steam/.config/SLSsteam/config.yaml",
103 };
104 for (const auto &configPath : configPaths) {
105 QFile f(configPath);
106 if (!f.open(QIODevice::ReadOnly | QIODevice::Text))
107 continue;
108 QTextStream in(&f);
109 while (!in.atEnd()) {
110 QString line = in.readLine();
111 QString trimmed = line.trimmed();
112 if (trimmed.startsWith("DisableCloud")) {
113 int colonIdx = trimmed.indexOf(':');
114 if (colonIdx >= 0) {
115 QString value = trimmed.mid(colonIdx + 1).trimmed();
116 int commentIdx = value.indexOf('#');
117 if (commentIdx >= 0) value = value.left(commentIdx).trimmed();
118 if (value.compare("no", Qt::CaseInsensitive) == 0 ||
119 value.compare("false", Qt::CaseInsensitive) == 0 ||
120 value == "0") {
121 m_slsCloudBlocked = false;
122 }
123 }
124 break;
125 }
126 }
127 f.close();
128 break;
129 }
130 }
131
132 QString crDir = crDataDir();
133 m_soDeployPath = crDir + "/cloud_redirect.so";
134 m_cliDeployPath = crDir + "/cloud_redirect_cli";
135
136 QString appDir = QCoreApplication::applicationDirPath();
137 QString bundledSo = QProcessEnvironment::systemEnvironment().value("CR_BUNDLED_SO");
138 QString bundledCli = QProcessEnvironment::systemEnvironment().value("CR_BUNDLED_CLI");
139
140 if (!bundledSo.isEmpty() && QFile::exists(bundledSo))
141 m_soSourcePath = bundledSo;
142 else if (QFile::exists(appDir + "/cloud_redirect.so"))
143 m_soSourcePath = appDir + "/cloud_redirect.so";
144 else if (QFile::exists("/app/share/cloud_redirect/cloud_redirect.so"))
145 m_soSourcePath = "/app/share/cloud_redirect/cloud_redirect.so";
146 else if (QFile::exists(xdgDataHome() + "/cloud_redirect/cloud_redirect.so"))
147 m_soSourcePath = xdgDataHome() + "/cloud_redirect/cloud_redirect.so";
148

Callers

nothing calls this directly

Calls 5

realHomePathFunction · 0.85
xdgDataHomeFunction · 0.85
xdgConfigHomeFunction · 0.85
crDataDirFunction · 0.85
getSoVersionFunction · 0.85

Tested by

no test coverage detected