diff data/fileio/OggVorbisFileReader.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/OggVorbisFileReader.cpp	Thu Nov 01 16:02:01 2007 +0000
+++ b/data/fileio/OggVorbisFileReader.cpp	Fri Nov 02 16:50:31 2007 +0000
@@ -70,10 +70,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();
+        }
 
         while (oggz_read(m_oggz, 1024) > 0);