diff --git a/kicad/pcm/dialogs/dialog_manage_repositories.cpp b/kicad/pcm/dialogs/dialog_manage_repositories.cpp index 8e57907440..f2100ee8ef 100644 --- a/kicad/pcm/dialogs/dialog_manage_repositories.cpp +++ b/kicad/pcm/dialogs/dialog_manage_repositories.cpp @@ -73,13 +73,14 @@ void DIALOG_MANAGE_REPOSITORIES::setColumnWidths() void DIALOG_MANAGE_REPOSITORIES::OnAddButtonClicked( wxCommandEvent& event ) { - wxTextEntryDialog* entry_dialog = new wxTextEntryDialog( - this, _( "Please enter fully qualified repository url" ), _( "Add repository" ) ); + wxTextEntryDialog entry_dialog( this, + _( "Please enter fully qualified repository url" ), + _( "Add repository" ) ); - if( entry_dialog->ShowModal() == wxID_OK ) + if( entry_dialog.ShowModal() == wxID_OK ) { PCM_REPOSITORY repository; - wxString url = entry_dialog->GetValue(); + wxString url = entry_dialog.GetValue(); const auto find_row = [&]( const int col, const wxString& val ) { @@ -100,10 +101,9 @@ void DIALOG_MANAGE_REPOSITORIES::OnAddButtonClicked( wxCommandEvent& event ) } else { - std::unique_ptr reporter( - new WX_PROGRESS_REPORTER( this, wxT( "" ), 1 ) ); + WX_PROGRESS_REPORTER reporter( GetParent(), wxT( "" ), 1 ); - if( m_pcm->FetchRepository( url, repository, reporter.get() ) ) + if( m_pcm->FetchRepository( url, repository, &reporter ) ) { wxString name = repository.name; int increment = 1; @@ -126,8 +126,6 @@ void DIALOG_MANAGE_REPOSITORIES::OnAddButtonClicked( wxCommandEvent& event ) } } } - - entry_dialog->Destroy(); } diff --git a/kicad/pcm/pcm_task_manager.cpp b/kicad/pcm/pcm_task_manager.cpp index 0bad4a0ffc..f22604a0d6 100644 --- a/kicad/pcm/pcm_task_manager.cpp +++ b/kicad/pcm/pcm_task_manager.cpp @@ -195,7 +195,7 @@ bool PCM_TASK_MANAGER::extract( const wxString& aFilePath, const wxString& aPack for( ; entry; entry = zip.GetNextEntry() ) { wxArrayString path_parts = - wxSplit( entry->GetName(), wxFileName::GetPathSeparator(), (wxChar) NULL ); + wxSplit( entry->GetName(), wxFileName::GetPathSeparator(), (wxChar) 0 ); if( path_parts.size() < 2 || PCM_PACKAGE_DIRECTORIES.find( path_parts[0] ) == PCM_PACKAGE_DIRECTORIES.end() @@ -215,7 +215,7 @@ bool PCM_TASK_MANAGER::extract( const wxString& aFilePath, const wxString& aPack path_parts.Insert( clean_package_id, 1 ); path_parts.Insert( m_pcm->Get3rdPartyPath(), 0 ); - wxString fullname = wxJoin( path_parts, wxFileName::GetPathSeparator(), (wxChar) NULL ); + wxString fullname = wxJoin( path_parts, wxFileName::GetPathSeparator(), (wxChar) 0 ); // Ensure the target directory exists and create it if not. wxString t_path = wxPathOnly( fullname );