-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
No fs::path return #8149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No fs::path return #8149
Conversation
| of::filesystem::path fileName { "" }; ///< selected file or directory name | ||
| std::string filePath = ""; ///< full path to selected file or directory | ||
| std::string fileName = ""; ///< selected file or directory name | ||
| bool bSuccess = false; ///< true if the dialog action was successful, aka file select not cancel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the above could all be of::filesystem::path internally and then std::string getName(); / std::string getPath(); just uses the filePath.string() in its return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes or ofPathToString(filePath)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @ofTheo just for your information, this was reverted back to string . just unsure if it was the idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - I think the issue was that because the members were public they had to be string for usage not to break on Windows.
My thought was we could do a new PR and maybe have these std::string variables as legacy support but have a protected of::filesystem::path internally be used by the class with the string values copies of the path data.
And then a method for accessing as a file path.
But it felt like it needed a bit of thought and we needing to revert to string because of the direct variable usage anyway.
| /// \return dialog result with selection (if any) | ||
| ofFileDialogResult ofSystemLoadDialog(std::string windowTitle="", bool bFolderSelection = false, of::filesystem::path defaultPath=""); | ||
| ofFileDialogResult ofSystemLoadDialog(std::string windowTitle="", bool bFolderSelection = false, std::string defaultPath=""); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As with the previous comment I think this argument could be left as is.
|
Thanks @roymacdonald - I added a couple of comments but apart from that looks good to go. |
|
@ofTheo should we merge? |
|
@roymacdonald - If you can address the two comments I left then I think its good to merge! |
|
@ofTheo as for the public members, I think it is better to leave as strings, since changing to ::path will break stuff (actually, the ofDropInfo class whose public members were changed to path break backwards compatibility, such as the example in ofxHapPlayer). So, I think we should leave those as strings. As of the function parameter, changing string to ::path requires some implementation reworking so it is an useful change and to make sure it works properly. But that would give the false impresion that the use of std::filesystem::path is done properly, and because of such I think it is better to keep the function parameter as std::string, and only change it when it is properly handled. |
|
Thanks @roymacdonald ! @dimitre - I am tempted to just merge this due to the public member issue Roy mentioned. Would that be fine with you and then we can PR in some improvements for |
|
Hey @ofTheo great. if this makes a smoother transition |
|
Thanks @dimitre - I think we can now go in and fix up some of this stuff with the goal of not breaking Windows and then figure out a 'path' ;-) forward for making path returns Win compatible. |
@ofTheo