Mercurial > hg > svgui
comparison widgets/TipDialog.cpp @ 585:f4960f8ce798 debug-output
Convert many cerrs to DEBUGs
| author | Chris Cannam |
|---|---|
| date | Mon, 16 May 2011 17:19:25 +0100 |
| parents | 1fe7951a61e8 |
| children | 4806715f7a19 |
comparison
equal
deleted
inserted
replaced
| 584:1fe7951a61e8 | 585:f4960f8ce798 |
|---|---|
| 112 } | 112 } |
| 113 | 113 |
| 114 void | 114 void |
| 115 TipDialog::readTips() | 115 TipDialog::readTips() |
| 116 { | 116 { |
| 117 std::cerr << "TipDialog::readTips" << std::endl; | 117 DEBUG << "TipDialog::readTips" << endl; |
| 118 | 118 |
| 119 QString language = QLocale::system().name(); | 119 QString language = QLocale::system().name(); |
| 120 QString filename = QString(":i18n/tips_%1.xml").arg(language); | 120 QString filename = QString(":i18n/tips_%1.xml").arg(language); |
| 121 | 121 |
| 122 if (!QFileInfo(filename).exists()) { | 122 if (!QFileInfo(filename).exists()) { |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 | 134 |
| 135 QFile file(filename); | 135 QFile file(filename); |
| 136 | 136 |
| 137 std::cerr << "TipDialog::readTips from " << filename << std::endl; | 137 DEBUG << "TipDialog::readTips from " << filename << 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); |
| 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 << ")" << std::endl; | 191 DEBUG << "TipFileParser::startElement(" << name << ")" << 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 << std::endl; | 195 DEBUG << "TipFileParser::caption = " << caption << 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 } |
| 222 " " + attributes.qName(i) + "=\"" + attributes.value(i) + "\""; | 222 " " + attributes.qName(i) + "=\"" + attributes.value(i) + "\""; |
| 223 } | 223 } |
| 224 m_dialog->m_tips[m_dialog->m_tips.size()-1] += ">"; | 224 m_dialog->m_tips[m_dialog->m_tips.size()-1] += ">"; |
| 225 } | 225 } |
| 226 | 226 |
| 227 std::cerr << "TipFileParser::startElement done" << std::endl; | 227 DEBUG << "TipFileParser::startElement done" << endl; |
| 228 return true; | 228 return true; |
| 229 } | 229 } |
| 230 | 230 |
| 231 bool | 231 bool |
| 232 TipDialog::TipFileParser::endElement(const QString &, const QString &, | 232 TipDialog::TipFileParser::endElement(const QString &, const QString &, |
| 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 << ")" << std::endl; | 266 DEBUG << "TipFileParser::characters(" << text << ")" << 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 |
