File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -1014,12 +1014,11 @@ int main()
10141014 {
10151015 if (!openFileDialog->getSelectedPaths ().empty ())
10161016 {
1017- auto path = openFileDialog->getSelectedPaths ()[0 ].asString ().toStdString ();
1018- std::string filename = path.substr (path. find_last_of ( " / " ) + 1 , path. size () );
1017+ auto path = std::filesystem::path ( openFileDialog->getSelectedPaths ()[0 ].asString ().toStdString () );
1018+ std::string filename = path.filename (). string ( );
10191019 if (!std::filesystem::exists (projectDir + " /assets/sounds/" + filename))
10201020 std::filesystem::copy (path, projectDir + " /assets/sounds/" + filename);
1021- path = projectDir + " /assets/sounds/" + filename;
1022- sman->LoadSound (path);
1021+ sman->LoadSound (projectDir + " /assets/sounds/" + filename, path.stem ().string ());
10231022 treeTabs->select (2 );
10241023 readSceneTree ();
10251024 lastPath = openFileDialog->getSelectedPaths ()[0 ].getParentPath ().asString ().toStdString ();
You can’t perform that action at this time.
0 commit comments