25 #include "fileutils.h" 34 QStringList searchSuffixes;
44 GameFile::GameFile(
const GameFile &other)
65 GameFile &GameFile::setConfigName(
const QString &name)
76 GameFile &GameFile::setFileName(
const QString &name)
87 GameFile &GameFile::setExecutable(
int flags)
89 d->executable = flags;
96 #if defined(Q_OS_WIN32) 99 if (!thisFile.endsWith(
".exe"))
105 return thisFile.compare(otherFileName, FileUtils::comparisonSensitivity()) == 0;
118 GameFile &GameFile::setNiceName(
const QString &name)
126 return d->searchSuffixes;
129 GameFile &GameFile::setSearchSuffixes(
const QStringList &suffixes)
131 d->searchSuffixes = suffixes;
140 QList<GameFile> list;
146 GameFileList::GameFileList()
150 GameFileList::~GameFileList()
162 for (
const GameFile &other : list.asQList())
169 QList<GameFile> GameFileList::asQList()
const 174 void GameFileList::clear()
179 GameFile GameFileList::first()
const 181 for (
const GameFile &file : d->list)
193 for (
const GameFile &file : d->list)
203 bool GameFileList::isEmpty()
const 205 return d->list.isEmpty();
210 d->list.prepend(gameFile);
216 list.append(gameFile);
230 return allFlagMatchExecutables(list, GameFile::CreateGame);
235 return allFlagMatchExecutables(list, GameFile::Client);
240 return allFlagMatchExecutables(list, GameFile::Server);
246 for (
const GameFile &file : list.asQList())
258 for (
const GameFile &file : list.asQList())
271 for (
const GameFile &file : list.asQList())
284 for (
const GameFile &file : list.asQList())
297 GameFile candidate = defaultOfflineExecutable(list);
302 for (
const GameFile &file : list.asQList())
const QString & configName() const
Setting name where path will be stored in plugin's IniSection.
const QString & niceName() const
Descriptive name, ie. "client executable", "server executable", etc.
int executable() const
Executable bit flags mod that compares to ExecType.
bool isSameFile(const QString &otherFileName)
Guesses by file name if this is the same file.
QStringList & searchSuffixes() const
Path suffixes that help in automatically finding this file.
Game file definition allows to browse this file in configuration box.
const QString & fileName() const
Name of the file on disk.
bool isValid() const
A valid file has configName().