comparison framework/MainWindowBase.cpp @ 228:67cea66bd588 debug-output

Remove most toStdString calls (no longer needed, with debug header)
author Chris Cannam
date Thu, 12 May 2011 17:31:56 +0100
parents 85e59c901de9
children 8c13e8219903
comparison
equal deleted inserted replaced
219:85e59c901de9 228:67cea66bd588
1071 } 1071 }
1072 1072
1073 MainWindowBase::FileOpenStatus 1073 MainWindowBase::FileOpenStatus
1074 MainWindowBase::openAudio(FileSource source, AudioFileOpenMode mode, QString templateName) 1074 MainWindowBase::openAudio(FileSource source, AudioFileOpenMode mode, QString templateName)
1075 { 1075 {
1076 // std::cerr << "MainWindowBase::openAudio(" << source.getLocation().toStdString() << ")" << std::endl; 1076 // std::cerr << "MainWindowBase::openAudio(" << source.getLocation() << ")" << std::endl;
1077 1077
1078 if (!source.isAvailable()) return FileOpenFailed; 1078 if (!source.isAvailable()) return FileOpenFailed;
1079 source.waitForData(); 1079 source.waitForData();
1080 1080
1081 m_openingAudioFile = true; 1081 m_openingAudioFile = true;
1156 } 1156 }
1157 1157
1158 bool loadedTemplate = false; 1158 bool loadedTemplate = false;
1159 if ((mode == ReplaceMainModel) && (templateName.length() != 0)) { 1159 if ((mode == ReplaceMainModel) && (templateName.length() != 0)) {
1160 QString tplPath = "file::templates/" + templateName + ".xml"; 1160 QString tplPath = "file::templates/" + templateName + ".xml";
1161 std::cerr << "SV looking for template " << tplPath.toStdString() << std::endl; 1161 std::cerr << "SV looking for template " << tplPath << std::endl;
1162 FileOpenStatus tplStatus = openSessionFile(tplPath); 1162 FileOpenStatus tplStatus = openSessionFile(tplPath);
1163 if(tplStatus != FileOpenFailed) { 1163 if(tplStatus != FileOpenFailed) {
1164 loadedTemplate = true; 1164 loadedTemplate = true;
1165 mode = ReplaceMainModel; 1165 mode = ReplaceMainModel;
1166 } 1166 }
1278 } 1278 }
1279 1279
1280 MainWindowBase::FileOpenStatus 1280 MainWindowBase::FileOpenStatus
1281 MainWindowBase::openPlaylist(FileSource source, AudioFileOpenMode mode) 1281 MainWindowBase::openPlaylist(FileSource source, AudioFileOpenMode mode)
1282 { 1282 {
1283 std::cerr << "MainWindowBase::openPlaylist(" << source.getLocation().toStdString() << ")" << std::endl; 1283 std::cerr << "MainWindowBase::openPlaylist(" << source.getLocation() << ")" << std::endl;
1284 1284
1285 std::set<QString> extensions; 1285 std::set<QString> extensions;
1286 PlaylistFileReader::getSupportedExtensions(extensions); 1286 PlaylistFileReader::getSupportedExtensions(extensions);
1287 QString extension = source.getExtension().toLower(); 1287 QString extension = source.getExtension().toLower();
1288 if (extensions.find(extension) == extensions.end()) return FileOpenFailed; 1288 if (extensions.find(extension) == extensions.end()) return FileOpenFailed;
1319 } 1319 }
1320 1320
1321 MainWindowBase::FileOpenStatus 1321 MainWindowBase::FileOpenStatus
1322 MainWindowBase::openLayer(FileSource source) 1322 MainWindowBase::openLayer(FileSource source)
1323 { 1323 {
1324 std::cerr << "MainWindowBase::openLayer(" << source.getLocation().toStdString() << ")" << std::endl; 1324 std::cerr << "MainWindowBase::openLayer(" << source.getLocation() << ")" << std::endl;
1325 1325
1326 Pane *pane = m_paneStack->getCurrentPane(); 1326 Pane *pane = m_paneStack->getCurrentPane();
1327 1327
1328 if (!pane) { 1328 if (!pane) {
1329 // shouldn't happen, as the menu action should have been disabled 1329 // shouldn't happen, as the menu action should have been disabled
1380 1380
1381 if (!reader.isOK()) { 1381 if (!reader.isOK()) {
1382 std::cerr << "ERROR: MainWindowBase::openLayer(" 1382 std::cerr << "ERROR: MainWindowBase::openLayer("
1383 << source.getLocation().toStdString() 1383 << source.getLocation().toStdString()
1384 << "): Failed to read XML file: " 1384 << "): Failed to read XML file: "
1385 << reader.getErrorString().toStdString() << std::endl; 1385 << reader.getErrorString() << std::endl;
1386 return FileOpenFailed; 1386 return FileOpenFailed;
1387 } 1387 }
1388 1388
1389 emit activity(tr("Import layer XML file \"%1\"").arg(source.getLocation())); 1389 emit activity(tr("Import layer XML file \"%1\"").arg(source.getLocation()));
1390 1390
1451 } 1451 }
1452 1452
1453 MainWindowBase::FileOpenStatus 1453 MainWindowBase::FileOpenStatus
1454 MainWindowBase::openImage(FileSource source) 1454 MainWindowBase::openImage(FileSource source)
1455 { 1455 {
1456 std::cerr << "MainWindowBase::openImage(" << source.getLocation().toStdString() << ")" << std::endl; 1456 std::cerr << "MainWindowBase::openImage(" << source.getLocation() << ")" << std::endl;
1457 1457
1458 Pane *pane = m_paneStack->getCurrentPane(); 1458 Pane *pane = m_paneStack->getCurrentPane();
1459 1459
1460 if (!pane) { 1460 if (!pane) {
1461 // shouldn't happen, as the menu action should have been disabled 1461 // shouldn't happen, as the menu action should have been disabled
1483 newLayer = true; 1483 newLayer = true;
1484 } 1484 }
1485 1485
1486 // We don't put the image file in Recent Files 1486 // We don't put the image file in Recent Files
1487 1487
1488 std::cerr << "openImage: trying location \"" << source.getLocation().toStdString() << "\" in image layer" << std::endl; 1488 std::cerr << "openImage: trying location \"" << source.getLocation() << "\" in image layer" << std::endl;
1489 1489
1490 if (!il->addImage(m_viewManager->getGlobalCentreFrame(), source.getLocation())) { 1490 if (!il->addImage(m_viewManager->getGlobalCentreFrame(), source.getLocation())) {
1491 if (newLayer) { 1491 if (newLayer) {
1492 m_document->deleteLayer(il); // also releases its model 1492 m_document->deleteLayer(il); // also releases its model
1493 } 1493 }
1511 } 1511 }
1512 1512
1513 MainWindowBase::FileOpenStatus 1513 MainWindowBase::FileOpenStatus
1514 MainWindowBase::openSession(FileSource source) 1514 MainWindowBase::openSession(FileSource source)
1515 { 1515 {
1516 std::cerr << "MainWindowBase::openSession(" << source.getLocation().toStdString() << ")" << std::endl; 1516 std::cerr << "MainWindowBase::openSession(" << source.getLocation() << ")" << std::endl;
1517 1517
1518 if (!source.isAvailable()) return FileOpenFailed; 1518 if (!source.isAvailable()) return FileOpenFailed;
1519 source.waitForData(); 1519 source.waitForData();
1520 1520
1521 if (source.getExtension().toLower() != "sv") { 1521 if (source.getExtension().toLower() != "sv") {
1631 } 1631 }
1632 1632
1633 MainWindowBase::FileOpenStatus 1633 MainWindowBase::FileOpenStatus
1634 MainWindowBase::openSessionFromRDF(FileSource source) 1634 MainWindowBase::openSessionFromRDF(FileSource source)
1635 { 1635 {
1636 std::cerr << "MainWindowBase::openSessionFromRDF(" << source.getLocation().toStdString() << ")" << std::endl; 1636 std::cerr << "MainWindowBase::openSessionFromRDF(" << source.getLocation() << ")" << std::endl;
1637 1637
1638 if (!source.isAvailable()) return FileOpenFailed; 1638 if (!source.isAvailable()) return FileOpenFailed;
1639 source.waitForData(); 1639 source.waitForData();
1640 1640
1641 if (!checkSaveModified()) { 1641 if (!checkSaveModified()) {
1899 BZipFileDevice bzFile(temp.getTemporaryFilename()); 1899 BZipFileDevice bzFile(temp.getTemporaryFilename());
1900 if (!bzFile.open(QIODevice::WriteOnly)) { 1900 if (!bzFile.open(QIODevice::WriteOnly)) {
1901 std::cerr << "Failed to open session file \"" 1901 std::cerr << "Failed to open session file \""
1902 << temp.getTemporaryFilename().toStdString() 1902 << temp.getTemporaryFilename().toStdString()
1903 << "\" for writing: " 1903 << "\" for writing: "
1904 << bzFile.errorString().toStdString() << std::endl; 1904 << bzFile.errorString() << std::endl;
1905 return false; 1905 return false;
1906 } 1906 }
1907 1907
1908 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); 1908 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
1909 1909