change: allow deleting mods while preserving their metadata
Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
		| @@ -162,13 +162,14 @@ void Mod::setMetadata(Metadata::ModStruct* metadata) | ||||
|     } | ||||
| } | ||||
|  | ||||
| auto Mod::destroy(QDir& index_dir) -> bool | ||||
| auto Mod::destroy(QDir& index_dir, bool preserve_metadata) -> bool | ||||
| { | ||||
|     auto n = name(); | ||||
|     // FIXME: This can fail to remove the metadata if the | ||||
|     // "ModMetadataDisabled" setting is on, since there could | ||||
|     // be a name mismatch! | ||||
|     Metadata::remove(index_dir, n); | ||||
|     if(!preserve_metadata) | ||||
|         Metadata::remove(index_dir, n); | ||||
|  | ||||
|     m_type = MOD_UNKNOWN; | ||||
|     return FS::deletePath(m_file.filePath()); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user