diff options
author | Bartosz Taudul <wolf@nereid.pl> | 2022-10-06 18:35:07 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf@nereid.pl> | 2022-10-06 19:12:50 +0300 |
commit | ec0757c03adc8efe2db55853642e7c119b483334 (patch) | |
tree | db8b2ba0e58e0af72370a364bdcb589ccf06efe2 /profiler | |
parent | a4e39f3d5f3acb33cccee09045b44012ebcca59c (diff) |
Change file selector to work with callbacks.
Diffstat (limited to 'profiler')
-rw-r--r-- | profiler/src/main.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index d21ae81d..27f15b78 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -575,12 +575,10 @@ static void DrawContents() #ifndef TRACY_NO_FILESELECTOR if( ImGui::Button( ICON_FA_FOLDER_OPEN " Open saved trace" ) && !loadThread.joinable() ) { - auto fn = tracy::Fileselector::OpenFile( "tracy", "Tracy Profiler trace file" ); - if( !fn.empty() ) - { + tracy::Fileselector::OpenFile( "tracy", "Tracy Profiler trace file", []( const char* fn ) { try { - auto f = std::shared_ptr<tracy::FileRead>( tracy::FileRead::Open( fn.c_str() ) ); + auto f = std::shared_ptr<tracy::FileRead>( tracy::FileRead::Open( fn ) ); if( f ) { loadThread = std::thread( [f] { @@ -609,7 +607,7 @@ static void DrawContents() { badVer.state = tracy::BadVersionState::ReadError; } - } + } ); } if( badVer.state != tracy::BadVersionState::Ok ) |