<d1b2>
<fredzo_72653> @azonenberg I get a compilation error with this latest commit : "/ngscopeclient/scopehal-apps/src/ngscopeclient/NFDFileBrowser.cpp:38:10: fatal error: nfd_glfw3.h: No such file or directory" Did I miss something ?
<d1b2>
<fredzo_72653> Never mind, it was me not me not updating the submodule... 🤦♂️
<d1b2>
<fredzo_72653> @azonenberg your latest commit breaks compilation on WIN32: .../NFDFileBrowser.cpp: In member function 'std::optional<std::__cxx11::basic_string<char> > NFDFileBrowser::ThreadProc()': .../NFDFileBrowser.cpp:136:35: error: cannot convert 'nfdfilteritem_t' {aka 'nfdu8filteritem_t'} to 'const nfdnfilteritem_t' in assignment 136 | args.filterList = &filterItem; | ^~~~~~~~~~~ |
<d1b2>
<fredzo_72653> AFAIU the cross-platform compatible way to do this is to use the U8 alternative of NFDe. See (https://github.com/btzy/nativefiledialog-extended): "The U8/u8 in NFDe refer to the API for UTF-8 characters (char), which most consumers probably want. An N/n version is also available, which uses the native character type (wchar_t on Windows and char on other platforms)."
<d1b2>
<fredzo_72653> I fixed it that way : optional<string> NFDFileBrowser::ThreadProc() { if(NFD_Init() != NFD_OKAY) { LogError("NFD_Init() failed\n"); return {}; } nfdchar_t* outPath; nfdu8filteritem_t filterItem = { m_filterName.c_str(), m_filterMask.c_str() }; nfdresult_t result; if(m_saveDialog) { //Fill out arguments nfdsavedialogu8args_t args; args.filterList = &filterItem;