MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / overrideFolder

Function overrideFolder

launcher/FileSystem.cpp:1146–1165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1144}
1145
1146bool overrideFolder(QString overwritten_path, QString override_path)
1147{
1148 using copy_opts = fs::copy_options;
1149
1150 if (!FS::ensureFolderPathExists(overwritten_path))
1151 return false;
1152
1153 std::error_code err;
1154 fs::copy_options opt = copy_opts::recursive | copy_opts::overwrite_existing;
1155
1156 // FIXME: hello traveller! Apparently std::copy does NOT overwrite existing files on GNU libstdc++ on Windows?
1157 fs::copy(StringUtils::toStdString(override_path), StringUtils::toStdString(overwritten_path), opt, err);
1158
1159 if (err) {
1160 qCritical() << QString("Failed to apply override from %1 to %2").arg(override_path, overwritten_path);
1161 qCritical() << "Reason:" << QString::fromStdString(err.message());
1162 }
1163
1164 return err.value() == 0;
1165}
1166
1167QString getFilesystemTypeName(FilesystemType type)
1168{

Callers 2

commitStagedInstanceMethod · 0.85
createInstanceMethod · 0.85

Calls 6

ensureFolderPathExistsFunction · 0.85
copyClass · 0.85
toStdStringFunction · 0.85
QStringClass · 0.85
fromStdStringFunction · 0.85
valueMethod · 0.80

Tested by

no test coverage detected