emersonrp / bindcontrol

Keybind manager for City of Heroes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Errno 2] (sic) in 0.18.2 when writing binds from a "new profile" before saving.

xizar opened this issue · comments

From the error log window:

11:40:22: Error: Profile F:\TCB\Default.bcp could not be loaded: [Errno 2] No such file or directory: 'F:\TCB\Default.bcp'

This is with a "name" entered. Saving the profile to a meaningful name averts this.

Setting "name" to "default" and writing binds works as naively expected... a directory named "\default" is created, populated with appropriate binds. Trying to save this profile as "default.bcp" (again, naively assuming the character's name actually is "default") throws "Profile Name is not valid, please correct this." Another generous helping of naivete on the part of the user might want for guidance here (can't use "default").

Cynically, you know there's some guy playing CoX who has named all of his characters some variation on "default" "new profile" "generic name", et al. (for clarity, I have not done this.)

Ah yeah the handling of "Default" has had some attention recently and still needs more. The storing of the default profile as an actual profile named "Default" is in retrospect a poor decision and I may try to migrate away from that design choice. It would bloat the Prefs file dramatically (though, to be fair, from like 1kb to like 35kb) to keep it in there but that might be the indicated place for it. I'll ponder this and make it better.

Edit: meanwhile I'll try to fix up this specific error yes.

Ah looking at this a little bit, my educated guess is that you did "New Profile" as you mention, but have never had a Default profile saved. The error was thrown at that time, as the app looked for the Default profile to fill out the new profile, and there wasn't one. That's just an oversight and I can fix that, though I'm leaning toward spending this afternoon moving the default profile into the app's preferences file and being done with this filename juggle.

This error is fixed on main and will be part of the next release. That release may well be the larger issue of where to store the default profile, unless bugs come up. In the meantime, the error is ugly but harmless -- "new profile" will just give you a blankish profile as expected. Gonna close this and continue this work on #60.