From 38efa07b6c472320709631eef7b0c65c04ae5d88 Mon Sep 17 00:00:00 2001 From: Flavio Date: Thu, 5 Jan 2012 11:46:16 +0100 Subject: [PATCH] Fixed potential crash --- src/downloadmanager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index f7267b3..6944e16 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -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(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) { -- 2.39.5