25 #include "fileutils.h" 34 QStringList searchSuffixes;
53 GameFile &GameFile::setConfigName(
const QString &name)
64 GameFile &GameFile::setFileName(
const QString &name)
75 GameFile &GameFile::setExecutable(
int flags)
77 d->executable = flags;
84 #if defined(Q_OS_WIN32) 87 if (!thisFile.endsWith(
".exe"))
93 return thisFile.compare(otherFileName, FileUtils::comparisonSensitivity()) == 0;
106 GameFile &GameFile::setNiceName(
const QString &name)
114 return d->searchSuffixes;
117 GameFile &GameFile::setSearchSuffixes(
const QStringList &suffixes)
119 d->searchSuffixes = suffixes;
128 QList<GameFile> list;
134 GameFileList::GameFileList()
138 GameFileList::~GameFileList()
150 foreach (
const GameFile &other, list.asQList())
157 QList<GameFile> GameFileList::asQList()
const 162 void GameFileList::clear()
167 GameFile GameFileList::first()
const 169 foreach (
const GameFile &file, d->list)
181 foreach (
const GameFile &file, d->list)
191 bool GameFileList::isEmpty()
const 193 return d->list.isEmpty();
198 d->list.prepend(gameFile);
204 list.append(gameFile);
218 return allFlagMatchExecutables(list, GameFile::CreateGame);
223 return allFlagMatchExecutables(list, GameFile::Client);
228 return allFlagMatchExecutables(list, GameFile::Server);
234 foreach (
const GameFile &file, list.asQList())
246 foreach (
const GameFile &file, list.asQList())
259 foreach (
const GameFile &file, list.asQList())
272 foreach (
const GameFile &file, list.asQList())
285 GameFile candidate = defaultOfflineExecutable(list);
290 foreach (
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().