25 #include "serverapi/gamefile.h"
28 #include <QStringList>
30 QString PathFind::findExe(
const PathFinder &pathFinder,
const QString &name)
32 #if defined(Q_OS_WIN32)
33 if (!name.endsWith(
".exe"))
35 QString file = pathFinder.
findFile(name +
".exe");
45 QString PathFind::findGameFile(
const QStringList &knownPaths,
const GameFile &gameFile)
48 QStringList knownDirs;
49 for (
const QString &path : knownPaths)
51 if (!path.trimmed().isEmpty())
53 QFileInfo fileInfo(path);
58 if (fileInfo.dir().exists())
64 return findGameFile(pathFinder, gameFile);
71 return findExe(pathFinder, gameFile.
fileName());