C++11 / sorting cleanups.
[dcpomatic.git] / src / wx / content_menu.cc
index ed515f6c8041ee1fd678330a9c53a349791d6c6a..18ce64475b7c765d8e54aa3d7f79b84b19e94b65 100644 (file)
@@ -25,8 +25,8 @@
 #include "content_properties_dialog.h"
 #include "film_viewer.h"
 #include "repeat_dialog.h"
-#include "timeline_audio_content_view.h"
 #include "timeline_video_content_view.h"
+#include "timeline_audio_content_view.h"
 #include "wx_util.h"
 #include "lib/audio_content.h"
 #include "lib/config.h"
@@ -38,6 +38,7 @@
 #include "lib/exceptions.h"
 #include "lib/ffmpeg_content.h"
 #include "lib/film.h"
+#include "lib/find_missing.h"
 #include "lib/guess_crop.h"
 #include "lib/image_content.h"
 #include "lib/job_manager.h"
@@ -342,14 +343,14 @@ ContentMenu::find_missing ()
        boost::filesystem::path path;
 
        if ((ic && !ic->still ()) || dc) {
-               auto d = new wxDirDialog (0, _("Choose a folder"), wxT (""), wxDD_DIR_MUST_EXIST);
+               auto d = new wxDirDialog (nullptr, _("Choose a folder"), wxT (""), wxDD_DIR_MUST_EXIST);
                r = d->ShowModal ();
-               path = wx_to_std (d->GetPath ());
+               path = wx_to_std (d->GetPath());
                d->Destroy ();
        } else {
-               auto d = new wxFileDialog (0, _("Choose a file"), wxT (""), wxT (""), wxT ("*.*"));
+               auto d = new wxFileDialog (nullptr, _("Choose a file"), wxT (""), wxT (""), wxT ("*.*"));
                r = d->ShowModal ();
-               path = wx_to_std (d->GetPath ());
+               path = wx_to_std (d->GetPath());
                d->Destroy ();
        }
 
@@ -393,7 +394,7 @@ ContentMenu::re_examine ()
        }
 
        for (auto i: _content) {
-               JobManager::instance()->add (shared_ptr<Job> (new ExamineContentJob (film, i)));
+               JobManager::instance()->add(make_shared<ExamineContentJob>(film, i));
        }
 }
 
@@ -602,13 +603,13 @@ ContentMenu::auto_crop ()
 
        /* Handle the user closing the dialog (with OK or cancel) */
        _auto_crop_dialog->Bind (wxEVT_BUTTON, [this, viewer](wxCommandEvent& ev) {
+               _auto_crop_config_connection.disconnect ();
+               _auto_crop_viewer_connection.disconnect ();
                if (ev.GetId() == wxID_OK) {
                        _content.front()->video->set_crop(_auto_crop_dialog->get());
                }
                _auto_crop_dialog->Show (false);
                viewer->unset_crop_guess ();
-               _auto_crop_config_connection.disconnect ();
-               _auto_crop_viewer_connection.disconnect ();
        });
 
        /* Update the view when something in the dialog is changed */