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

Method load

source/ui/data/boxedContainer.cpp:24–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22#include "../../util/networkutils.h"
23
24bool BoxedContainer::load(BString dirPath) {
25 this->dirPath = dirPath;
26 BString iniFilePath = this->dirPath.stringByApppendingPath("container.ini");
27 ConfigFile config(iniFilePath);
28 this->name = config.readString(B("Name"), B(""));
29 BString wineVersion = config.readString(B("WineVersion"), B("")); // compat
30 this->fileSystemZipName = config.readString(B("FileSystemZipName"), wineVersion);
31 this->fileSystem = GlobalSettings::getInstalledFileSystemFromName(fileSystemZipName);
32 loadInstalledPackageList();
33
34 int i = 1;
35 while (true) {
36 BString mount = config.readString("Mount" + BString::valueOf(i), B(""));
37 if (mount.length() == 0) {
38 break;
39 }
40 std::vector<BString> parts;
41 mount.split('|', parts);
42 if (parts.size() != 2) {
43 kwarn_fmt("Failed to parse container %s mount command %s", this->name.c_str(), mount.c_str());
44 break;
45 }
46 this->mounts.push_back(MountInfo(parts[0], parts[1], parts[0].length() == 1));
47 i++;
48 }
49 bool result = this->name.length()>0;
50 if (result) {
51 this->loadApps();
52 }
53 return result;
54}
55
56BoxedContainer::~BoxedContainer() {
57 for (auto& app : this->apps) {

Callers 1

loadAppsMethod · 0.45

Calls 11

loadAppsMethod · 0.95
BFunction · 0.85
kwarn_fmtFunction · 0.85
MountInfoClass · 0.85
readStringMethod · 0.45
lengthMethod · 0.45
splitMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected