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/tools/linguist/shared/xliff.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)
     
    5454
    5555
     56// The string value is historical and reflects the main purpose: Keeping
     57// obsolete entries separate from the magic file message (which both have
     58// no location information, but typically reside at opposite ends of the file).
     59#define MAGIC_OBSOLETE_REFERENCE "Obsolete_PO_entries"
     60
    5661QT_BEGIN_NAMESPACE
    5762
     
    504509        m_sourceLanguage = atts.value(QLatin1String("source-language"));
    505510        m_sourceLanguage.replace(QLatin1Char('-'), QLatin1Char('_'));
     511        if (m_sourceLanguage == QLatin1String("en"))
     512            m_sourceLanguage.clear();
    506513    } else if (localName == QLatin1String("group")) {
    507514        if (atts.value(QLatin1String("restype")) == QLatin1String(restypeContext)) {
     
    691698        return false;
    692699    }
     700    if (m_type == TranslatorMessage::Obsolete && m_refs.size() == 1
     701        && m_refs.at(0).fileName() == QLatin1String(MAGIC_OBSOLETE_REFERENCE))
     702        m_refs.clear();
    693703    TranslatorMessage msg(m_context, m_sources[0],
    694704                          m_comment, QString(), QString(), -1,
     
    760770    QList<QString> fileOrder;
    761771    foreach (const TranslatorMessage &msg, translator.messages()) {
    762         QHash<QString, QList<TranslatorMessage> > &file = messageOrder[msg.fileName()];
     772        QString fn = msg.fileName();
     773        if (fn.isEmpty() && msg.type() == TranslatorMessage::Obsolete)
     774            fn = QLatin1String(MAGIC_OBSOLETE_REFERENCE);
     775        QHash<QString, QList<TranslatorMessage> > &file = messageOrder[fn];
    763776        if (file.isEmpty())
    764             fileOrder.append(msg.fileName());
     777            fileOrder.append(fn);
    765778        QList<TranslatorMessage> &context = file[msg.context()];
    766779        if (context.isEmpty())
    767             contextOrder[msg.fileName()].append(msg.context());
     780            contextOrder[fn].append(msg.context());
    768781        context.append(msg);
    769782    }
Note: See TracChangeset for help on using the changeset viewer.