From 15ab8d5c5e9b5a06ad61247aa81f4673a42595e6 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Sat, 29 Sep 2018 15:07:24 +0200 Subject: Changed "ignore missing game data" to not create an empty Texture folder and instead save the choice in meta.ini --- src/modinforegular.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/modinforegular.cpp') diff --git a/src/modinforegular.cpp b/src/modinforegular.cpp index 1e77e050..1d84e2c8 100644 --- a/src/modinforegular.cpp +++ b/src/modinforegular.cpp @@ -31,6 +31,7 @@ ModInfoRegular::ModInfoRegular(PluginContainer *pluginContainer, const IPluginGa , m_GameName(game->gameShortName()) , m_IsAlternate(false) , m_Converted(false) + , m_Validated(false) , m_MetaInfoChanged(false) , m_EndorsedState(ENDORSED_UNKNOWN) , m_NexusBridge(pluginContainer) @@ -86,6 +87,7 @@ void ModInfoRegular::readMeta() m_NexusDescription = metaFile.value("nexusDescription", "").toString(); m_Repository = metaFile.value("repository", "Nexus").toString(); m_Converted = metaFile.value("converted", false).toBool(); + m_Validated = metaFile.value("validated", false).toBool(); m_URL = metaFile.value("url", "").toString(); m_LastNexusQuery = QDateTime::fromString(metaFile.value("lastNexusQuery", "").toString(), Qt::ISODate); if (metaFile.contains("endorsed")) { @@ -150,6 +152,7 @@ void ModInfoRegular::saveMeta() metaFile.setValue("url", m_URL); metaFile.setValue("lastNexusQuery", m_LastNexusQuery.toString(Qt::ISODate)); metaFile.setValue("converted", m_Converted); + metaFile.setValue("validated", m_Validated); if (m_EndorsedState != ENDORSED_UNKNOWN) { metaFile.setValue("endorsed", m_EndorsedState); } @@ -415,6 +418,13 @@ void ModInfoRegular::markConverted(bool converted) emit modDetailsUpdated(true); } +void ModInfoRegular::markValidated(bool validated) +{ + m_Validated = validated; + m_MetaInfoChanged = true; + saveMeta(); + emit modDetailsUpdated(true); +} QString ModInfoRegular::absolutePath() const { @@ -438,7 +448,7 @@ std::vector ModInfoRegular::getFlags() const if ((m_NexusID > 0) && (endorsedState() == ENDORSED_FALSE)) { result.push_back(ModInfo::FLAG_NOTENDORSED); } - if (!isValid()) { + if (!isValid() && !m_Validated) { result.push_back(ModInfo::FLAG_INVALID); } if (m_Notes.length() != 0) { @@ -514,7 +524,7 @@ std::vector ModInfoRegular::getContents() const int ModInfoRegular::getHighlight() const { - if (!isValid()) + if (!isValid() && !m_Validated) return HIGHLIGHT_INVALID; auto flags = getFlags(); if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_PLUGIN_SELECTED) != flags.end()) @@ -525,7 +535,7 @@ int ModInfoRegular::getHighlight() const QString ModInfoRegular::getDescription() const { - if (!isValid()) { + if (!isValid() && !m_Validated) { return tr("%1 contains no esp/esm/esl and no asset (textures, meshes, interface, ...) directory").arg(name()); } else { const std::set &categories = getCategories(); -- cgit v1.3.1