Fix some coverity-reported stuff.
[dcpomatic.git] / src / wx / timeline.cc
index e04d9ee744e94f83f4cf5354cfc6e150f65d5910..4e306c4998a526081e4629f79c03ba5d4fcaa63d 100644 (file)
@@ -162,7 +162,7 @@ private:
                gc->StrokePath (path);
                gc->FillPath (path);
 
-               wxString name = wxString::Format (wxT ("%s [%s]"), std_to_wx (cont->path().filename().string()).data(), type().data());
+               wxString name = wxString::Format (wxT ("%s [%s]"), std_to_wx (cont->path_summary()).data(), type().data());
                wxDouble name_width;
                wxDouble name_height;
                wxDouble name_descent;
@@ -336,7 +336,7 @@ Timeline::Timeline (wxWindow* parent, FilmEditor* ed, shared_ptr<Film> film)
        , _left_down (false)
        , _down_view_position (0)
        , _first_move (false)
-       , _menu (film, this)
+       , _menu (this)
        , _snap (true)
 {
 #ifndef __WXOSX__
@@ -474,7 +474,7 @@ void
 Timeline::setup_pixels_per_time_unit ()
 {
        shared_ptr<const Film> film = _film.lock ();
-       if (!film) {
+       if (!film || film->length() == 0) {
                return;
        }
 
@@ -574,7 +574,7 @@ Timeline::right_down (wxMouseEvent& ev)
                cv->set_selected (true);
        }
 
-       _menu.popup (selected_content (), ev.GetPosition ());
+       _menu.popup (_film, selected_content (), ev.GetPosition ());
 }
 
 void