Merge pull request #251 from loot/small-stuff

Fix indentation mix + ignore VIM's temp. files ("*~")
This commit is contained in:
WrinklyNinja
2014-08-26 16:20:59 +01:00
9 changed files with 368 additions and 364 deletions
+5 -5
View File
@@ -10,13 +10,13 @@
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
+4
View File
@@ -26,6 +26,10 @@
*.sql
*.sqlite
# Temporary files #
##################3
*~
# OS generated files #
######################
.DS_Store
+2 -2
View File
@@ -459,7 +459,7 @@ A copy of the license is included in the file named "GNU FDL v1.3.txt".</blockqu
<li>Added: Command line parameter for selecting the game LOOT should run for.
<li>Added: Finnish translation.
<li>Removed: Support for Windows XP.
<li>Removed: Support for loading BOSS masterlists using the API. This was a leftover from when LOOT was BOSSv3 and backwards compatibility was an issue.
<li>Removed: Support for loading BOSS masterlists using the API. This was a leftover from when LOOT was BOSSv3 and backwards compatibility was an issue.
<li>Removed: The ability to open reports in an external browser. This was necessitated by the changes to report generation.
<li>Removed: The MSVC 2013 redistributable requirement.
<li>Removed: The "None Specified" language option is no longer available: English is the new default.
@@ -486,7 +486,7 @@ A copy of the license is included in the file named "GNU FDL v1.3.txt".</blockqu
<h3>0.5.0 - <i>31 March 2014</i></h3>
<ul>
<li>Initial release.
<li>Initial release.
</ul>
<script>
+11 -11
View File
@@ -7,7 +7,7 @@
----------------------------------------------------------------------
LINKING EXCEPTION
LINKING EXCEPTION
In addition to the permissions in the GNU General Public License,
the authors give you unlimited permission to link the compiled
@@ -20,15 +20,15 @@
----------------------------------------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -78,7 +78,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -277,7 +277,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -299,9 +299,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -391,12 +391,12 @@ Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
The priority queue implementation is based on code licensed under the
Apache 2.0 license:
Copyright 2010 Volkan Yazıcı <volkan.yazici@gmail.com>
Copyright 2006-2010 The Apache Software Foundation
Copyright 2010 Volkan Yazıcı <volkan.yazici@gmail.com>
Copyright 2006-2010 The Apache Software Foundation
The full text of the Apache 2.0 license is available at:
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
----------------------------------------------------------------------
+2 -2
View File
@@ -40,9 +40,9 @@ namespace YAML {
for (const auto &element: rhs) {
out << element;
}
out << EndSeq;
out << EndSeq;
return out;
return out;
}
template<class T, class Hash>
+40 -40
View File
@@ -64,58 +64,58 @@ namespace loot {
namespace lc = boost::locale;
/// REGEX expression definition
/// Each expression is composed of three parts:
/// 1. The marker string "version", "ver", "rev", "v" or "r"
/// 2. The version string itself.
/// REGEX expression definition
/// Each expression is composed of three parts:
/// 1. The marker string "version", "ver", "rev", "v" or "r"
/// 2. The version string itself.
const char* regex1 =
"^(?:\\bversion\\b[ ]*(?:[:.\\-]?)|\\brevision\\b(?:[:.\\-]?))[ ]*"
"((?:alpha|beta|test|debug)?\\s*[-0-9a-zA-Z._+]+\\s*(?:alpha|beta|test|debug)?\\s*(?:[0-9]*))$"
;
const char* regex1 =
"^(?:\\bversion\\b[ ]*(?:[:.\\-]?)|\\brevision\\b(?:[:.\\-]?))[ ]*"
"((?:alpha|beta|test|debug)?\\s*[-0-9a-zA-Z._+]+\\s*(?:alpha|beta|test|debug)?\\s*(?:[0-9]*))$"
;
const char* regex2 =
"(?:\\bversion\\b(?:[ :]?)|\\brevision\\b(?:[:.\\-]?))[ ]*"
"([0-9][-0-9a-zA-Z._]+\\+?)"
;
const char* regex2 =
"(?:\\bversion\\b(?:[ :]?)|\\brevision\\b(?:[:.\\-]?))[ ]*"
"([0-9][-0-9a-zA-Z._]+\\+?)"
;
const char* regex3 =
"(?:\\bver(?:[:.]?)|\\brev(?:[:.]?))\\s*"
"([0-9][-0-9a-zA-Z._]*\\+?)"
;
const char* regex3 =
"(?:\\bver(?:[:.]?)|\\brev(?:[:.]?))\\s*"
"([0-9][-0-9a-zA-Z._]*\\+?)"
;
// Matches "Updated: <date>" for the Bashed patch
const char* regex4 =
"(?:Updated:)\\s*"
"([-0-9aAmMpP/ :]+)$"
;
// Matches "Updated: <date>" for the Bashed patch
const char* regex4 =
"(?:Updated:)\\s*"
"([-0-9aAmMpP/ :]+)$"
;
// Matches isolated versions as last resort
const char* regex5 =
"(?:(?:\\bv|\\br)(?:\\s?)(?:[-.:])?(?:\\s*))"
"((?:(?:\\balpha\\b)?|(?:\\bbeta\\b)?)\\s*[0-9][-0-9a-zA-Z._]*\\+?)"
;
// Matches isolated versions as last resort
const char* regex5 =
"(?:(?:\\bv|\\br)(?:\\s?)(?:[-.:])?(?:\\s*))"
"((?:(?:\\balpha\\b)?|(?:\\bbeta\\b)?)\\s*[0-9][-0-9a-zA-Z._]*\\+?)"
;
// Matches isolated versions as last resort
const char* regex6 =
"((?:(?:\\balpha\\b)?|(?:\\bbeta\\b)?)\\s*\\b[0-9][-0-9a-zA-Z._]*\\+?)$"
;
// Matches isolated versions as last resort
const char* regex6 =
"((?:(?:\\balpha\\b)?|(?:\\bbeta\\b)?)\\s*\\b[0-9][-0-9a-zA-Z._]*\\+?)$"
;
const char* regex7 =
"(^\\bmark\\b\\s*\\b[IVX0-9][-0-9a-zA-Z._+]*\\s*(?:alpha|beta|test|debug)?\\s*(?:[0-9]*)?)$"
;
const char* regex7 =
"(^\\bmark\\b\\s*\\b[IVX0-9][-0-9a-zA-Z._+]*\\s*(?:alpha|beta|test|debug)?\\s*(?:[0-9]*)?)$"
;
/// Array used to try each of the expressions defined above using
/// an iteration for each of them.
/// Array used to try each of the expressions defined above using
/// an iteration for each of them.
regex version_checks[7] = {
regex(regex1, regex::ECMAScript | regex::icase),
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)
};
};
//////////////////////////////////////////////////////////////////////////
// Helper functions
@@ -263,10 +263,10 @@ namespace loot {
Construct(Language::polish);
else if (nameOrCode == Language(Language::brazilian_portuguese).Name() || nameOrCode == Language(Language::brazilian_portuguese).Locale())
Construct(Language::brazilian_portuguese);
else if (nameOrCode == Language(Language::finnish).Name() || nameOrCode == Language(Language::finnish).Locale())
Construct(Language::finnish);
else if (nameOrCode == Language(Language::finnish).Name() || nameOrCode == Language(Language::finnish).Locale())
Construct(Language::finnish);
else if (nameOrCode == Language(Language::german).Name() || nameOrCode == Language(Language::german).Locale())
Construct(Language::german);
Construct(Language::german);
else
Construct(Language::english);
}
+1 -1
View File
@@ -35,7 +35,7 @@
namespace loot {
/// Array used to try each of the expressions defined using
/// an iteration for each of them.
/// an iteration for each of them.
extern std::regex version_checks[7];
//////////////////////////////////////////////////////////////////////////
+19 -19
View File
@@ -307,12 +307,12 @@ namespace loot {
name = name.substr(0, name.length() - 6);
}
Plugin::Plugin(loot::Game& game, const std::string& n, const bool headerOnly)
Plugin::Plugin(loot::Game& game, const std::string& n, const bool headerOnly)
: name(n), enabled(true), priority(0), isMaster(false), crc(0), numOverrideRecords(0), _isPriorityExplicit(false) {
// Get data from file contents using libespm. Assumes libespm has already been initialised.
// Get data from file contents using libespm. Assumes libespm has already been initialised.
BOOST_LOG_TRIVIAL(trace) << name << ": " << "Opening with libespm...";
boost::filesystem::path filepath = game.DataPath() / name;
boost::filesystem::path filepath = game.DataPath() / name;
//In case the plugin is ghosted, but the extension already got trimmed.
if (!boost::filesystem::exists(filepath) && boost::filesystem::exists(filepath.string() + ".ghost"))
@@ -341,10 +341,10 @@ namespace loot {
}
BOOST_LOG_TRIVIAL(trace) << name << ": " << "Checking master flag.";
isMaster = file->isMaster(game.espm_settings);
isMaster = file->isMaster(game.espm_settings);
BOOST_LOG_TRIVIAL(trace) << name << ": " << "Getting masters.";
masters = file->getMasters();
masters = file->getMasters();
BOOST_LOG_TRIVIAL(trace) << name << ": " << "Number of masters: " << masters.size();
@@ -352,12 +352,12 @@ namespace loot {
game.crcCache.insert(pair<string, uint32_t>(n, crc));
BOOST_LOG_TRIVIAL(trace) << name << ": " << "Getting the FormIDs.";
vector<uint32_t> records = file->getFormIDs();
vector<uint32_t> records = file->getFormIDs();
vector<string> plugins = masters;
plugins.push_back(name);
for (const auto &record: records) {
for (const auto &record: records) {
FormID fid = FormID(plugins, record);
formIDs.insert(fid);
formIDs.insert(fid);
if (!boost::iequals(fid.Plugin(), name))
++numOverrideRecords;
}
@@ -409,7 +409,7 @@ namespace loot {
BOOST_LOG_TRIVIAL(trace) << name << ": " << "Extracted Bash Tag: " << tag;
tags.insert(Tag(tag));
}
}
}
void Plugin::MergeMetadata(const Plugin& plugin) {
BOOST_LOG_TRIVIAL(trace) << "Merging metadata for: " << name;
@@ -658,8 +658,8 @@ namespace loot {
}
const std::set<FormID>& Plugin::FormIDs() const {
return formIDs;
}
return formIDs;
}
bool Plugin::DoFormIDsOverlap(const Plugin& plugin) const {
//Basically std::set_intersection except with an early exit instead of an append to results.
@@ -700,17 +700,17 @@ namespace loot {
for (const auto &formID : formIDs) {
if (!boost::iequals(formID.Plugin(), name))
fidSubset.insert(formID);
}
return fidSubset;
}
return fidSubset;
}
std::vector<std::string> Plugin::Masters() const {
return masters;
}
std::vector<std::string> Plugin::Masters() const {
return masters;
}
bool Plugin::IsMaster() const {
return isMaster;
}
bool Plugin::IsMaster() const {
return isMaster;
}
std::string Plugin::Version() const {
return version;
+284 -284
View File
File diff suppressed because it is too large Load Diff