Page 4 of 4

Re: How to use filesystem boost copy_file with qrc resources

Posted: 19 Oct 2013, 16:16
by sirherrbatka
hm, right.

Also: I don't quite think that this belongs to the editor itself. I shouldn't change whole resources path based on the existance (or lack) of the single file. I'm wonder if I can move this to the document.cpp instead.

Re: How to use filesystem boost copy_file with qrc resources

Posted: 19 Oct 2013, 16:23
by Zini
Huh? You got something wrong there. You are not supposed to change the resources path.

Just look if there is a file in the user location. If it is, use it. Otherwise use the file in the resources path location.

Re: How to use filesystem boost copy_file with qrc resources

Posted: 19 Oct 2013, 16:42
by sirherrbatka
You got something wrong there.
Nothing new ^_^'

Re: How to use filesystem boost copy_file with qrc resources

Posted: 20 Oct 2013, 09:22
by sirherrbatka
Ok, once again about defaultfilters vs *.omwaddon.project.

I don't think we should get rid of extension. This way it will be easy to see for every user that he is free to open this file with editor.

Re: How to use filesystem boost copy_file with qrc resources

Posted: 20 Oct 2013, 09:46
by Zini
Actually, that is not the case. The user should not open this file manually. If the user wants to modify the default filters all he has to do is to create a new addon or (preferably) a new game. This will automatically pull in the old default filters.

Re: How to use filesystem boost copy_file with qrc resources

Posted: 20 Oct 2013, 09:59
by sirherrbatka
Ok, done.

I still need to properly edit cmake file, I guess that:

Code: Select all

configure_file(${OpenMW_SOURCE_DIR}/files/opencs/defaultfilters.omwaddon.project
    "${OpenMW_BINARY_DIR}/resources/defaultfilters" COPYONLY)
Is not what I should do, clearly.

Re: How to use filesystem boost copy_file with qrc resources

Posted: 20 Oct 2013, 13:34
by Zini
I suggest to also change the file name in the source directory. And I think you also need an INSTALL line in the cmake file.

Re: How to use filesystem boost copy_file with qrc resources

Posted: 20 Oct 2013, 14:37
by sirherrbatka
I suggest to also change the file name in the source directory
ok.
And I think you also need an INSTALL line in the cmake file.
I'm just exploring the topic.

Re: How to use filesystem boost copy_file with qrc resources

Posted: 20 Oct 2013, 16:51
by sirherrbatka
Ok, I think that everything works. I didn't have to add install inside cmake because:

Code: Select all

  # Install resources
    INSTALL(DIRECTORY "${OpenMW_BINARY_DIR}/resources" DESTINATION "${DATADIR}" FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT "Resources")
    INSTALL(DIRECTORY DESTINATION "${DATADIR}/data" COMPONENT "Resources")
is already here.

Can somebody confirm that this will work fine, please? I tested only on my own machine.