]> git.sur5r.net Git - minitube/commitdiff
Fixed potential crash 1.7
authorFlavio <flavio@odisseo.local>
Thu, 5 Jan 2012 10:46:16 +0000 (11:46 +0100)
committerFlavio <flavio@odisseo.local>
Thu, 5 Jan 2012 10:46:16 +0000 (11:46 +0100)
src/downloadmanager.cpp

index f7267b393c2383f634b78c2a5ec50e7f76a60635..6944e1639f77c87d4c9374fb66970c795160ac41 100644 (file)
@@ -3,6 +3,7 @@
 #include "downloadmodel.h"
 #include "video.h"
 #include "constants.h"
+#include "MainWindow.h"
 
 static DownloadManager *downloadManagerInstance = 0;
 
@@ -39,10 +40,10 @@ DownloadItem* DownloadManager::itemForVideo(Video* video) {
 
 void DownloadManager::addItem(Video *video) {
     // qDebug() << __FUNCTION__ << video->title();
-    
+
 #ifdef APP_DEMO
     if (video->duration() >= 60*4) {
-        QMessageBox msgBox(dynamic_cast<QWidget*>(parent())->window());
+        QMessageBox msgBox(MainWindow::instance());
         msgBox.setIconPixmap(QPixmap(":/images/app.png").scaled(64, 64, Qt::KeepAspectRatio, Qt::SmoothTransformation));
         msgBox.setText(tr("This is just the demo version of %1.").arg(Constants::NAME));
         msgBox.setInformativeText(
@@ -64,7 +65,6 @@ void DownloadManager::addItem(Video *video) {
         return;
     }
 #endif
-    
 
     DownloadItem *item = itemForVideo(video);
     if (item != 0) {