mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Misc. fixes.
* Dirty CRCs are now written out to YAML as hex strings, and plugins have their dirty info written out. * Dirty info is now taken into account when checking if a plugin has any metadata or not. * Implemented neater string -> hex int conversion.
This commit is contained in:
@@ -682,7 +682,7 @@ namespace YAML {
|
||||
|
||||
inline Emitter& operator << (Emitter& out, const boss::PluginDirtyInfo& rhs) {
|
||||
out << BeginMap
|
||||
<< Key << "crc" << Value << rhs.CRC()
|
||||
<< Key << "crc" << Value << Hex << rhs.CRC() << Dec
|
||||
<< Key << "util" << Value << rhs.CleaningUtility();
|
||||
|
||||
if (rhs.ITMs() > 0)
|
||||
@@ -809,6 +809,9 @@ namespace YAML {
|
||||
if (!rhs.Tags().empty())
|
||||
out << Key << "tag" << Value << rhs.Tags();
|
||||
|
||||
if (!rhs.DirtyInfo().empty())
|
||||
out << Key << "dirty" << Value << rhs.DirtyInfo();
|
||||
|
||||
out << EndMap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -612,7 +612,7 @@ namespace boss {
|
||||
}
|
||||
|
||||
bool Plugin::HasNameOnly() const {
|
||||
return priority == 0 && enabled == true && loadAfter.empty() && requirements.empty() && incompatibilities.empty() && messages.empty() && tags.empty();
|
||||
return priority == 0 && enabled == true && loadAfter.empty() && requirements.empty() && incompatibilities.empty() && messages.empty() && tags.empty() && _dirtyInfo.empty();
|
||||
}
|
||||
|
||||
bool Plugin::IsRegexPlugin() const {
|
||||
|
||||
+1
-5
@@ -26,7 +26,6 @@
|
||||
#include "../backend/streams.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
@@ -904,10 +903,7 @@ boss::Tag Editor::RowToTag(wxListView * list, long row) const {
|
||||
|
||||
boss::PluginDirtyInfo Editor::RowToPluginDirtyInfo(wxListView * list, long row) const {
|
||||
string text(list->GetItemText(row, 0).ToUTF8());
|
||||
uint32_t crc;
|
||||
std::stringstream ss;
|
||||
ss << std::hex << text;
|
||||
ss >> crc;
|
||||
uint32_t crc = strtoul(text.c_str(), NULL, 16);
|
||||
return boss::PluginDirtyInfo(
|
||||
crc,
|
||||
atoi(string(list->GetItemText(row, 1).ToUTF8()).c_str()),
|
||||
|
||||
Reference in New Issue
Block a user