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

Method installTinyCorePackage

source/ui/data/boxedContainer.cpp:740–775  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

738}
739
740void BoxedContainer::installTinyCorePackage(BString package) {
741 std::vector<BString> todo;
742 std::vector<BString> needsDownload;
743
744 todo.push_back(B("")); // signal last package, should do ldconfig
745 getTinyCorePackages(package, todo, needsDownload);
746
747 if (todo.size()==1) {
748 return;
749 }
750 if (!needsDownload.size()) {
751 doInstallTinyCorePackage(todo);
752 } else {
753 BString location = getCacheFolder();
754 if (!Fs::doesNativePathExist(location)) {
755 Fs::makeNativeDirs(location);
756 }
757 std::shared_ptr<FileSystemZip> fileSystem = this->fileSystem.lock();
758 std::vector<DownloadItem> items;
759 for (auto& package : needsDownload) {
760 items.push_back(DownloadItem(getTranslationWithFormat(Msg::DOWNLOADDLG_LABEL, true, package), fileSystem->tinyCoreURL + package, B(""), location.stringByApppendingPath(package), 0));
761 }
762 runOnMainUI([this, items, todo]() {
763 new DownloadDlg(Msg::DOWNLOADDLG_TITLE, items, [this, todo](bool success) {
764 runOnMainUI([success, this, todo]() {
765 if (success) {
766 doInstallTinyCorePackage(todo);
767 }
768 return false;
769 });
770 });
771 return false;
772 });
773 }
774
775}
776
777void BoxedContainer::installNextTinyCorePackage(WaitDlg* dlg, std::vector<BString> packages) {
778 if (packages.size() == 0) {

Callers 1

ContainersViewMethod · 0.80

Calls 8

BFunction · 0.85
DownloadItemClass · 0.85
getTranslationWithFormatFunction · 0.85
runOnMainUIFunction · 0.85
push_backMethod · 0.45
sizeMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected