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

Method saveApp

source/ui/data/boxedApp.cpp:69–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69bool BoxedApp::saveApp() {
70 if (this->iniFilePath.length()==0) {
71 BString appDir = GlobalSettings::getAppFolder(this->container);
72 if (!Fs::doesNativePathExist(appDir)) {
73 if (!Fs::makeNativeDirs(appDir)) {
74 return false;
75 }
76 }
77 for (int i=0;i<10000;i++) {
78 BString iniPath = appDir.stringByApppendingPath(BString::valueOf(i) + ".ini");
79 if (!Fs::doesNativePathExist(iniPath)) {
80 this->iniFilePath = iniPath;
81 break;
82 }
83 }
84 }
85 ConfigFile config(iniFilePath);
86 config.writeString(B("Name"), this->name);
87 config.writeString(B("Link"), this->link);
88 config.writeString(B("Cmd"), this->cmd);
89 config.writeString(B("Icon"), this->iconPath);
90 config.writeString(B("Path"), this->path);
91 config.writeString(B("Resolution"),this->resolution);
92 config.writeInt(B("BPP"),this->bpp);
93 config.writeInt(B("Fullscreen"),this->fullScreen);
94 config.writeInt(B("VSync"), this->vsync);
95 config.writeBool(B("DpiAware"), this->dpiAware);
96 config.writeBool(B("DDrawOverride"), this->ddrawOverride);
97 config.writeBool(B("EnableDXVK"), this->enableDXVK);
98 config.writeBool(B("DisableHideCursor"), this->disableHideCursor);
99 config.writeBool(B("ForceRelativeMouse"), this->forceRelativeMouse);
100 config.writeBool(B("AutoRefresh"), this->autoRefresh);
101 config.writeString(B("AllowedGlExt"),this->glExt);
102 config.writeInt(B("Scale"),this->scale);
103 config.writeInt(B("ScaleQuality"),this->scaleQuality);
104 config.writeInt(B("CpuAffinity"),this->cpuAffinity);
105 config.writeInt(B("PollRate"), this->pollRate);
106 config.writeInt(B("SkipFramesFPS"), this->skipFramesFPS);
107 config.writeInt(B("OpenGL"), this->openGlType);
108 config.writeBool(B("IsWine"), this->isWine);
109 config.writeInt(B("uid"), this->uid);
110 config.writeInt(B("euid"), this->euid);
111
112 BString key;
113 for (int i = 0; i < (int)this->args.size(); i++) {
114 key = "Arg";
115 key += (i + 1);
116 config.writeString(key, this->args[i]);
117 }
118 config.saveChanges();
119 return true;
120}
121
122void BoxedApp::createAutomation() {
123 BString path = GlobalSettings::getAutomationFolder(this->container);

Callers 3

installMethod · 0.80
saveChangesMethod · 0.80
drawItemsMethod · 0.80

Calls 8

BFunction · 0.85
writeStringMethod · 0.80
writeIntMethod · 0.80
writeBoolMethod · 0.80
lengthMethod · 0.45
sizeMethod · 0.45
saveChangesMethod · 0.45

Tested by

no test coverage detected