Browse Source

Replace wxScopedPtr with std::unique_ptr

Upstream has deprecated wxScopedPtr and recommends users switch to using
std::unique_ptr instead.
newinvert
Ian McInerney 3 years ago
parent
commit
f0684510f0
  1. 3
      common/project/project_archiver.cpp
  2. 4
      include/validators.h
  3. 4
      include/widgets/grid_text_button_helpers.h

3
common/project/project_archiver.cpp

@ -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;

4
include/validators.h

@ -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;
};

4
include/widgets/grid_text_button_helpers.h

@ -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;

Loading…
Cancel
Save