How to use filesystem boost copy_file with qrc resources?

Involved development of the OpenMW construction set.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: How to use filesystem boost copy_file with qrc resources

Post 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.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: How to use filesystem boost copy_file with qrc resources

Post 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.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: How to use filesystem boost copy_file with qrc resources

Post 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!
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: How to use filesystem boost copy_file with qrc resources

Post 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).
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: How to use filesystem boost copy_file with qrc resources

Post by Zini »

Oops. No you can't do that. Instead add a setResourcesPath function to DocumentManager, that is called from Editor.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: How to use filesystem boost copy_file with qrc resources

Post by sirherrbatka »

DocumentManager or Document? I ask just to be sure ;-)

PS
NVM, I got it.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: How to use filesystem boost copy_file with qrc resources

Post 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.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: How to use filesystem boost copy_file with qrc resources

Post 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.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: How to use filesystem boost copy_file with qrc resources

Post 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.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: How to use filesystem boost copy_file with qrc resources

Post 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.
Post Reply