How to use filesystem boost copy_file with qrc resources?

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

Re: How to use filesystem boost copy_file with qrc resources

Post by sirherrbatka » 19 Oct 2013, 16:16

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.

User avatar
Zini
Posts: 5134
Joined: 06 Aug 2011, 15:16

Re: How to use filesystem boost copy_file with qrc resources

Post by Zini » 19 Oct 2013, 16:23

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.

User avatar
sirherrbatka
Posts: 2121
Joined: 07 Aug 2011, 17:21

Re: How to use filesystem boost copy_file with qrc resources

Post by sirherrbatka » 19 Oct 2013, 16:42

You got something wrong there.
Nothing new ^_^'

User avatar
sirherrbatka
Posts: 2121
Joined: 07 Aug 2011, 17:21

Re: How to use filesystem boost copy_file with qrc resources

Post by sirherrbatka » 20 Oct 2013, 09:22

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.

User avatar
Zini
Posts: 5134
Joined: 06 Aug 2011, 15:16

Re: How to use filesystem boost copy_file with qrc resources

Post by Zini » 20 Oct 2013, 09:46

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.

User avatar
sirherrbatka
Posts: 2121
Joined: 07 Aug 2011, 17:21

Re: How to use filesystem boost copy_file with qrc resources

Post by sirherrbatka » 20 Oct 2013, 09:59

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.

User avatar
Zini
Posts: 5134
Joined: 06 Aug 2011, 15:16

Re: How to use filesystem boost copy_file with qrc resources

Post by Zini » 20 Oct 2013, 13:34

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.

User avatar
sirherrbatka
Posts: 2121
Joined: 07 Aug 2011, 17:21

Re: How to use filesystem boost copy_file with qrc resources

Post by sirherrbatka » 20 Oct 2013, 14:37

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.

User avatar
sirherrbatka
Posts: 2121
Joined: 07 Aug 2011, 17:21

Re: How to use filesystem boost copy_file with qrc resources

Post by sirherrbatka » 20 Oct 2013, 16:51

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests