Remove unnecessary equality operators.

For Game and GameSettings classes.
This commit is contained in:
Oliver Hamlet
2015-07-12 18:37:25 +01:00
parent 6d2dc6b2fc
commit be502bf893
5 changed files with 1 additions and 23 deletions
-12
View File
@@ -74,18 +74,6 @@ namespace loot {
RefreshActivePluginsList();
}
bool Game::operator == (const Game& rhs) const {
return (boost::iequals(Name(), rhs.Name()) || boost::iequals(FolderName(), rhs.FolderName()));
}
bool Game::operator == (const GameSettings& rhs) const {
return (boost::iequals(Name(), rhs.Name()) || boost::iequals(FolderName(), rhs.FolderName()));
}
bool Game::operator == (const std::string& nameOrFolderName) const {
return (boost::iequals(Name(), nameOrFolderName) || boost::iequals(FolderName(), nameOrFolderName));
}
void Game::RefreshActivePluginsList() {
activePlugins = GetActivePlugins();
}
-5
View File
@@ -53,11 +53,6 @@ namespace loot {
void Init(bool createFolder, const boost::filesystem::path& gameLocalAppData = "");
//Compare names and folder names.
bool operator == (const Game& rhs) const;
bool operator == (const GameSettings& rhs) const;
bool operator == (const std::string& nameOrFolderName) const;
void RefreshActivePluginsList();
void RedatePlugins(); //Change timestamps to match load order (Skyrim only).
-4
View File
@@ -116,10 +116,6 @@ namespace loot {
return (boost::iequals(_name, rhs.Name()) || boost::iequals(_lootFolderName, rhs.FolderName()));
}
bool GameSettings::operator == (const std::string& nameOrFolderName) const {
return (boost::iequals(_name, nameOrFolderName) || boost::iequals(_lootFolderName, nameOrFolderName));
}
unsigned int GameSettings::Id() const {
return _id;
}
-1
View File
@@ -42,7 +42,6 @@ namespace loot {
bool IsInstalled(); //Sets gamePath if the current value is not valid and a valid path is found.
bool operator == (const GameSettings& rhs) const; //Compares names and folder names.
bool operator == (const std::string& nameOrFolderName) const;
unsigned int Id() const;
std::string Name() const; //Returns the game's name, eg. "TES IV: Oblivion".
+1 -1
View File
@@ -221,7 +221,7 @@ namespace loot {
base::AutoLock lock_scope(_lock);
BOOST_LOG_TRIVIAL(debug) << "Changing current game to that with folder: " << newGameFolder;
_currentGame = find(_games.begin(), _games.end(), newGameFolder);
_currentGame = find(_games.begin(), _games.end(), Game(Game::autodetect, newGameFolder));
_currentGame->Init(true);
// Update game path in settings object.