comparison widgets/TipDialog.cpp @ 584:1fe7951a61e8 debug-output

Remove most toStdString calls (no longer needed, with debug header)
author Chris Cannam
date Thu, 12 May 2011 17:31:43 +0100
parents 387f2f6fc333
children f4960f8ce798
comparison
equal deleted inserted replaced
583:4c484636d5ec 584:1fe7951a61e8
132 } 132 }
133 } 133 }
134 134
135 QFile file(filename); 135 QFile file(filename);
136 136
137 std::cerr << "TipDialog::readTips from " << filename.toStdString() << std::endl; 137 std::cerr << "TipDialog::readTips from " << filename << std::endl;
138 138
139 QXmlInputSource source(&file); 139 QXmlInputSource source(&file);
140 140
141 TipFileParser parser(this); 141 TipFileParser parser(this);
142 parser.parse(source); 142 parser.parse(source);
144 144
145 void 145 void
146 TipDialog::showTip() 146 TipDialog::showTip()
147 { 147 {
148 if (m_tipNumber < int(m_tips.size())) { 148 if (m_tipNumber < int(m_tips.size())) {
149 std::cerr << "Tip " << m_tipNumber << " is: " << m_tips[m_tipNumber].toStdString() << std::endl; 149 std::cerr << "Tip " << m_tipNumber << " is: " << m_tips[m_tipNumber] << std::endl;
150 m_label->setText(m_tips[m_tipNumber]); 150 m_label->setText(m_tips[m_tipNumber]);
151 } else { 151 } else {
152 accept(); 152 accept();
153 } 153 }
154 154
186 const QString &qName, 186 const QString &qName,
187 const QXmlAttributes &attributes) 187 const QXmlAttributes &attributes)
188 { 188 {
189 QString name = qName.toLower(); 189 QString name = qName.toLower();
190 190
191 std::cerr << "TipFileParser::startElement(" << name.toStdString() << ")" << std::endl; 191 std::cerr << "TipFileParser::startElement(" << name << ")" << std::endl;
192 192
193 if (name == "tips") { 193 if (name == "tips") {
194 QString caption = attributes.value("caption"); 194 QString caption = attributes.value("caption");
195 std::cerr << "TipFileParser::caption = " << caption.toStdString() << std::endl; 195 std::cerr << "TipFileParser::caption = " << caption << std::endl;
196 if (caption != "") m_dialog->m_caption = caption; 196 if (caption != "") m_dialog->m_caption = caption;
197 } else if (name == "tip") { 197 } else if (name == "tip") {
198 if (m_inTip) { 198 if (m_inTip) {
199 std::cerr << "WARNING: TipFileParser: nested <tip> elements" << std::endl; 199 std::cerr << "WARNING: TipFileParser: nested <tip> elements" << std::endl;
200 } 200 }
261 } 261 }
262 262
263 bool 263 bool
264 TipDialog::TipFileParser::characters(const QString &text) 264 TipDialog::TipFileParser::characters(const QString &text)
265 { 265 {
266 std::cerr << "TipFileParser::characters(" << text.toStdString() << ")" << std::endl; 266 std::cerr << "TipFileParser::characters(" << text << ")" << std::endl;
267 267
268 if (m_inText || m_inHtml) { 268 if (m_inText || m_inHtml) {
269 m_dialog->m_tips[m_dialog->m_tips.size()-1] += text; 269 m_dialog->m_tips[m_dialog->m_tips.size()-1] += text;
270 } 270 }
271 271
278 QString errorString = 278 QString errorString =
279 QString("ERROR: TipFileParser: %1 at line %2, column %3") 279 QString("ERROR: TipFileParser: %1 at line %2, column %3")
280 .arg(exception.message()) 280 .arg(exception.message())
281 .arg(exception.lineNumber()) 281 .arg(exception.lineNumber())
282 .arg(exception.columnNumber()); 282 .arg(exception.columnNumber());
283 std::cerr << errorString.toStdString() << std::endl; 283 std::cerr << errorString << std::endl;
284 return QXmlDefaultHandler::error(exception); 284 return QXmlDefaultHandler::error(exception);
285 } 285 }
286 286
287 bool 287 bool
288 TipDialog::TipFileParser::fatalError(const QXmlParseException &exception) 288 TipDialog::TipFileParser::fatalError(const QXmlParseException &exception)
290 QString errorString = 290 QString errorString =
291 QString("FATAL ERROR: TipFileParser: %1 at line %2, column %3") 291 QString("FATAL ERROR: TipFileParser: %1 at line %2, column %3")
292 .arg(exception.message()) 292 .arg(exception.message())
293 .arg(exception.lineNumber()) 293 .arg(exception.lineNumber())
294 .arg(exception.columnNumber()); 294 .arg(exception.columnNumber());
295 std::cerr << errorString.toStdString() << std::endl; 295 std::cerr << errorString << std::endl;
296 return QXmlDefaultHandler::fatalError(exception); 296 return QXmlDefaultHandler::fatalError(exception);
297 } 297 }