Game init by API no longer creates LOOT folder.

For #310.
This commit is contained in:
Oliver Hamlet
2014-09-27 20:40:32 +01:00
parent c0eeca061f
commit 9fd5e48040
4 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ struct _loot_db_int : public loot::Game {
extStringArraySize(0),
extRevisionID(nullptr),
extRevisionDate(nullptr) {
this->SetDetails("", "", "", "", gamePath, "").Init();
this->SetDetails("", "", "", "", gamePath, "").Init(false);
}
~_loot_db_int() {
+5 -2
View File
@@ -352,7 +352,7 @@ namespace loot {
return *this;
}
Game& Game::Init() {
Game& Game::Init(bool createFolder) {
if (id != Game::tes4 && id != Game::tes5 && id != Game::fo3 && id != Game::fonv) {
throw error(error::invalid_args, lc::translate("Invalid game ID supplied.").str());
}
@@ -382,7 +382,10 @@ namespace loot {
}
RefreshActivePluginsList();
CreateLOOTGameFolder();
if (createFolder) {
CreateLOOTGameFolder();
}
return *this;
}
+1 -1
View File
@@ -108,7 +108,7 @@ namespace loot {
Game& SetDetails(const std::string& name, const std::string& masterFile,
const std::string& repositoryURL, const std::string& repositoryBranch,
const std::string& path, const std::string& registry);
Game& Init();
Game& Init(bool createFolder);
bool IsInstalled() const;
+2 -2
View File
@@ -228,7 +228,7 @@ namespace loot {
BOOST_LOG_TRIVIAL(debug) << "Selecting game.";
_currentGame = SelectGame(_settings, _games, cmdLineGame);
BOOST_LOG_TRIVIAL(debug) << "Initialising game-specific settings.";
_games[_currentGame].Init();
_games[_currentGame].Init(true);
}
catch (loot::error &e) {
if (e.code() == loot::error::no_game_detected) {
@@ -291,7 +291,7 @@ namespace loot {
auto it = find(_games.begin(), _games.end(), newGameFolder);
_currentGame = std::distance(_games.begin(), it);
_games[_currentGame].Init();
_games[_currentGame].Init(true);
BOOST_LOG_TRIVIAL(debug) << "New game is " << _games[_currentGame].Name();
}