Page 2 of 4

Re: How to use filesystem boost copy_file with qrc resources

Posted: 16 Oct 2013, 17:01
by sirherrbatka
heh, great. I'm not sure how to store anything in mCfgMgr, and no idea how to read from it. I think I will pass this time. Sorry for wasted time.

Re: How to use filesystem boost copy_file with qrc resources

Posted: 16 Oct 2013, 19:31
by Zini
You don't store anything the the configuration manager. I guess the easiest method would be to add a member variable to Editor that stores the resources path.

Re: How to use filesystem boost copy_file with qrc resources

Posted: 16 Oct 2013, 19:39
by sirherrbatka
heh, actually i did this (modeling after engine.cpp).

Ok, if so:
a) I have a switch that appears to work for help.
b) I can store path with it (works just like in engine).
c) I should initalize this variable with default value when not using switch.
d) I should make a public method to return path.

if (a && b && c && d)
{
herrbatka.facepalm();
}

PS
I can't help, being noob is no fun!

Re: How to use filesystem boost copy_file with qrc resources

Posted: 16 Oct 2013, 19:51
by Zini
a) I have a switch that appears to work for help.
I assume you mean "resources" instead of "help".
c) I should initalize this variable with default value when not using switch.
The default value would be an empty path, which is what you get anyway. Nothing to do here.
I should make a public method to return path.
Not really, since no other part of OpenCS is using the Editor class. Instead you should pass the value down through the constructors of those members of Editor that need it (that would be the DocumentManager in this case).

Re: How to use filesystem boost copy_file with qrc resources

Posted: 16 Oct 2013, 19:52
by Zini
Oops. No you can't do that. Instead add a setResourcesPath function to DocumentManager, that is called from Editor.

Re: How to use filesystem boost copy_file with qrc resources

Posted: 17 Oct 2013, 16:03
by sirherrbatka
DocumentManager or Document? I ask just to be sure ;-)

PS
NVM, I got it.

Re: How to use filesystem boost copy_file with qrc resources

Posted: 17 Oct 2013, 18:23
by sirherrbatka
Ok, program works. It took ages :roll:. I didn't touched cmake just yet.

Anyway I think that:
a) --resources sounds a bit cryptic for a simply default filters. Do we want to implement any other "resources"?
b) we can make content dir switch in the editor.

Re: How to use filesystem boost copy_file with qrc resources

Posted: 17 Oct 2013, 18:34
by Zini
a) --resources sounds a bit cryptic for a simply default filters. Do we want to implement any other "resources"?
These are the global resources, used in both OpenMW and OpenCS. We use this switch, so we can easily pull them from the installed software or locally (running without installing). I don't see what is cryptic about that.
b) we can make content dir switch in the editor.
I have no idea what you mean by that.

Re: How to use filesystem boost copy_file with qrc resources

Posted: 17 Oct 2013, 18:45
by sirherrbatka
These are the global resources, used in both OpenMW and OpenCS. We use this switch, so we can easily pull them from the installed software or locally (running without installing). I don't see what is cryptic about that.
Right. Mind if I add a little bit of description in OpenCS? Just explaining what this switch does in case of this application.
I have no idea what you mean by that.
Sorry. I meant the:

--data arg (=data) set data directories (later have higher priority)

My impression is that it allow to choose alternative "data files" path.

Re: How to use filesystem boost copy_file with qrc resources

Posted: 17 Oct 2013, 19:19
by Zini
Right. Mind if I add a little bit of description in OpenCS? Just explaining what this switch does in case of this application.
The --resources switch dose exactly the same in OpenCS as it does in OpenMW. Therefore it should have the same description in both programs. If you want expand it a bit, that is fine with me.
Sorry. I meant the:

--data arg (=data) set data directories (later have higher priority)

My impression is that it allow to choose alternative "data files" path.
Already implemented.