Replace wxScopedPtr with std::unique_ptr

Upstream has deprecated wxScopedPtr and recommends users switch to using
std::unique_ptr instead.
This commit is contained in:
Ian McInerney 2023-04-12 17:14:45 +01:00
parent c3ae2d4f43
commit f0684510f0
3 changed files with 8 additions and 3 deletions

View File

@ -17,6 +17,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <memory>
#include <wx/dir.h>
#include <wx/filedlg.h>
#include <wx/fs_zip.h>
@ -62,7 +63,7 @@ bool PROJECT_ARCHIVER::Unarchive( const wxString& aSrcFile, const wxString& aDes
return false;
}
wxScopedPtr<wxArchiveInputStream> archiveStream( archiveClassFactory->NewStream( stream ) );
std::unique_ptr<wxArchiveInputStream> archiveStream( archiveClassFactory->NewStream( stream ) );
wxString fileStatus;

View File

@ -31,6 +31,8 @@
#ifndef VALIDATORS_H
#define VALIDATORS_H
#include <memory>
#include <wx/valtext.h>
#include <wx/grid.h>
#include <wx/regex.h>
@ -50,7 +52,7 @@ public:
virtual void StartingKey( wxKeyEvent& event ) override;
protected:
wxScopedPtr<wxValidator> m_validator;
std::unique_ptr<wxValidator> m_validator;
};

View File

@ -25,6 +25,8 @@
#ifndef GRID_TEXT_BUTTON_HELPERS_H
#define GRID_TEXT_BUTTON_HELPERS_H
#include <memory>
#include <wx/combo.h>
#include <wx/generic/gridctrl.h>
#include <wx/generic/grideditors.h>
@ -58,7 +60,7 @@ protected:
wxComboCtrl* Combo() const { return static_cast<wxComboCtrl*>( m_control ); }
#if wxUSE_VALIDATORS
wxScopedPtr< wxValidator > m_validator;
std::unique_ptr< wxValidator > m_validator;
#endif
wxString m_value;