Skip to content
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

Update filemanager.cpp #2246

Merged
merged 2 commits into from
May 29, 2020
Merged

Update filemanager.cpp #2246

merged 2 commits into from
May 29, 2020

Conversation

chrodger
Copy link
Contributor

CAUTION: Compiled, but not tested.

Related: #2245

@chrodger
Copy link
Contributor Author

Travis build failed. Cursory reading seems to indicate that using the new API requires specifying a Windows version?
https://stackoverflow.com/questions/28153059/shgetknownfolderpath-was-not-declared-in-this-scope
https://docs.microsoft.com/en-us/windows/win32/winprog/using-the-windows-headers?redirectedfrom=MSDN#macros_for_conditional_declarations
Might be easier to find another workaround...
Will investigate later if I get time.

&wPath[0]) == S_OK) {
wPath.resize(wcslen(wPath.data()));
path = NS_PROJ::WStringToUTF8(wPath);
wchar_t* wPath;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation issue

src/filemanager.cpp Show resolved Hide resolved
wchar_t* wPath;
if (SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &wPath) == S_OK){
std::wstring ws(wPath);
std::string str(ws.begin(), ws.end()); // CAUTION: wstring->string conversion will mangle or drop non-ascii characters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use instead the NS_PROJ::WStringToUTF8() method as done previously

@rouault rouault merged commit f0baddb into OSGeo:master May 29, 2020
@rouault rouault added this to the 7.1.0 milestone May 29, 2020
@chrodger chrodger deleted the patch-1 branch May 29, 2020 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants