Mercurial > hg > svcore
diff data/fileio/MP3FileReader.cpp @ 327:1d656dcda8ef
* some tweaks to improve usability of these classes in a console application
author | Chris Cannam |
---|---|
date | Fri, 02 Nov 2007 16:50:31 +0000 |
parents | c324d410b096 |
children | 1afaf98dbf11 |
line wrap: on
line diff
--- a/data/fileio/MP3FileReader.cpp Thu Nov 01 16:02:01 2007 +0000 +++ b/data/fileio/MP3FileReader.cpp Fri Nov 02 16:50:31 2007 +0000 @@ -106,10 +106,12 @@ if (decodeMode == DecodeAtOnce) { - m_progress = new QProgressDialog - (QObject::tr("Decoding %1...").arg(QFileInfo(m_path).fileName()), - QObject::tr("Stop"), 0, 100); - m_progress->hide(); + if (dynamic_cast<QApplication *>(QCoreApplication::instance())) { + m_progress = new QProgressDialog + (QObject::tr("Decoding %1...").arg(QFileInfo(m_path).fileName()), + QObject::tr("Stop"), 0, 100); + m_progress->hide(); + } if (!decode(m_filebuffer, m_fileSize)) { m_error = QString("Failed to decode file %1.").arg(m_path);