Skip to content
This repository has been archived by the owner on Mar 9, 2019. It is now read-only.

Commit

Permalink
treat empty poster
Browse files Browse the repository at this point in the history
  • Loading branch information
ochurlaud committed Apr 22, 2015
1 parent eae632c commit cec2f91
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1122,11 +1122,15 @@ void MainWindow::fillMetadataPannel(Movie movie)

m_ui->metadataTop->setText(l_title+l_originalTitle + l_directors +l_producers + l_actors);
m_ui->metadataPlot->setText(movie.synopsis());
QString l_posterPath = qApp->property("postersPath").toString()
+ movie.posterPath();
QPixmap l_poster(l_posterPath);
QSize l_size(m_ui->metadataPannel->width()-30, m_ui->metadataPannel->height()-30);
l_poster = l_poster.scaled(l_size, Qt::KeepAspectRatio);
QPixmap l_poster;
if (movie.posterPath() != "")
{
QString l_posterPath = qApp->property("postersPath").toString()
+ movie.posterPath();
l_poster.load(l_posterPath);
QSize l_size(m_ui->metadataPannel->width()-30, m_ui->metadataPannel->height()-30);
l_poster = l_poster.scaled(l_size, Qt::KeepAspectRatio);
}
m_ui->metadataCover->setPixmap(l_poster);

Macaw::DEBUG_OUT("[MainWindow] Exit fillMetadataPannel");
Expand Down

0 comments on commit cec2f91

Please sign in to comment.