Changeset 846 for trunk/qmake/generators/xmloutput.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/qmake/generators/xmloutput.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 80 80 { 81 81 currentState = state; 82 } 83 84 void XmlOutput::setFormat(XMLFormat newFormat) 85 { 86 format = newFormat; 82 87 } 83 88 … … 173 178 newTagOpen(o.xo_text); 174 179 break; 180 case tTagValue: 181 addRaw(QString("\n%1<%2>").arg(currentIndent).arg(o.xo_text)); 182 addRaw(QString("%1").arg(o.xo_value)); 183 addRaw(QString("</%1>").arg(o.xo_text)); 184 break; 185 case tValueTag: 186 addRaw(QString("%1").arg(doConversion(o.xo_text))); 187 setFormat(NoNewLine); 188 closeTag(); 189 setFormat(NewLine); 190 break; 191 case tImport: 192 addRaw(QString("\n%1<Import %2=\"%3\" />").arg(currentIndent).arg(o.xo_text).arg(o.xo_value)); 193 break; 175 194 case tCloseTag: 176 195 if (o.xo_value.count()) … … 183 202 case tAttribute: 184 203 addAttribute(o.xo_text, o.xo_value); 204 break; 205 case tAttributeTag: 206 addAttributeTag(o.xo_text, o.xo_value); 185 207 break; 186 208 case tData: … … 267 289 break; 268 290 case Attribute: 269 xmlFile << " />";291 xmlFile << " />"; 270 292 tagStack.pop_back(); 271 293 currentState = Tag; … … 308 330 return; 309 331 } 310 QString outData = QString("<?xml version=\"%1\" encoding =\"%2\"?>")332 QString outData = QString("<?xml version=\"%1\" encoding=\"%2\"?>") 311 333 .arg(doConversion(version)) 312 334 .arg(doConversion(encoding)); … … 338 360 } 339 361 362 void XmlOutput::addAttributeTag(const QString &attribute, const QString &value) 363 { 364 switch(currentState) { 365 case Bare: 366 case Tag: 367 //warn_msg(WarnLogic, "<%s>: Cannot add attribute since tags not open", tagStack.last().toLatin1().constData()); 368 qDebug("<%s>: Cannot add attribute (%s) since tag's not open", 369 (tagStack.count() ? tagStack.last().toLatin1().constData() : "Root"), 370 attribute.toLatin1().constData()); 371 return; 372 case Attribute: 373 break; 374 } 375 xmlFile << " " << doConversion(attribute) << "=\"" << doConversion(value) << "\""; 376 } 377 340 378 QT_END_NAMESPACE
Note:
See TracChangeset
for help on using the changeset viewer.