mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Remove unused methods
This commit is contained in:
@@ -224,17 +224,16 @@ short Game::GetActiveLoadOrderIndex(const std::string & pluginName) const {
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::vector<std::string> Game::GetLoadOrder() const {
|
||||
if (loadOrder_.empty())
|
||||
loadOrder_ = LoadOrderHandler::GetLoadOrder();
|
||||
|
||||
return loadOrder_;
|
||||
}
|
||||
|
||||
void Game::SetLoadOrder(const std::vector<std::string>& loadOrder) const {
|
||||
LoadOrderHandler::SetLoadOrder(loadOrder);
|
||||
loadOrder_ = loadOrder;
|
||||
}
|
||||
void Game::SetLoadOrder(const char * const * const loadOrder, const size_t numPlugins) const {
|
||||
LoadOrderHandler::SetLoadOrder(loadOrder, numPlugins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@ public:
|
||||
|
||||
std::vector<std::string> GetLoadOrder() const;
|
||||
void SetLoadOrder(const std::vector<std::string>& loadOrder) const;
|
||||
void SetLoadOrder(const char * const * const loadOrder, const size_t numPlugins) const;
|
||||
private:
|
||||
bool pluginsFullyLoaded_;
|
||||
mutable std::vector<std::string> loadOrder_;
|
||||
|
||||
@@ -141,26 +141,6 @@ std::vector<std::string> LoadOrderHandler::GetLoadOrder() const {
|
||||
return loadOrder;
|
||||
}
|
||||
|
||||
void LoadOrderHandler::SetLoadOrder(const char * const * const loadOrder, const size_t numPlugins) const {
|
||||
BOOST_LOG_TRIVIAL(debug) << "Setting load order.";
|
||||
|
||||
unsigned int ret = lo_set_load_order(gh_, loadOrder, numPlugins);
|
||||
if (ret != LIBLO_OK && ret != LIBLO_WARN_BAD_FILENAME && ret != LIBLO_WARN_INVALID_LIST && ret != LIBLO_WARN_LO_MISMATCH) {
|
||||
const char * e = nullptr;
|
||||
string err;
|
||||
lo_get_error_message(&e);
|
||||
if (e == nullptr) {
|
||||
BOOST_LOG_TRIVIAL(error) << "libloadorder failed to set the load order. Details could not be fetched.";
|
||||
err = translate("libloadorder failed to set the load order. Details could not be fetched.").str();
|
||||
} else {
|
||||
BOOST_LOG_TRIVIAL(error) << "libloadorder failed to set the load order. Details: " << e;
|
||||
err = translate("libloadorder failed to set the load order. Details:").str() + " " + e;
|
||||
}
|
||||
lo_cleanup();
|
||||
throw std::system_error(ret, libloadorder_category(), err);
|
||||
}
|
||||
}
|
||||
|
||||
void LoadOrderHandler::SetLoadOrder(const std::vector<std::string>& loadOrder) const {
|
||||
BOOST_LOG_TRIVIAL(info) << "Setting load order.";
|
||||
size_t pluginArrSize = loadOrder.size();
|
||||
@@ -173,17 +153,26 @@ void LoadOrderHandler::SetLoadOrder(const std::vector<std::string>& loadOrder) c
|
||||
++i;
|
||||
}
|
||||
|
||||
try {
|
||||
SetLoadOrder(pluginArr, pluginArrSize);
|
||||
} catch (std::exception& /*e*/) {
|
||||
for (size_t i = 0; i < pluginArrSize; i++)
|
||||
delete[] pluginArr[i];
|
||||
delete[] pluginArr;
|
||||
throw;
|
||||
}
|
||||
unsigned int ret = lo_set_load_order(gh_, pluginArr, pluginArrSize);
|
||||
|
||||
for (size_t i = 0; i < pluginArrSize; i++)
|
||||
delete[] pluginArr[i];
|
||||
delete[] pluginArr;
|
||||
|
||||
if (ret != LIBLO_OK && ret != LIBLO_WARN_BAD_FILENAME && ret != LIBLO_WARN_INVALID_LIST && ret != LIBLO_WARN_LO_MISMATCH) {
|
||||
const char * e = nullptr;
|
||||
string err;
|
||||
lo_get_error_message(&e);
|
||||
if (e == nullptr) {
|
||||
BOOST_LOG_TRIVIAL(error) << "libloadorder failed to set the load order. Details could not be fetched.";
|
||||
err = translate("libloadorder failed to set the load order. Details could not be fetched.").str();
|
||||
} else {
|
||||
BOOST_LOG_TRIVIAL(error) << "libloadorder failed to set the load order. Details: " << e;
|
||||
err = translate("libloadorder failed to set the load order. Details:").str() + " " + e;
|
||||
}
|
||||
lo_cleanup();
|
||||
|
||||
throw std::system_error(ret, libloadorder_category(), err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,8 +46,6 @@ public:
|
||||
|
||||
bool IsPluginActive(const std::string& pluginName) const;
|
||||
|
||||
//These modify game load order, even though const.
|
||||
void SetLoadOrder(const char * const * const loadOrder, const size_t numPlugins) const; // For API.
|
||||
void SetLoadOrder(const std::vector<std::string>& loadOrder) const;
|
||||
private:
|
||||
lo_game_handle gh_;
|
||||
|
||||
Reference in New Issue
Block a user