While we are at it, may I ask for one more enhancement?
When loading the global resources file, first look in the user directory and if the file exists there, use that one instead. This will allow more advanced users to customise the filters for new projects.
How to use filesystem boost copy_file with qrc resources?
- sirherrbatka
- Posts: 2159
- Joined: 07 Aug 2011, 17:21
Re: How to use filesystem boost copy_file with qrc resources
Really? I didn't found any switch handling in OpenCS code. Using opencs --help also showed nothing. Either I missunderstood you or I broke something… really bad.Already implemented.
Sounds like a good idea.When loading the global resources file, first look in the user directory and if the file exists there, use that one instead. This will allow more advanced users to customise the filters for new projects.
Re: How to use filesystem boost copy_file with qrc resources
Right. There are still bits and pieces missing. Currently the switches are pulled only from the openmw.cfg files. Command line input is not implemented yet. But it doesn't really matter for the time being.Really? I didn't found any switch handling in OpenCS code. Using opencs --help also showed nothing. Either I missunderstood you or I broke something… really bad.
- sirherrbatka
- Posts: 2159
- Joined: 07 Aug 2011, 17:21
Re: How to use filesystem boost copy_file with qrc resources
This is so stupid that I don't know where to begin.
When you asked about switch, I was sure you refer to the command line switch. So I implemented it.
When you asked about switch, I was sure you refer to the command line switch. So I implemented it.
Re: How to use filesystem boost copy_file with qrc resources
I guess I could have been clearer about that, but I was actually not aware that this part was still missing until I looked at it following one of your postings. OpenCS is still a bit piecemeal.
- sirherrbatka
- Posts: 2159
- Joined: 07 Aug 2011, 17:21
Re: How to use filesystem boost copy_file with qrc resources
At least we have a command arguments handling now. That's something, right?
- sirherrbatka
- Posts: 2159
- Joined: 07 Aug 2011, 17:21
Re: How to use filesystem boost copy_file with qrc resources
Or not. I think I made this wrong.
Currently arguments go from main to the editor.run. Editor.run feeds arguments to the parser.
I think this should be rather done inside constructor. Am I right?
Currently arguments go from main to the editor.run. Editor.run feeds arguments to the parser.
I think this should be rather done inside constructor. Am I right?
- sirherrbatka
- Posts: 2159
- Joined: 07 Aug 2011, 17:21
Re: How to use filesystem boost copy_file with qrc resources
Almost done. But I have problem with checking if defaultfilters are present inside data dirs. Right now I'm doing it like this:
But locDefaultFiltersPresent is always false, even if i have ${HOME}/.config/openmw/projects/defaultfilters.omwaddon.project file right there. Do I miss something?
Code: Select all
// Adding Resources directory. First check if there is a file defaultfilters in the data files
bool locDefaultFiltersPresent(false);
for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter)
{
boost::filesystem::path path(iter->string());
path /= "defaultfilters.omwaddon.project";
if (boost::filesystem::exists(path) )
{
mDocumentManager.setResourceDir(iter->string());
locDefaultFiltersPresent = true;
break;
}
}
if (!locDefaultFiltersPresent)
{
mDocumentManager.setResourceDir(variables["resources"].as<std::string>());
}
Re: How to use filesystem boost copy_file with qrc resources
That is the wrong location. You are checking the data directories. You should check the user directory instead.
Edit: Also, I suggest to rename the file to defaultfilters. The .omwaddon.project part doesn't make any sense. And you should also not use a projects sub-directory, because this is for individual projects, while the defaultfitlers are a global file.
Edit: Also, I suggest to rename the file to defaultfilters. The .omwaddon.project part doesn't make any sense. And you should also not use a projects sub-directory, because this is for individual projects, while the defaultfitlers are a global file.