Mercurial > hg > svapp
comparison framework/SVFileReader.cpp @ 294:933b5aed341a
Drop toStdString() and toLocal8Bit().data(), with debug header we can stream QStrings
author | Chris Cannam |
---|---|
date | Tue, 26 Nov 2013 14:14:25 +0000 |
parents | 068235cf5bf7 |
children | 289d65722123 |
comparison
equal
deleted
inserted
replaced
293:068235cf5bf7 | 294:933b5aed341a |
---|---|
234 | 234 |
235 ok = readParameter(attributes); | 235 ok = readParameter(attributes); |
236 | 236 |
237 } else { | 237 } else { |
238 cerr << "WARNING: SV-XML: Unexpected element \"" | 238 cerr << "WARNING: SV-XML: Unexpected element \"" |
239 << name.toLocal8Bit().data() << "\"" << endl; | 239 << name << "\"" << endl; |
240 } | 240 } |
241 | 241 |
242 if (!ok) { | 242 if (!ok) { |
243 cerr << "WARNING: SV-XML: Failed to completely process element \"" | 243 cerr << "WARNING: SV-XML: Failed to completely process element \"" |
244 << name.toLocal8Bit().data() << "\"" << endl; | 244 << name << "\"" << endl; |
245 } | 245 } |
246 | 246 |
247 return true; | 247 return true; |
248 } | 248 } |
249 | 249 |
360 m_errorString = | 360 m_errorString = |
361 QString("ERROR: SV-XML: %1 at line %2, column %3") | 361 QString("ERROR: SV-XML: %1 at line %2, column %3") |
362 .arg(exception.message()) | 362 .arg(exception.message()) |
363 .arg(exception.lineNumber()) | 363 .arg(exception.lineNumber()) |
364 .arg(exception.columnNumber()); | 364 .arg(exception.columnNumber()); |
365 cerr << m_errorString.toLocal8Bit().data() << endl; | 365 cerr << m_errorString << endl; |
366 return QXmlDefaultHandler::error(exception); | 366 return QXmlDefaultHandler::error(exception); |
367 } | 367 } |
368 | 368 |
369 bool | 369 bool |
370 SVFileReader::fatalError(const QXmlParseException &exception) | 370 SVFileReader::fatalError(const QXmlParseException &exception) |
372 m_errorString = | 372 m_errorString = |
373 QString("FATAL ERROR: SV-XML: %1 at line %2, column %3") | 373 QString("FATAL ERROR: SV-XML: %1 at line %2, column %3") |
374 .arg(exception.message()) | 374 .arg(exception.message()) |
375 .arg(exception.lineNumber()) | 375 .arg(exception.lineNumber()) |
376 .arg(exception.columnNumber()); | 376 .arg(exception.columnNumber()); |
377 cerr << m_errorString.toLocal8Bit().data() << endl; | 377 cerr << m_errorString << endl; |
378 return QXmlDefaultHandler::fatalError(exception); | 378 return QXmlDefaultHandler::fatalError(exception); |
379 } | 379 } |
380 | 380 |
381 | 381 |
382 #define READ_MANDATORY(TYPE, NAME, CONVERSION) \ | 382 #define READ_MANDATORY(TYPE, NAME, CONVERSION) \ |
704 } | 704 } |
705 | 705 |
706 } else { | 706 } else { |
707 | 707 |
708 cerr << "WARNING: SV-XML: Unexpected model type \"" | 708 cerr << "WARNING: SV-XML: Unexpected model type \"" |
709 << type.toLocal8Bit().data() << "\" for model id " << id << endl; | 709 << type << "\" for model id " << id << endl; |
710 } | 710 } |
711 | 711 |
712 return false; | 712 return false; |
713 } | 713 } |
714 | 714 |
718 QString type = attributes.value("type"); | 718 QString type = attributes.value("type"); |
719 m_currentPane = 0; | 719 m_currentPane = 0; |
720 | 720 |
721 if (type != "pane") { | 721 if (type != "pane") { |
722 cerr << "WARNING: SV-XML: Unexpected view type \"" | 722 cerr << "WARNING: SV-XML: Unexpected view type \"" |
723 << type.toLocal8Bit().data() << "\"" << endl; | 723 << type << "\"" << endl; |
724 return false; | 724 return false; |
725 } | 725 } |
726 | 726 |
727 m_currentPane = m_paneCallback.addPane(); | 727 m_currentPane = m_paneCallback.addPane(); |
728 | 728 |
776 bool ok = false; | 776 bool ok = false; |
777 id = attributes.value("id").trimmed().toInt(&ok); | 777 id = attributes.value("id").trimmed().toInt(&ok); |
778 | 778 |
779 if (!ok) { | 779 if (!ok) { |
780 cerr << "WARNING: SV-XML: No layer id for layer of type \"" | 780 cerr << "WARNING: SV-XML: No layer id for layer of type \"" |
781 << type.toLocal8Bit().data() | 781 << type |
782 << "\"" << endl; | 782 << "\"" << endl; |
783 return false; | 783 return false; |
784 } | 784 } |
785 | 785 |
786 Layer *layer = 0; | 786 Layer *layer = 0; |
835 } | 835 } |
836 } | 836 } |
837 | 837 |
838 if (!layer) { | 838 if (!layer) { |
839 cerr << "WARNING: SV-XML: Failed to add layer of type \"" | 839 cerr << "WARNING: SV-XML: Failed to add layer of type \"" |
840 << type.toLocal8Bit().data() | 840 << type |
841 << "\"" << endl; | 841 << "\"" << endl; |
842 return false; | 842 return false; |
843 } | 843 } |
844 | 844 |
845 if (isNewLayer) { | 845 if (isNewLayer) { |