Skip to content

Commit

Permalink
More pass by const&
Browse files Browse the repository at this point in the history
  • Loading branch information
oblivioncth committed Jul 23, 2023
1 parent fb76e75 commit f5f76c9
Show file tree
Hide file tree
Showing 28 changed files with 284 additions and 284 deletions.
4 changes: 2 additions & 2 deletions app/src/clifp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Qx::VersionNumber CLIFp::currentCLIFpVersion(const Fp::Install& fpInstall)
return Qx::FileDetails::readFileDetails(standardCLIFpPath(fpInstall)).fileVersion();
}

bool CLIFp::deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall, QString sourcePath)
bool CLIFp::deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall, const QString& sourcePath)
{
// Delete existing if present
QFile clifp(standardCLIFpPath(fpInstall));
Expand Down Expand Up @@ -58,7 +58,7 @@ bool CLIFp::deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall, QString
return true;
}

QString CLIFp::parametersFromStandard(QString originalAppPath, QString originalAppParams)
QString CLIFp::parametersFromStandard(QStringView originalAppPath, QStringView originalAppParams)
{
QString clifpParam = u"-q "_s; // Start with global quiet switch

Expand Down
4 changes: 2 additions & 2 deletions app/src/clifp.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class CLIFp
static QString standardCLIFpPath(const Fp::Install& fpInstall);
static bool hasCLIFp(const Fp::Install& fpInstall);
static Qx::VersionNumber currentCLIFpVersion(const Fp::Install& fpInstall);
static bool deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall, QString sourcePath);
static bool deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall, const QString& sourcePath);

static QString parametersFromStandard(QString originalAppPath, QString originalAppParams);
static QString parametersFromStandard(QStringView originalAppPath, QStringView originalAppParams);
static QString parametersFromStandard(QUuid titleId);
};

Expand Down
26 changes: 13 additions & 13 deletions app/src/frontend/attractmode/am-data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ bool Taglist::isEmpty() const
return mTags.isEmpty();
}

bool Taglist::containsTag(QString tag) const { return mTags.contains(tag); }
void Taglist::appendTag(QString tag) { mTags.append(tag); }
bool Taglist::containsTag(QStringView tag) const { return mTags.contains(tag); }
void Taglist::appendTag(const QString& tag) { mTags.append(tag); }

//===============================================================================================================
// Taglist::Writer
Expand Down Expand Up @@ -276,7 +276,7 @@ Fe::DataDoc::Type PlaylistTaglist::type() const { return Fe::DataDoc::Type::Play

//-Constructor--------------------------------------------------------------------------------------------------------
//Public:
Romlist::Romlist(Install* const parent, const QString& listPath, QString docName, Fe::UpdateOptions updateOptions,
Romlist::Romlist(Install* const parent, const QString& listPath, QString docName, const Fe::UpdateOptions& updateOptions,
const DocKey&) :
Fe::UpdateableDoc(parent, listPath, docName, updateOptions)
{}
Expand Down Expand Up @@ -737,18 +737,18 @@ QString Emulator::romExt() const { return mRomExt; }
QString Emulator::system() const { return mSystem; }
QString Emulator::infoSource() const { return mInfoSource; }
QString Emulator::exitHotkey() const { return mExitHotkey; }
EmulatorArtworkEntry Emulator::artworkEntry(QString type) const { return mArtworkEntries.value(type); }
EmulatorArtworkEntry Emulator::artworkEntry(const QString& type) const { return mArtworkEntries.value(type); }
QList<EmulatorArtworkEntry> Emulator::artworkEntries() const { return mArtworkEntries.values(); }

void Emulator::setExecutable(QString executable) { mExecutable = executable; }
void Emulator::setArgs(QString args) { mArgs = args; }
void Emulator::setWorkDir(QString workDir) { mWorkDir = workDir; }
void Emulator::setRomPath(QString romPath) { mRomPath = romPath; }
void Emulator::setRomExt(QString romExt) { mRomExt = romExt; }
void Emulator::setSystem(QString system) { mSystem = system; }
void Emulator::setInfoSource(QString infoSource) { mInfoSource = infoSource; }
void Emulator::setExitHotkey(QString exitHotkey) { mExitHotkey = exitHotkey; }
void Emulator::setArtworkEntry(EmulatorArtworkEntry entry) { mArtworkEntries[entry.type()] = entry; }
void Emulator::setExecutable(const QString& executable) { mExecutable = executable; }
void Emulator::setArgs(const QString& args) { mArgs = args; }
void Emulator::setWorkDir(const QString& workDir) { mWorkDir = workDir; }
void Emulator::setRomPath(const QString& romPath) { mRomPath = romPath; }
void Emulator::setRomExt(const QString& romExt) { mRomExt = romExt; }
void Emulator::setSystem(const QString& system) { mSystem = system; }
void Emulator::setInfoSource(const QString& infoSource) { mInfoSource = infoSource; }
void Emulator::setExitHotkey(const QString& exitHotkey) { mExitHotkey = exitHotkey; }
void Emulator::setArtworkEntry(const EmulatorArtworkEntry& entry) { mArtworkEntries[entry.type()] = entry; }

//===============================================================================================================
// Emulator::Reader
Expand Down
26 changes: 13 additions & 13 deletions app/src/frontend/attractmode/am-data.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ class Taglist : public Fe::DataDoc
public:
bool isEmpty() const override;

bool containsTag(QString tag) const;
void appendTag(QString tag);
bool containsTag(QStringView tag) const;
void appendTag(const QString& tag);
};

class Taglist::Writer : public CommonDocWriter
Expand Down Expand Up @@ -197,7 +197,7 @@ class Romlist : public Fe::UpdateableDoc

//-Constructor--------------------------------------------------------------------------------------------------------
public:
explicit Romlist(Install* const parent, const QString& listPath, QString docName, Fe::UpdateOptions updateOptions,
explicit Romlist(Install* const parent, const QString& listPath, QString docName, const Fe::UpdateOptions& updateOptions,
const DocKey&);

//-Instance Functions--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -413,18 +413,18 @@ class Emulator : public ConfigDoc
QString system() const;
QString infoSource() const;
QString exitHotkey() const;
EmulatorArtworkEntry artworkEntry(QString type) const;
EmulatorArtworkEntry artworkEntry(const QString& type) const;
QList<EmulatorArtworkEntry> artworkEntries() const;

void setExecutable(QString executable);
void setArgs(QString args);
void setWorkDir(QString workDir);
void setRomPath(QString romPath);
void setRomExt(QString romExt);
void setSystem(QString system);
void setInfoSource(QString infoSource);
void setExitHotkey(QString exitHotkey);
void setArtworkEntry(EmulatorArtworkEntry entry);
void setExecutable(const QString& executable);
void setArgs(const QString& args);
void setWorkDir(const QString& workDir);
void setRomPath(const QString& romPath);
void setRomExt(const QString& romExt);
void setSystem(const QString& system);
void setInfoSource(const QString& infoSource);
void setExitHotkey(const QString& exitHotkey);
void setArtworkEntry(const EmulatorArtworkEntry& entry);
};

class EmulatorReader : public ConfigDoc::Reader
Expand Down
4 changes: 2 additions & 2 deletions app/src/frontend/attractmode/am-install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Am

//-Constructor------------------------------------------------------------------------------------------------
//Public:
Install::Install(QString installPath) :
Install::Install(const QString& installPath) :
Fe::Install(installPath),
mEmulatorsDirectory(installPath + '/' + EMULATORS_PATH),
mRomlistsDirectory(installPath + '/' + ROMLISTS_PATH),
Expand Down Expand Up @@ -397,7 +397,7 @@ Qx::Error Install::postPlatformsImport()
return commitFlashpointRomlist(std::move(mRomlist));
}

Qx::Error Install::preImageProcessing(QList<ImageMap>& workerTransfers, Fe::ImageSources bulkSources)
Qx::Error Install::preImageProcessing(QList<ImageMap>& workerTransfers, const Fe::ImageSources& bulkSources)
{
Q_UNUSED(bulkSources);

Expand Down
4 changes: 2 additions & 2 deletions app/src/frontend/attractmode/am-install.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Install : public Fe::Install

//-Constructor-------------------------------------------------------------------------------------------------
public:
Install(QString installPath);
Install(const QString& installPath);

//-Instance Functions-----------------------------------------------------------------------------------------------
private:
Expand Down Expand Up @@ -122,7 +122,7 @@ class Install : public Fe::Install
Qx::Error preImport(const ImportDetails& details) override;
Qx::Error prePlatformsImport() override;
Qx::Error postPlatformsImport() override;
Qx::Error preImageProcessing(QList<ImageMap>& workerTransfers, Fe::ImageSources bulkSources) override;
Qx::Error preImageProcessing(QList<ImageMap>& workerTransfers, const Fe::ImageSources& bulkSources) override;
Qx::Error postImport() override;

// Image handling
Expand Down
46 changes: 23 additions & 23 deletions app/src/frontend/attractmode/am-items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,33 +115,33 @@ RomEntry::Builder::Builder() {}

//-Instance Functions------------------------------------------------------------------------------------------
//Public:
RomEntry::Builder& RomEntry::Builder::wName(QString nameAsId) { mItemBlueprint.mId = QUuid(nameAsId); return *this; }
RomEntry::Builder& RomEntry::Builder::wTitle(QString title) { mItemBlueprint.mName = title; return *this; }
RomEntry::Builder& RomEntry::Builder::wEmulator(QString emulator) { mItemBlueprint.mEmulator = emulator; return *this; }
RomEntry::Builder& RomEntry::Builder::wCloneOf(QString cloneOf) { mItemBlueprint.mCloneOf = cloneOf; return *this; }
RomEntry::Builder& RomEntry::Builder::wName(const QString& nameAsId) { mItemBlueprint.mId = QUuid(nameAsId); return *this; }
RomEntry::Builder& RomEntry::Builder::wTitle(const QString& title) { mItemBlueprint.mName = title; return *this; }
RomEntry::Builder& RomEntry::Builder::wEmulator(const QString& emulator) { mItemBlueprint.mEmulator = emulator; return *this; }
RomEntry::Builder& RomEntry::Builder::wCloneOf(const QString& cloneOf) { mItemBlueprint.mCloneOf = cloneOf; return *this; }

RomEntry::Builder& RomEntry::Builder::wYear(QString rawYear)
RomEntry::Builder& RomEntry::Builder::wYear(const QString& rawYear)
{
mItemBlueprint.mYear = QDate::fromString(rawYear, Qt::ISODate);
return *this;
}

RomEntry::Builder& RomEntry::Builder::wManufacturer(QString manufacturer) { mItemBlueprint.mManufacturer = manufacturer; return *this; }
RomEntry::Builder& RomEntry::Builder::wCategory(QString category) { mItemBlueprint.mPlatform = category; return *this; }
RomEntry::Builder& RomEntry::Builder::wPlayers(QString players) { mItemBlueprint.mPlayers = players; return *this; }
RomEntry::Builder& RomEntry::Builder::wRotation(QString rawRotation) { mItemBlueprint.mRotation = rawRotation.toUInt(); return *this; }
RomEntry::Builder& RomEntry::Builder::wControl(QString control) { mItemBlueprint.mControl = control; return *this; }
RomEntry::Builder& RomEntry::Builder::wStatus(QString status) { mItemBlueprint.mStatus = status; return *this; }
RomEntry::Builder& RomEntry::Builder::wDisplayCount(QString rawDisplayCount) { mItemBlueprint.mDisplayCount = rawDisplayCount.toUInt(); return *this; }
RomEntry::Builder& RomEntry::Builder::wDisplayType(QString displayType) { mItemBlueprint.mDisplayType = displayType; return *this; }
RomEntry::Builder& RomEntry::Builder::wAltRomName(QString altRomName) { mItemBlueprint.mAltRomName = altRomName; return *this; }
RomEntry::Builder& RomEntry::Builder::wAltTitle(QString altTitle) { mItemBlueprint.mAltTitle = altTitle; return *this; }
RomEntry::Builder& RomEntry::Builder::wExtra(QString extra) { mItemBlueprint.mExtra = extra; return *this; }
RomEntry::Builder& RomEntry::Builder::wButtons(QString buttons) { mItemBlueprint.mButtons = buttons; return *this; }
RomEntry::Builder& RomEntry::Builder::wSeries(QString series) { mItemBlueprint.mSeries = series; return *this; }
RomEntry::Builder& RomEntry::Builder::wLanguage(QString language) { mItemBlueprint.mLanguage = language; return *this; }
RomEntry::Builder& RomEntry::Builder::wRegion(QString region) { mItemBlueprint.mRegion = region; return *this; }
RomEntry::Builder& RomEntry::Builder::wRating(QString rating) { mItemBlueprint.mRating = rating; return *this; }
RomEntry::Builder& RomEntry::Builder::wManufacturer(const QString& manufacturer) { mItemBlueprint.mManufacturer = manufacturer; return *this; }
RomEntry::Builder& RomEntry::Builder::wCategory(const QString& category) { mItemBlueprint.mPlatform = category; return *this; }
RomEntry::Builder& RomEntry::Builder::wPlayers(const QString& players) { mItemBlueprint.mPlayers = players; return *this; }
RomEntry::Builder& RomEntry::Builder::wRotation(const QString& rawRotation) { mItemBlueprint.mRotation = rawRotation.toUInt(); return *this; }
RomEntry::Builder& RomEntry::Builder::wControl(const QString& control) { mItemBlueprint.mControl = control; return *this; }
RomEntry::Builder& RomEntry::Builder::wStatus(const QString& status) { mItemBlueprint.mStatus = status; return *this; }
RomEntry::Builder& RomEntry::Builder::wDisplayCount(const QString& rawDisplayCount) { mItemBlueprint.mDisplayCount = rawDisplayCount.toUInt(); return *this; }
RomEntry::Builder& RomEntry::Builder::wDisplayType(const QString& displayType) { mItemBlueprint.mDisplayType = displayType; return *this; }
RomEntry::Builder& RomEntry::Builder::wAltRomName(const QString& altRomName) { mItemBlueprint.mAltRomName = altRomName; return *this; }
RomEntry::Builder& RomEntry::Builder::wAltTitle(const QString& altTitle) { mItemBlueprint.mAltTitle = altTitle; return *this; }
RomEntry::Builder& RomEntry::Builder::wExtra(const QString& extra) { mItemBlueprint.mExtra = extra; return *this; }
RomEntry::Builder& RomEntry::Builder::wButtons(const QString& buttons) { mItemBlueprint.mButtons = buttons; return *this; }
RomEntry::Builder& RomEntry::Builder::wSeries(const QString& series) { mItemBlueprint.mSeries = series; return *this; }
RomEntry::Builder& RomEntry::Builder::wLanguage(const QString& language) { mItemBlueprint.mLanguage = language; return *this; }
RomEntry::Builder& RomEntry::Builder::wRegion(const QString& region) { mItemBlueprint.mRegion = region; return *this; }
RomEntry::Builder& RomEntry::Builder::wRating(const QString& rating) { mItemBlueprint.mRating = rating; return *this; }

//===============================================================================================================
// EmulatorArtworkEntry
Expand All @@ -166,7 +166,7 @@ EmulatorArtworkEntry::Builder::Builder() {}

//-Instance Functions------------------------------------------------------------------------------------------
//Public:
EmulatorArtworkEntry::Builder& EmulatorArtworkEntry::Builder::wType(QString type) { mItemBlueprint.mType = type; return *this; }
EmulatorArtworkEntry::Builder& EmulatorArtworkEntry::Builder::wPaths(QStringList paths) { mItemBlueprint.mPaths = paths; return *this; }
EmulatorArtworkEntry::Builder& EmulatorArtworkEntry::Builder::wType(const QString& type) { mItemBlueprint.mType = type; return *this; }
EmulatorArtworkEntry::Builder& EmulatorArtworkEntry::Builder::wPaths(const QStringList& paths) { mItemBlueprint.mPaths = paths; return *this; }

}
46 changes: 23 additions & 23 deletions app/src/frontend/attractmode/am-items.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,27 +88,27 @@ class RomEntry::Builder : public Fe::Game::Builder<RomEntry::Builder, RomEntry>

//-Instance Functions------------------------------------------------------------------------------------------
public:
Builder& wName(QString nameAsId);
Builder& wTitle(QString title);
Builder& wEmulator(QString emulator);
Builder& wCloneOf(QString cloneOf);
Builder& wYear(QString rawYear);
Builder& wManufacturer(QString manufacturer);
Builder& wCategory(QString category);
Builder& wPlayers(QString players);
Builder& wRotation(QString rawRotation);
Builder& wControl(QString control);
Builder& wStatus(QString status);
Builder& wDisplayCount(QString rawDisplayCount);
Builder& wDisplayType(QString displayType);
Builder& wAltRomName(QString altRomName);
Builder& wAltTitle(QString altTitle);
Builder& wExtra(QString extra);
Builder& wButtons(QString buttons);
Builder& wSeries(QString series);
Builder& wLanguage(QString language);
Builder& wRegion(QString region);
Builder& wRating(QString rating);
Builder& wName(const QString& nameAsId);
Builder& wTitle(const QString& title);
Builder& wEmulator(const QString& emulator);
Builder& wCloneOf(const QString& cloneOf);
Builder& wYear(const QString& rawYear);
Builder& wManufacturer(const QString& manufacturer);
Builder& wCategory(const QString& category);
Builder& wPlayers(const QString& players);
Builder& wRotation(const QString& rawRotation);
Builder& wControl(const QString& control);
Builder& wStatus(const QString& status);
Builder& wDisplayCount(const QString& rawDisplayCount);
Builder& wDisplayType(const QString& displayType);
Builder& wAltRomName(const QString& altRomName);
Builder& wAltTitle(const QString& altTitle);
Builder& wExtra(const QString& extra);
Builder& wButtons(const QString& buttons);
Builder& wSeries(const QString& series);
Builder& wLanguage(const QString& language);
Builder& wRegion(const QString& region);
Builder& wRating(const QString& rating);
};

class EmulatorArtworkEntry : public Fe::Item
Expand Down Expand Up @@ -140,8 +140,8 @@ class EmulatorArtworkEntry::Builder : public Fe::Item::Builder<EmulatorArtworkEn

//-Instance Functions------------------------------------------------------------------------------------------
public:
Builder& wType(QString type);
Builder& wPaths(QStringList paths);
Builder& wType(const QString& type);
Builder& wPaths(const QStringList& paths);
};

}
Expand Down
Loading

0 comments on commit f5f76c9

Please sign in to comment.