diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-02-09 02:06:04 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-02-09 17:29:16 +0100 |
| commit | d0308d53dd9f4d036d8c5fe8023920fcdfd43f39 (patch) | |
| tree | 5b37c1db5dc50e541a542663390061f743fe815a /src/tools/dcpomatic_batch.cc | |
| parent | 8d0d9866ae3e0395d899705e27b3806a5de7ef0e (diff) | |
Remove unnecessary wx_ptr
It was only ever used for wxDialog subclasses, which can be
stack-allocated.
Diffstat (limited to 'src/tools/dcpomatic_batch.cc')
| -rw-r--r-- | src/tools/dcpomatic_batch.cc | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc index 379a3c074..ed60aae37 100644 --- a/src/tools/dcpomatic_batch.cc +++ b/src/tools/dcpomatic_batch.cc @@ -25,7 +25,6 @@ #include "wx/id.h" #include "wx/job_manager_view.h" #include "wx/servers_list_dialog.h" -#include "wx/wx_ptr.h" #include "wx/wx_signal_manager.h" #include "wx/wx_util.h" #include "wx/wx_variant.h" @@ -274,14 +273,14 @@ private: return true; } - auto d = make_wx<wxMessageDialog>( + wxMessageDialog dialog( nullptr, _("There are unfinished jobs; are you sure you want to quit?"), _("Unfinished jobs"), wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION ); - return d->ShowModal() == wxID_YES; + return dialog.ShowModal() == wxID_YES; } void close (wxCloseEvent& ev) @@ -326,21 +325,21 @@ private: void help_about () { - auto d = make_wx<AboutDialog>(this); - d->ShowModal (); + AboutDialog dialog(this); + dialog.ShowModal(); } void add_film () { - auto dialog = make_wx<wxDirDialog>(this, _("Select film to open"), wxStandardPaths::Get().GetDocumentsDir(), wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST); + wxDirDialog dialog(this, _("Select film to open"), wxStandardPaths::Get().GetDocumentsDir(), wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST); if (_last_parent) { - dialog->SetPath(std_to_wx(_last_parent.get().string())); + dialog.SetPath(std_to_wx(_last_parent.get().string())); } int r; while (true) { - r = dialog->ShowModal(); - if (r == wxID_OK && dialog->GetPath() == wxStandardPaths::Get().GetDocumentsDir()) { + r = dialog.ShowModal(); + if (r == wxID_OK && dialog.GetPath() == wxStandardPaths::Get().GetDocumentsDir()) { error_dialog (this, _("You did not select a folder. Make sure that you select a folder before clicking Open.")); } else { break; @@ -348,10 +347,10 @@ private: } if (r == wxID_OK) { - start_job(wx_to_std(dialog->GetPath())); + start_job(wx_to_std(dialog.GetPath())); } - _last_parent = boost::filesystem::path(wx_to_std(dialog->GetPath())).parent_path(); + _last_parent = boost::filesystem::path(wx_to_std(dialog.GetPath())).parent_path(); } void config_changed (Config::Property what) |
