Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/qmake/generators/xmloutput.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    8080{
    8181    currentState = state;
     82}
     83
     84void XmlOutput::setFormat(XMLFormat newFormat)
     85{
     86    format = newFormat;
    8287}
    8388
     
    173178        newTagOpen(o.xo_text);
    174179        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;
    175194    case tCloseTag:
    176195        if (o.xo_value.count())
     
    183202    case tAttribute:
    184203        addAttribute(o.xo_text, o.xo_value);
     204        break;
     205    case tAttributeTag:
     206        addAttributeTag(o.xo_text, o.xo_value);
    185207        break;
    186208    case tData:
     
    267289            break;
    268290        case Attribute:
    269             xmlFile << "/>";
     291            xmlFile << " />";
    270292            tagStack.pop_back();
    271293            currentState = Tag;
     
    308330            return;
    309331    }
    310     QString outData = QString("<?xml version=\"%1\" encoding = \"%2\"?>")
     332    QString outData = QString("<?xml version=\"%1\" encoding=\"%2\"?>")
    311333                              .arg(doConversion(version))
    312334                              .arg(doConversion(encoding));
     
    338360}
    339361
     362void 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
    340378QT_END_NAMESPACE
Note: See TracChangeset for help on using the changeset viewer.