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:
WrinklyNinja
2013-10-12 20:59:35 +01:00
parent 1f31d62174
commit 9cf84ecda3
3 changed files with 6 additions and 7 deletions
+4 -1
View File
@@ -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;
}
}
+1 -1
View File
@@ -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
View File
@@ -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()),