Browse Source

replace boost with qt (fix android crash)

Laserlicht 10 months ago
parent
commit
922d467d77
1 changed files with 6 additions and 8 deletions
  1. 6 8
      launcher/modManager/chroniclesextractor.cpp

+ 6 - 8
launcher/modManager/chroniclesextractor.cpp

@@ -129,16 +129,14 @@ void ChroniclesExtractor::createBaseMod() const
 
 	for(auto & dataPath : VCMIDirs::get().dataPaths())
 	{
-		auto file = dataPath / "config" / "heroes" / "portraitsChronicles.json";
+		auto file = pathToQString(dataPath / "config" / "heroes" / "portraitsChronicles.json");
 		auto destFolder = VCMIDirs::get().userDataPath() / "Mods" / "chronicles" / "content" / "config";
-		if(boost::filesystem::exists(file))
+		auto destFile = pathToQString(destFolder / "portraitsChronicles.json");
+		if(QFile::exists(file))
 		{
-			boost::filesystem::create_directories(destFolder);
-#if BOOST_VERSION >= 107400
-			boost::filesystem::copy_file(file, destFolder / "portraitsChronicles.json", boost::filesystem::copy_options::overwrite_existing);
-#else
-			boost::filesystem::copy_file(file, destFolder / "portraitsChronicles.json", boost::filesystem::copy_option::overwrite_if_exists);
-#endif
+			QDir().mkpath(pathToQString(destFolder));
+			QFile::remove(destFile);
+			QFile::copy(file, destFile);
 		}
 	}
 }