I’m trying to set my FileChooser object to open in the same directory that it used the last time I opened a file,
using getCurrentWorkingDirectory() thus:
[code]FileChooser theFileChooser (“Please select file you want to open…”,
File::getCurrentWorkingDirectory());
It probably should work, but it’s a dreadful way to do it! Just store the last file in a File object somewhere, there’s no need to use the CWD as a place to store it!
That’s a fine suggestion. I was trying to solve the problem in such a way that the FileChooser would open in a useful location across runs of my application, and have the system hold onto that information, rather than me.
How did you expect that to work?? The CWD is held by the shell, it’s not a global setting! (And if it was a global, that’d make your idea even more insane!!)
I was thinking that the OS was holding on to the last location used in an Open dialog,
but now I see it varies by application, and applications are holding on to that location
on their own. I’ll do the same.