mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Pressing cancel is not an error.
This commit is contained in:
parent
a6a265b548
commit
4abb3b5e90
@ -77,12 +77,17 @@ static bool OpenFileImpl( const char* ext, const char* desc, std::function<void(
|
||||
# else
|
||||
nfdu8filteritem_t filter = { desc, ext };
|
||||
nfdu8char_t* fn;
|
||||
if( NFD_OpenDialogU8( &fn, &filter, 1, nullptr ) == NFD_OKAY )
|
||||
const auto res = NFD_OpenDialogU8( &fn, &filter, 1, nullptr );
|
||||
if( res == NFD_OKAY )
|
||||
{
|
||||
callback( (const char*)fn );
|
||||
NFD_FreePathU8( fn );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return res != NFD_ERROR;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
return false;
|
||||
@ -93,12 +98,17 @@ static bool SaveFileImpl( const char* ext, const char* desc, std::function<void(
|
||||
#if !defined TRACY_NO_FILESELECTOR && !defined __EMSCRIPTEN__
|
||||
nfdu8filteritem_t filter = { desc, ext };
|
||||
nfdu8char_t* fn;
|
||||
if( NFD_SaveDialogU8( &fn, &filter, 1, nullptr, nullptr ) == NFD_OKAY )
|
||||
const auto res = NFD_SaveDialogU8( &fn, &filter, 1, nullptr, nullptr );
|
||||
if( res == NFD_OKAY )
|
||||
{
|
||||
callback( (const char*)fn );
|
||||
NFD_FreePathU8( fn );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return res != NFD_ERROR;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user