mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Various C++11-related changes.
* Switched to standard libraries for regex, unordered_map and unordered_set. * Switched to using the C++ syntax for C header includes (eg. `cstdint` rather than `stdint.h`). * Replaced IntToString with STL's to_string.
This commit is contained in:
@@ -112,7 +112,7 @@ h3{
|
||||
<ul>
|
||||
<li>They are evaluated as paths relative to the game's Data folder.
|
||||
<li>They cannot reference a path outside of the game's folder structure, ie. they cannot contain the substring <code>../../</code>.
|
||||
<li>Regular expression file paths must be written in the <a href="http://www.boost.org/doc/libs/1_54_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html">Perl</a> syntax.
|
||||
<li>Regular expression file paths must be written in the <a href="http://www.cplusplus.com/reference/regex/ECMAScript/">EMCAScript</a> syntax.
|
||||
<li>Only the filename of a regex file path may contain non-literal regex syntax, ie. if the filename part of the regex file path is removed, the remainder must be an exact folder path (though with the regex syntax special characters escaped). For example, given the regex file path <code>Meshes\\Resources(1|2)\\(upperclass)?table.nif</code>, LOOT will look for a file named <code>table.nif</code> or <code>upperclasstable.nif</code> in the <code>Meshes\Resources(1|2)</code> folder, rather than looking in the <code>Meshes\Resources1</code> and <code>Meshes\Resources2</code> folders.
|
||||
</ul>
|
||||
<p>Please test any changes you make before uploading them. One way of doing this is to run LOOT, another is to copy/paste what you've changed into <a href="http://nodeca.github.io/js-yaml/">here</a>, though it won't catch condition syntax errors and doesn't use the same parser as LOOT so may give different results.
|
||||
|
||||
+3
-3
@@ -36,13 +36,13 @@
|
||||
#include <clocale>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include <regex>
|
||||
#include <unordered_set>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/filesystem/detail/utf8_codecvt_facet.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/unordered_set.hpp>
|
||||
#include <boost/unordered_map.hpp>
|
||||
|
||||
const unsigned int loot_ok = loot::error::ok;
|
||||
const unsigned int loot_error_liblo_error = loot::error::liblo_error;
|
||||
|
||||
@@ -524,7 +524,7 @@ namespace loot {
|
||||
}
|
||||
}
|
||||
|
||||
for (boost::unordered_map<string, Plugin>::iterator it = plugins.begin(), itend = plugins.end(); it != itend; ++it) {
|
||||
for (unordered_map<string, Plugin>::iterator it = plugins.begin(), itend = plugins.end(); it != itend; ++it) {
|
||||
it->second = Plugin(*this, it->second.Name(), headersOnly);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -29,11 +29,11 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <boost/unordered_set.hpp>
|
||||
|
||||
#include <api/libloadorder.h>
|
||||
#include <src/libespm.h>
|
||||
@@ -93,13 +93,13 @@ namespace loot {
|
||||
void LoadPlugins(bool headersOnly); //Loads all installed plugins.
|
||||
|
||||
//Caches for condition results, active plugins and CRCs.
|
||||
boost::unordered_map<std::string, bool> conditionCache; //Holds lowercased strings.
|
||||
boost::unordered_map<std::string, uint32_t> crcCache; //Holds lowercased strings.
|
||||
std::unordered_map<std::string, bool> conditionCache; //Holds lowercased strings.
|
||||
std::unordered_map<std::string, uint32_t> crcCache; //Holds lowercased strings.
|
||||
|
||||
//Plugin data and metadata lists.
|
||||
MetadataList masterlist;
|
||||
MetadataList userlist;
|
||||
boost::unordered_map<std::string, Plugin> plugins; //Map so that plugin data can be edited.
|
||||
std::unordered_map<std::string, Plugin> plugins; //Map so that plugin data can be edited.
|
||||
|
||||
espm::Settings espm_settings;
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace loot {
|
||||
|
||||
boost::filesystem::path gamePath; //Path to the game's folder.
|
||||
|
||||
boost::unordered_set<std::string> activePlugins; //Holds lowercased strings.
|
||||
std::unordered_set<std::string> activePlugins; //Holds lowercased strings.
|
||||
|
||||
//Creates directory in LOOT folder for LOOT's game-specific files.
|
||||
void CreateLOOTGameFolder();
|
||||
|
||||
@@ -245,7 +245,7 @@ namespace loot {
|
||||
yout << YAML::BeginMap;
|
||||
|
||||
yout << YAML::Key << "lootVersion"
|
||||
<< YAML::Value << IntToString(g_version_major) + "." + IntToString(g_version_minor) + "." + IntToString(g_version_patch);
|
||||
<< YAML::Value << std::to_string(g_version_major) + "." + std::to_string(g_version_minor) + "." + std::to_string(g_version_patch);
|
||||
|
||||
yout << YAML::Key << "masterlist"
|
||||
<< YAML::BeginMap
|
||||
|
||||
+2
-1
@@ -28,7 +28,8 @@
|
||||
#include "metadata.h"
|
||||
#include "error.h"
|
||||
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <boost/graph/graph_traits.hpp>
|
||||
#include <boost/graph/adjacency_list.hpp>
|
||||
#include <boost/graph/topological_sort.hpp>
|
||||
|
||||
+15
-24
@@ -29,7 +29,6 @@
|
||||
#include <boost/spirit/include/karma.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/crc.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/log/trivial.hpp>
|
||||
#include <boost/format.hpp>
|
||||
#include <boost/locale.hpp>
|
||||
@@ -38,11 +37,11 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <cctype>
|
||||
#include <cstdio>
|
||||
#include <ctime>
|
||||
#include <sstream>
|
||||
#include <regex>
|
||||
|
||||
#if _WIN32 || _WIN64
|
||||
# ifndef UNICODE
|
||||
@@ -108,14 +107,14 @@ namespace loot {
|
||||
|
||||
/// Array used to try each of the expressions defined above using
|
||||
/// an iteration for each of them.
|
||||
boost::regex version_checks[7] = {
|
||||
boost::regex(regex1, boost::regex::icase),
|
||||
boost::regex(regex2, boost::regex::icase),
|
||||
boost::regex(regex3, boost::regex::icase),
|
||||
boost::regex(regex4, boost::regex::icase),
|
||||
boost::regex(regex5, boost::regex::icase), //This incorrectly identifies "OBSE v19" where 19 is any integer.
|
||||
boost::regex(regex6, boost::regex::icase), //This is responsible for metallicow's false positive.
|
||||
boost::regex(regex7, boost::regex::icase)
|
||||
regex version_checks[7] = {
|
||||
regex(regex1, regex::ECMAScript | regex::icase),
|
||||
regex(regex2, regex::ECMAScript | regex::icase),
|
||||
regex(regex3, regex::ECMAScript | regex::icase),
|
||||
regex(regex4, regex::ECMAScript | regex::icase),
|
||||
regex(regex5, regex::ECMAScript | regex::icase), //This incorrectly identifies "OBSE v19" where 19 is any integer.
|
||||
regex(regex6, regex::ECMAScript | regex::icase), //This is responsible for metallicow's false positive.
|
||||
regex(regex7, regex::ECMAScript | regex::icase)
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -154,14 +153,6 @@ namespace loot {
|
||||
return chksum;
|
||||
}
|
||||
|
||||
//Converts an integer to a string using BOOST's Spirit.Karma, which is apparently a lot faster than a stringstream conversion...
|
||||
std::string IntToString(const int n) {
|
||||
string out;
|
||||
back_insert_iterator<string> sink(out);
|
||||
karma::generate(sink,karma::upper[karma::int_],n);
|
||||
return out;
|
||||
}
|
||||
|
||||
//Converts an integer to a hex string using BOOST's Spirit.Karma, which is apparently a lot faster than a stringstream conversion...
|
||||
std::string IntToHexString(const int n) {
|
||||
string out;
|
||||
@@ -334,7 +325,7 @@ namespace loot {
|
||||
|
||||
delete [] point;
|
||||
|
||||
verString = IntToString(dwLeftMost) + '.' + IntToString(dwSecondLeft) + '.' + IntToString(dwSecondRight) + '.' + IntToString(dwRightMost);
|
||||
verString = to_string(dwLeftMost) + '.' + to_string(dwSecondLeft) + '.' + to_string(dwSecondRight) + '.' + to_string(dwRightMost);
|
||||
}
|
||||
#else
|
||||
// ensure filename has no quote characters in it to avoid command injection attacks
|
||||
@@ -367,11 +358,11 @@ namespace loot {
|
||||
bool Version::operator < (Version ver) {
|
||||
//Version string could have a wide variety of formats. Use regex to choose specific comparison types.
|
||||
|
||||
boost::regex reg1("(\\d+\\.?)+"); //a.b.c.d.e.f.... where the letters are all integers, and 'a' is the shortest possible match.
|
||||
regex reg1("(\\d+\\.?)+"); //a.b.c.d.e.f.... where the letters are all integers, and 'a' is the shortest possible match.
|
||||
|
||||
//boost::regex reg2("(\\d+\\.?)+([a-zA-Z\\-]+(\\d+\\.?)*)+"); //Matches a mix of letters and numbers - from "0.99.xx", "1.35Alpha2", "0.9.9MB8b1", "10.52EV-D", "1.62EV" to "10.0EV-D1.62EV".
|
||||
|
||||
if (boost::regex_match(verString, reg1) && boost::regex_match(ver.AsString(), reg1)) {
|
||||
if (regex_match(verString, reg1) && regex_match(ver.AsString(), reg1)) {
|
||||
//First type: numbers separated by periods. If two versions have a different number of numbers, then the shorter should be padded
|
||||
//with zeros. An arbitrary number of numbers should be supported.
|
||||
istringstream parser1(verString);
|
||||
|
||||
@@ -27,16 +27,16 @@
|
||||
|
||||
#include "metadata.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <regex>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
namespace loot {
|
||||
|
||||
/// Array used to try each of the expressions defined using
|
||||
/// an iteration for each of them.
|
||||
extern boost::regex version_checks[7];
|
||||
extern std::regex version_checks[7];
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Helper functions
|
||||
@@ -48,9 +48,6 @@ namespace loot {
|
||||
//Calculate the CRC of the given file for comparison purposes.
|
||||
uint32_t GetCrc32(const boost::filesystem::path& filename);
|
||||
|
||||
//Converts an integer to a string using BOOST's Spirit.Karma. Faster than a stringstream conversion.
|
||||
std::string IntToString(const int n);
|
||||
|
||||
//Converts an integer to a hex string using BOOST's Spirit.Karma. Faster than a stringstream conversion.
|
||||
std::string IntToHexString(const int n);
|
||||
|
||||
|
||||
@@ -27,11 +27,12 @@
|
||||
#include "parsers.h"
|
||||
#include "streams.h"
|
||||
|
||||
#include <regex>
|
||||
|
||||
#include <src/libespm.h>
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/log/trivial.hpp>
|
||||
#include <boost/locale.hpp>
|
||||
|
||||
@@ -123,7 +124,7 @@ namespace loot {
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Evaluating condition: " << _condition;
|
||||
|
||||
boost::unordered_map<std::string, bool>::const_iterator it = game.conditionCache.find(boost::to_lower_copy(_condition));
|
||||
unordered_map<std::string, bool>::const_iterator it = game.conditionCache.find(boost::to_lower_copy(_condition));
|
||||
if (it != game.conditionCache.end())
|
||||
return it->second;
|
||||
|
||||
@@ -371,12 +372,12 @@ namespace loot {
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << name << ": " << "Attempting to read the version from the description.";
|
||||
for(int j = 0; j < 7 && version.empty(); j++) {
|
||||
boost::smatch what;
|
||||
while (boost::regex_search(begin, end, what, version_checks[j])) {
|
||||
smatch what;
|
||||
while (regex_search(begin, end, what, version_checks[j])) {
|
||||
if (what.empty())
|
||||
continue;
|
||||
|
||||
boost::ssub_match match = what[1];
|
||||
ssub_match match = what[1];
|
||||
if (!match.matched)
|
||||
continue;
|
||||
|
||||
@@ -608,7 +609,7 @@ namespace loot {
|
||||
|
||||
//First need to get plugin's CRC.
|
||||
uint32_t crc = 0;
|
||||
boost::unordered_map<std::string,uint32_t>::iterator it = game.crcCache.find(boost::to_lower_copy(name));
|
||||
unordered_map<std::string,uint32_t>::iterator it = game.crcCache.find(boost::to_lower_copy(name));
|
||||
if (it != game.crcCache.end())
|
||||
crc = it->second;
|
||||
else if (boost::filesystem::exists(game.DataPath() / name)) {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "globals.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
|
||||
@@ -63,9 +63,9 @@ namespace loot {
|
||||
const git_error * last_error = giterr_last();
|
||||
std::string error_message;
|
||||
if (last_error == NULL)
|
||||
error_message = IntToString(error_code) + ".";
|
||||
error_message = to_string(error_code) + ".";
|
||||
else
|
||||
error_message = IntToString(error_code) + "; " + last_error->message;
|
||||
error_message = to_string(error_code) + "; " + last_error->message;
|
||||
free();
|
||||
giterr_clear();
|
||||
|
||||
@@ -275,7 +275,7 @@ namespace loot {
|
||||
string revision, date;
|
||||
git.ui_message = "An error occurred while trying to read information on the updated masterlist. If this error happens again, try deleting the \".git\" folder in \"%LOCALAPPDATA%\\LOOT\\" + game.FolderName() + "\".";
|
||||
do {
|
||||
string filespec = "refs/remotes/origin/" + game.RepoBranch() + "~" + IntToString(rollbacks);
|
||||
string filespec = "refs/remotes/origin/" + game.RepoBranch() + "~" + to_string(rollbacks);
|
||||
BOOST_LOG_TRIVIAL(info) << "Getting the Git object for the tree at " << filespec;
|
||||
git.call(git_revparse_single(&git.obj, git.repo, filespec.c_str()));
|
||||
|
||||
|
||||
@@ -38,11 +38,11 @@
|
||||
#include "helpers.h"
|
||||
#include "error.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
#include <regex>
|
||||
|
||||
#include <yaml-cpp/yaml.h>
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/algorithm/string/regex.hpp>
|
||||
@@ -555,7 +555,7 @@ namespace loot {
|
||||
}
|
||||
|
||||
uint32_t crc;
|
||||
boost::unordered_map<std::string,uint32_t>::iterator it = game->crcCache.find(boost::to_lower_copy(file));
|
||||
unordered_map<std::string,uint32_t>::iterator it = game->crcCache.find(boost::to_lower_copy(file));
|
||||
|
||||
if (it != game->crcCache.end())
|
||||
crc = it->second;
|
||||
|
||||
+15
-15
@@ -248,7 +248,7 @@ MiniEditor::MiniEditor(wxWindow *parent, const wxString& title, const std::list<
|
||||
int i = 0;
|
||||
for (list<loot::Plugin>::const_iterator it = _basePlugins.begin(); it != _basePlugins.end(); ++it) {
|
||||
pluginList->InsertItem(i, FromUTF8(it->Name()));
|
||||
pluginList->SetItem(i, 1, FromUTF8(loot::IntToString(loot::modulo(it->Priority(), loot::max_priority))));
|
||||
pluginList->SetItem(i, 1, FromUTF8(to_string(loot::modulo(it->Priority(), loot::max_priority))));
|
||||
if (abs(it->Priority()) >= loot::max_priority)
|
||||
pluginList->SetItem(i, 2, FromUTF8("\xE2\x9C\x93"));
|
||||
else
|
||||
@@ -286,7 +286,7 @@ void MiniEditor::OnPluginSelect(wxListEvent& event) {
|
||||
if (!currentPlugin.empty()) {
|
||||
ApplyEdits(currentPlugin, pluginList);
|
||||
//Also update the item's priority value in the plugins list in case it has changed.
|
||||
pluginList->SetItem(pluginList->FindItem(-1, currentPlugin), 1, FromUTF8(loot::IntToString(prioritySpin->GetValue())));
|
||||
pluginList->SetItem(pluginList->FindItem(-1, currentPlugin), 1, FromUTF8(to_string(prioritySpin->GetValue())));
|
||||
if (priorityCheckbox->IsChecked())
|
||||
pluginList->SetItem(pluginList->FindItem(-1, currentPlugin), 2, FromUTF8("\xE2\x9C\x93"));
|
||||
else
|
||||
@@ -382,7 +382,7 @@ void MiniEditor::OnFilterToggle(wxCommandEvent& event) {
|
||||
//or which load a BSA (if the selected plugin loads a BSA).
|
||||
if (*it == *pos || !it->MustLoadAfter(*pos) && (pos->DoFormIDsOverlap(*it) || (loadsBSA && it->LoadsBSA(_game)))) {
|
||||
pluginList->InsertItem(i, FromUTF8(it->Name()));
|
||||
pluginList->SetItem(i, 1, FromUTF8(loot::IntToString(it->Priority())));
|
||||
pluginList->SetItem(i, 1, FromUTF8(to_string(it->Priority())));
|
||||
if (it->FormIDs().empty()) {
|
||||
pluginList->SetItemTextColour(i, wxColour(122, 122, 122));
|
||||
}
|
||||
@@ -402,7 +402,7 @@ void MiniEditor::OnFilterToggle(wxCommandEvent& event) {
|
||||
int i = 0;
|
||||
for (list<loot::Plugin>::const_iterator it = plugins.begin(); it != plugins.end(); ++it) {
|
||||
pluginList->InsertItem(i, FromUTF8(it->Name()));
|
||||
pluginList->SetItem(i, 1, FromUTF8(loot::IntToString(it->Priority())));
|
||||
pluginList->SetItem(i, 1, FromUTF8(to_string(it->Priority())));
|
||||
if (it->FormIDs().empty()) {
|
||||
pluginList->SetItemTextColour(i, wxColour(122, 122, 122));
|
||||
}
|
||||
@@ -732,7 +732,7 @@ void Editor::OnPluginSelect(wxListEvent& event) {
|
||||
pluginList->SetItem(pluginList->FindItem(-1, currentPlugin), 0, FromUTF8("\xE2\x9C\x97"));
|
||||
}
|
||||
//Also update the item's priority value in the plugins list in case it has changed.
|
||||
pluginList->SetItem(pluginList->FindItem(-1, currentPlugin), 2, FromUTF8(loot::IntToString(prioritySpin->GetValue())));
|
||||
pluginList->SetItem(pluginList->FindItem(-1, currentPlugin), 2, FromUTF8(to_string(prioritySpin->GetValue())));
|
||||
if (priorityCheckbox->IsChecked())
|
||||
pluginList->SetItem(pluginList->FindItem(-1, currentPlugin), 3, FromUTF8("\xE2\x9C\x93"));
|
||||
else
|
||||
@@ -826,9 +826,9 @@ void Editor::OnPluginSelect(wxListEvent& event) {
|
||||
i=0;
|
||||
for (set<loot::PluginDirtyInfo>::const_iterator it=dirtyInfo.begin(), endit=dirtyInfo.end(); it != endit; ++it) {
|
||||
dirtyList->InsertItem(i, FromUTF8(loot::IntToHexString(it->CRC())));
|
||||
dirtyList->SetItem(i, 1, FromUTF8(loot::IntToString(it->ITMs())));
|
||||
dirtyList->SetItem(i, 2, FromUTF8(loot::IntToString(it->UDRs())));
|
||||
dirtyList->SetItem(i, 3, FromUTF8(loot::IntToString(it->DeletedNavmeshes())));
|
||||
dirtyList->SetItem(i, 1, FromUTF8(to_string(it->ITMs())));
|
||||
dirtyList->SetItem(i, 2, FromUTF8(to_string(it->UDRs())));
|
||||
dirtyList->SetItem(i, 3, FromUTF8(to_string(it->DeletedNavmeshes())));
|
||||
dirtyList->SetItem(i, 4, FromUTF8(it->CleaningUtility()));
|
||||
++i;
|
||||
}
|
||||
@@ -1038,9 +1038,9 @@ void Editor::OnAddRow(wxCommandEvent& event) {
|
||||
|
||||
long i = tagsList->GetItemCount();
|
||||
dirtyList->InsertItem(i, rowDialog->GetCRC());
|
||||
dirtyList->SetItem(i, 1, FromUTF8(loot::IntToString(rowDialog->GetITMs())));
|
||||
dirtyList->SetItem(i, 2, FromUTF8(loot::IntToString(rowDialog->GetUDRs())));
|
||||
dirtyList->SetItem(i, 3, FromUTF8(loot::IntToString(rowDialog->GetDeletedNavmeshes())));
|
||||
dirtyList->SetItem(i, 1, FromUTF8(to_string(rowDialog->GetITMs())));
|
||||
dirtyList->SetItem(i, 2, FromUTF8(to_string(rowDialog->GetUDRs())));
|
||||
dirtyList->SetItem(i, 3, FromUTF8(to_string(rowDialog->GetDeletedNavmeshes())));
|
||||
dirtyList->SetItem(i, 4, rowDialog->GetUtility());
|
||||
}
|
||||
}
|
||||
@@ -1134,9 +1134,9 @@ void Editor::OnEditRow(wxCommandEvent& event) {
|
||||
}
|
||||
|
||||
dirtyList->SetItem(i, 0, rowDialog->GetCRC());
|
||||
dirtyList->SetItem(i, 1, FromUTF8(loot::IntToString(rowDialog->GetITMs())));
|
||||
dirtyList->SetItem(i, 2, FromUTF8(loot::IntToString(rowDialog->GetUDRs())));
|
||||
dirtyList->SetItem(i, 3, FromUTF8(loot::IntToString(rowDialog->GetDeletedNavmeshes())));
|
||||
dirtyList->SetItem(i, 1, FromUTF8(to_string(rowDialog->GetITMs())));
|
||||
dirtyList->SetItem(i, 2, FromUTF8(to_string(rowDialog->GetUDRs())));
|
||||
dirtyList->SetItem(i, 3, FromUTF8(to_string(rowDialog->GetDeletedNavmeshes())));
|
||||
dirtyList->SetItem(i, 4, rowDialog->GetUtility());
|
||||
}
|
||||
}
|
||||
@@ -1458,7 +1458,7 @@ void Editor::AddPluginToList(const loot::Plugin& plugin, int position) {
|
||||
pluginList->InsertItem(position, "");
|
||||
|
||||
pluginList->SetItem(position, 1, FromUTF8(plugin.Name()));
|
||||
pluginList->SetItem(position, 2, FromUTF8(loot::IntToString(loot::modulo(plugin.Priority(), loot::max_priority))));
|
||||
pluginList->SetItem(position, 2, FromUTF8(to_string(loot::modulo(plugin.Priority(), loot::max_priority))));
|
||||
if (abs(plugin.Priority()) >= loot::max_priority)
|
||||
pluginList->SetItem(position, 3, FromUTF8("\xE2\x9C\x93"));
|
||||
else
|
||||
|
||||
+4
-4
@@ -42,6 +42,7 @@
|
||||
#include <iterator>
|
||||
#include <ctime>
|
||||
#include <clocale>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/filesystem/detail/utf8_codecvt_facet.hpp>
|
||||
@@ -54,8 +55,7 @@
|
||||
#include <boost/log/utility/setup/file.hpp>
|
||||
#include <boost/log/utility/setup/common_attributes.hpp>
|
||||
#include <boost/log/support/date_time.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
#include <wx/snglinst.h>
|
||||
#include <wx/aboutdlg.h>
|
||||
@@ -632,7 +632,7 @@ void Launcher::OnAbout(wxCommandEvent& event) {
|
||||
BOOST_LOG_TRIVIAL(debug) << "Opening About dialog.";
|
||||
wxAboutDialogInfo aboutInfo;
|
||||
aboutInfo.SetName("LOOT");
|
||||
aboutInfo.SetVersion(IntToString(g_version_major) + "." + IntToString(g_version_minor) + "." + IntToString(g_version_patch));
|
||||
aboutInfo.SetVersion(to_string(g_version_major) + "." + to_string(g_version_minor) + "." + to_string(g_version_patch));
|
||||
aboutInfo.SetDescription(translate("Load order optimisation for Oblivion, Skyrim, Fallout 3 and Fallout: New Vegas."));
|
||||
aboutInfo.SetCopyright("Copyright (C) 2012-2014 LOOT Team.");
|
||||
aboutInfo.SetWebSite("http://loot.github.io");
|
||||
@@ -1003,7 +1003,7 @@ void Launcher::OnEditMetadata(wxCommandEvent& event) {
|
||||
list<string> loadOrder;
|
||||
_game->GetLoadOrder(loadOrder);
|
||||
for (list<string>::const_iterator it = loadOrder.begin(), itend = loadOrder.end(); it != itend; ++it) {
|
||||
boost::unordered_map<string, loot::Plugin>::const_iterator pos = _game->plugins.find(*it);
|
||||
unordered_map<string, loot::Plugin>::const_iterator pos = _game->plugins.find(*it);
|
||||
|
||||
if (pos != _game->plugins.end())
|
||||
installed.push_back(pos->second);
|
||||
|
||||
Reference in New Issue
Block a user