Commit e93410f1 authored by Claudio Valerio's avatar Claudio Valerio

resolved issue

parent f7cd5b2b
...@@ -366,10 +366,10 @@ void UBTeacherBarWidget::loadContent() ...@@ -366,10 +366,10 @@ void UBTeacherBarWidget::loadContent()
mpPreview->setDuration(eDuration_ThreeQuarter); mpPreview->setDuration(eDuration_ThreeQuarter);
} }
mpPreview->setComments(mpComments->document()->toPlainText()); mpPreview->setComments(mpComments->document()->toPlainText());
mpPreview->mediaViewer()->cleanMedia();
mpPreview->mediaViewer()->loadMedia(nextInfos.medias);
} }
// this is always done becasue it allows to clean the media on
// changing the page
mpPreview->mediaViewer()->loadMedia(nextInfos.medias);
} }
bool UBTeacherBarWidget::isEmpty() bool UBTeacherBarWidget::isEmpty()
...@@ -848,10 +848,18 @@ UBTeacherBarPreviewMedia::~UBTeacherBarPreviewMedia() ...@@ -848,10 +848,18 @@ UBTeacherBarPreviewMedia::~UBTeacherBarPreviewMedia()
} }
void UBTeacherBarPreviewMedia::cleanMedia()
{
foreach(QWidget* eachWidget, mWidgetList.keys()){
delete eachWidget;
eachWidget = NULL;
}
mWidgetList.clear();
}
void UBTeacherBarPreviewMedia::loadMedia(QStringList pMedias) void UBTeacherBarPreviewMedia::loadMedia(QStringList pMedias)
{ {
mWidgetList.clear();
foreach(QString eachString, pMedias){ foreach(QString eachString, pMedias){
if(!eachString.isEmpty()){ if(!eachString.isEmpty()){
QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(eachString); QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(eachString);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment