MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / downloadFileSystem

Method downloadFileSystem

source/ui/data/globalSettings.cpp:855–881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

853}
854
855void GlobalSettings::downloadFileSystem(const std::shared_ptr<FileSystemZip>& version, std::function<void(bool)> onCompleted) {
856 runOnMainUI([version, onCompleted]() {
857 BString filePath = version->getLocalFilePath();
858 if (!Fs::doesNativePathExist(GlobalSettings::getFileSystemFolder())) {
859 Fs::makeNativeDirs(GlobalSettings::getFileSystemFolder());
860 }
861 std::vector<DownloadItem> items;
862 items.push_back(DownloadItem(getTranslationWithFormat(Msg::DOWNLOADDLG_LABEL, true, version->name), version->filePath, version->filePathBackup, filePath, ((U64)(version->size)) * 1024 * 1024));
863 std::shared_ptr<FileSystemZip> depend = version->getMissingDependency();
864 if (depend) {
865 items.push_back(DownloadItem(getTranslationWithFormat(Msg::DOWNLOADDLG_LABEL, true, depend->name), depend->filePath, depend->filePathBackup, depend->getLocalFilePath(), ((U64)(depend->size)) * 1024 * 1024));
866 }
867 new DownloadDlg(Msg::DOWNLOADDLG_TITLE, items, [onCompleted](bool success) {
868 runOnMainUI([success, onCompleted]() {
869 GlobalSettings::reloadWineVersions();
870 if (!GlobalSettings::defaultFont) {
871 GlobalSettings::restartUI = true;
872 }
873 if (onCompleted) {
874 onCompleted(success);
875 }
876 return false;
877 });
878 });
879 return false;
880 });
881}
882
883void GlobalSettings::useFastFrameRate(bool useFast) {
884 if (useFast) {

Callers

nothing calls this directly

Calls 6

runOnMainUIFunction · 0.85
DownloadItemClass · 0.85
getTranslationWithFormatFunction · 0.85
getLocalFilePathMethod · 0.80
getMissingDependencyMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected