diff framework/MainWindowBase.cpp @ 293:068235cf5bf7

Drop std:: from cout, cerr, endl -- pull these in through Debug.h
author Chris Cannam
date Tue, 26 Nov 2013 14:12:50 +0000
parents 3fc0df289533
children 933b5aed341a
line wrap: on
line diff
--- a/framework/MainWindowBase.cpp	Wed Oct 09 14:56:20 2013 +0100
+++ b/framework/MainWindowBase.cpp	Tue Nov 26 14:12:50 2013 +0000
@@ -101,8 +101,8 @@
 #include <cstdio>
 #include <errno.h>
 
-using std::cerr;
-using std::endl;
+
+
 
 using std::vector;
 using std::map;
@@ -120,10 +120,10 @@
     char errstr[256];
     XGetErrorText(dpy, err->error_code, errstr, 256);
     if (err->error_code != BadWindow) {
-	std::cerr << "Sonic Visualiser: X Error: "
+	cerr << "Sonic Visualiser: X Error: "
 		  << errstr << " " << int(err->error_code)
 		  << "\nin major opcode:  "
-		  << int(err->request_code) << std::endl;
+		  << int(err->request_code) << endl;
     }
     return 0;
 }
@@ -290,7 +290,7 @@
         QTimer *oscTimer = new QTimer(this);
         connect(oscTimer, SIGNAL(timeout()), this, SLOT(pollOSC()));
         oscTimer->start(1000);
-        std::cerr << "Finished setting up OSC interface" << std::endl;
+        cerr << "Finished setting up OSC interface" << endl;
     }
 }
 
@@ -578,7 +578,7 @@
 
     int frame = m_playSource->getCurrentBufferedFrame();
 
-//    std::cerr << "currentPaneChanged: current frame (in ref model) = " << frame << std::endl;
+//    cerr << "currentPaneChanged: current frame (in ref model) = " << frame << endl;
 
     View::ModelSet soloModels = p->getModels();
     
@@ -1073,7 +1073,7 @@
         RDFImporter::RDFDocumentType rdfType = 
             RDFImporter::identifyDocumentType
             (QUrl::fromLocalFile(source.getLocalFilename()).toString());
-//        std::cerr << "RDF type: " << (int)rdfType << std::endl;
+//        cerr << "RDF type: " << (int)rdfType << endl;
         if (rdfType == RDFImporter::AudioRefAndAnnotations ||
             rdfType == RDFImporter::AudioRef) {
             rdfSession = true;
@@ -1132,7 +1132,7 @@
         templateName = getDefaultSessionTemplate();
     }
 
-    std::cerr << "template is: \"" << templateName.toStdString() << "\"" << std::endl;
+    cerr << "template is: \"" << templateName.toStdString() << "\"" << endl;
 
     if (!source.isAvailable()) return FileOpenFailed;
     source.waitForData();
@@ -1153,7 +1153,7 @@
 	return FileOpenFailed;
     }
 
-//    std::cerr << "mode = " << mode << std::endl;
+//    cerr << "mode = " << mode << endl;
 
     if (mode == AskUser) {
         if (getMainModel()) {
@@ -1230,15 +1230,15 @@
 
         if (!checkSaveModified()) return FileOpenCancelled;
 
-        std::cerr << "SV looking for template " << templateName << std::endl;
+        cerr << "SV looking for template " << templateName << endl;
         if (templateName != "") {
             FileOpenStatus tplStatus = openSessionTemplate(templateName);
             if (tplStatus == FileOpenCancelled) {
-                std::cerr << "Template load cancelled" << std::endl;
+                cerr << "Template load cancelled" << endl;
                 return FileOpenCancelled;
             }
             if (tplStatus != FileOpenFailed) {
-                std::cerr << "Template load succeeded" << std::endl;
+                cerr << "Template load succeeded" << endl;
                 loadedTemplate = true;
             }
         }
@@ -1414,13 +1414,13 @@
     
     if (!pane) {
 	// shouldn't happen, as the menu action should have been disabled
-	std::cerr << "WARNING: MainWindowBase::openLayer: no current pane" << std::endl;
+	cerr << "WARNING: MainWindowBase::openLayer: no current pane" << endl;
 	return FileOpenWrongMode;
     }
 
     if (!getMainModel()) {
 	// shouldn't happen, as the menu action should have been disabled
-	std::cerr << "WARNING: MainWindowBase::openLayer: No main model -- hence no default sample rate available" << std::endl;
+	cerr << "WARNING: MainWindowBase::openLayer: No main model -- hence no default sample rate available" << endl;
 	return FileOpenWrongMode;
     }
 
@@ -1432,7 +1432,7 @@
     RDFImporter::RDFDocumentType rdfType = 
         RDFImporter::identifyDocumentType(QUrl::fromLocalFile(path).toString());
 
-//    std::cerr << "RDF type:  (in layer) " << (int) rdfType << std::endl;
+//    cerr << "RDF type:  (in layer) " << (int) rdfType << endl;
 
     if (rdfType != RDFImporter::NotRDF) {
 
@@ -1447,9 +1447,9 @@
         QFile file(path);
         
         if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
-            std::cerr << "ERROR: MainWindowBase::openLayer("
+            cerr << "ERROR: MainWindowBase::openLayer("
                       << source.getLocation().toStdString()
-                      << "): Failed to open file for reading" << std::endl;
+                      << "): Failed to open file for reading" << endl;
             return FileOpenFailed;
         }
         
@@ -1466,10 +1466,10 @@
         reader.parse(inputSource);
         
         if (!reader.isOK()) {
-            std::cerr << "ERROR: MainWindowBase::openLayer("
+            cerr << "ERROR: MainWindowBase::openLayer("
                       << source.getLocation().toStdString()
                       << "): Failed to read XML file: "
-                      << reader.getErrorString() << std::endl;
+                      << reader.getErrorString() << endl;
             return FileOpenFailed;
         }
 
@@ -1546,7 +1546,7 @@
     
     if (!pane) {
 	// shouldn't happen, as the menu action should have been disabled
-	std::cerr << "WARNING: MainWindowBase::openImage: no current pane" << std::endl;
+	cerr << "WARNING: MainWindowBase::openImage: no current pane" << endl;
 	return FileOpenWrongMode;
     }
 
@@ -1572,7 +1572,7 @@
 
     // We don't put the image file in Recent Files
 
-    std::cerr << "openImage: trying location \"" << source.getLocation() << "\" in image layer" << std::endl;
+    cerr << "openImage: trying location \"" << source.getLocation() << "\" in image layer" << endl;
 
     if (!il->addImage(m_viewManager->getGlobalCentreFrame(), source.getLocation())) {
         if (newLayer) {
@@ -1611,7 +1611,7 @@
             RDFImporter::identifyDocumentType
             (QUrl::fromLocalFile(source.getLocalFilename()).toString());
 
-//        std::cerr << "RDF type: " << (int)rdfType << std::endl;
+//        cerr << "RDF type: " << (int)rdfType << endl;
 
         if (rdfType == RDFImporter::AudioRefAndAnnotations ||
             rdfType == RDFImporter::AudioRef) {
@@ -1623,7 +1623,7 @@
         if (source.getExtension().toLower() == "xml") {
             if (SVFileReader::identifyXmlFile(source.getLocalFilename()) ==
                 SVFileReader::SVSessionFile) {
-                std::cerr << "This XML file looks like a session file, attempting to open it as a session" << std::endl;
+                cerr << "This XML file looks like a session file, attempting to open it as a session" << endl;
             } else {
                 return FileOpenFailed;
             }
@@ -1726,7 +1726,7 @@
     ResourceFinder rf;
     QString tfile = rf.getResourcePath("templates", templateName + ".svt");
     if (tfile != "") {
-        std::cerr << "SV loading template file " << tfile.toStdString() << std::endl;
+        cerr << "SV loading template file " << tfile.toStdString() << endl;
         return openSessionTemplate(FileSource("file:" + tfile));
     } else {
         return FileOpenFailed;
@@ -1736,7 +1736,7 @@
 MainWindowBase::FileOpenStatus
 MainWindowBase::openSessionTemplate(FileSource source)
 {
-    std::cerr << "MainWindowBase::openSessionTemplate(" << source.getLocation().toStdString() << ")" << std::endl;
+    cerr << "MainWindowBase::openSessionTemplate(" << source.getLocation().toStdString() << ")" << endl;
 
     if (!source.isAvailable()) return FileOpenFailed;
     source.waitForData();
@@ -2065,10 +2065,10 @@
 
         BZipFileDevice bzFile(temp.getTemporaryFilename());
         if (!bzFile.open(QIODevice::WriteOnly)) {
-            std::cerr << "Failed to open session file \""
+            cerr << "Failed to open session file \""
                       << temp.getTemporaryFilename().toStdString()
                       << "\" for writing: "
-                      << bzFile.errorString() << std::endl;
+                      << bzFile.errorString() << endl;
             return false;
         }
 
@@ -2110,10 +2110,10 @@
 
         QFile file(temp.getTemporaryFilename());
         if (!file.open(QIODevice::WriteOnly)) {
-            std::cerr << "Failed to open session template file \""
+            cerr << "Failed to open session template file \""
                       << temp.getTemporaryFilename().toStdString()
                       << "\" for writing: "
-                      << file.errorString().toStdString() << std::endl;
+                      << file.errorString().toStdString() << endl;
             return false;
         }
         
@@ -3026,7 +3026,7 @@
     removeLayerEditDialog(layer);
 
     if (m_timeRulerLayer && (layer == m_timeRulerLayer)) {
-//	std::cerr << "(this is the time ruler layer)" << std::endl;
+//	cerr << "(this is the time ruler layer)" << endl;
 	m_timeRulerLayer = 0;
     }
 }