Skip to content

Commit

Permalink
Fix handling of unicode in project name
Browse files Browse the repository at this point in the history
  • Loading branch information
kryksyh committed Oct 17, 2024
1 parent 1b6cc65 commit 8aa4e94
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class IOExtension final : public ProjectFileIOExtension
// Errors would be handled by the UI extension
return OnSaveAction::Cancelled;

if (!projectSaveCallback(audacity::ToUTF8(filePath), fileRenamed))
if (!projectSaveCallback(filePath, fileRenamed))
{
if (result.Operation)
result.Operation->Abort();
Expand Down Expand Up @@ -205,7 +205,7 @@ class IOExtension final : public ProjectFileIOExtension
const auto filePath = sync::MakeSafeProjectPath(dir, result.second);

return PerformCloudSave(
project, result.second, audacity::ToUTF8(filePath),
project, audacity::ToUTF8(result.second), audacity::ToUTF8(filePath),
projectSaveCallback, true, mAudiocomTrace);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ CloudProjectPropertiesDialog::~CloudProjectPropertiesDialog()
GetAuthorizationHandler().PopSuppressDialogs();
}

std::pair<CloudProjectPropertiesDialog::Action, std::string>
std::pair<CloudProjectPropertiesDialog::Action, wxString>
CloudProjectPropertiesDialog::Show(
const ServiceConfig& serviceConfig, OAuthService& authService,
UserService& userService, const wxString& projectName, wxWindow* parent,
Expand Down Expand Up @@ -201,11 +201,11 @@ void CloudProjectPropertiesDialog::SetupEvents()
mProjectName->Bind(wxEVT_TEXT_ENTER, [this](auto&) { OnSubmit(); });
}

std::string CloudProjectPropertiesDialog::GetProjectName() const
wxString CloudProjectPropertiesDialog::GetProjectName() const
{
wxString result { mProjectName->GetValue() };
result.Trim(true).Trim(false);
return audacity::ToUTF8(result);
return result;
}

void CloudProjectPropertiesDialog::OnUpdateCloudSaveState()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CloudProjectPropertiesDialog final : public wxDialogWrapper
SaveLocally
};

static std::pair<Action, std::string> Show(
static std::pair<Action, wxString> Show(
const ServiceConfig& serviceConfig, OAuthService& authService,
UserService& userService, const wxString& projectName, wxWindow* parent,
bool allowLocalSave, AudiocomTrace);
Expand All @@ -60,7 +60,7 @@ class CloudProjectPropertiesDialog final : public wxDialogWrapper
void LayoutControls();
void SetupEvents();

std::string GetProjectName() const;
wxString GetProjectName() const;
void OnUpdateCloudSaveState();

UserPanel* mUserPanel {};
Expand Down

0 comments on commit 8aa4e94

Please sign in to comment.