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/translator.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)
     
    4444#include "simtexth.h"
    4545
     46#include <iostream>
     47
    4648#include <stdio.h>
    4749#ifdef Q_OS_WIN
    48 #include <io.h> // required for _setmode, to avoid _O_TEXT streams...
    49 #include <fcntl.h> // for _O_BINARY
     50// required for _setmode, to avoid _O_TEXT streams...
     51# ifdef Q_OS_WINCE
     52#  include <stdlib.h>
     53# else
     54#  include <io.h> // for _setmode
     55#  include <fcntl.h> // for _O_BINARY
     56# endif
    5057#endif
    5158
     
    214221#ifdef Q_OS_WIN
    215222        // QFile is broken for text files
     223# ifdef Q_OS_WINCE
     224        ::_setmode(stdin, _O_BINARY);
     225# else
    216226        ::_setmode(0, _O_BINARY);
     227# endif
    217228#endif
    218229        if (!file.open(stdin, QIODevice::ReadOnly)) {
     
    254265#ifdef Q_OS_WIN
    255266        // QFile is broken for text files
     267# ifdef Q_OS_WINCE
     268        ::_setmode(stdout, _O_BINARY);
     269# else
    256270        ::_setmode(1, _O_BINARY);
     271# endif
    257272#endif
    258273        if (!file.open(stdout, QIODevice::WriteOnly)) {
     
    574589{
    575590    if (!dupes.byId.isEmpty() || !dupes.byContents.isEmpty()) {
     591        std::cerr << "Warning: dropping duplicate messages in '" << qPrintable(fileName);
    576592        if (!verbose) {
    577             qWarning("Warning: dropping duplicate messages in '%s'\n(try -verbose for more info).",
    578                      qPrintable(fileName));
     593            std::cerr << "'\n(try -verbose for more info).\n";
    579594        } else {
    580             qWarning("Warning: dropping duplicate messages in '%s':", qPrintable(fileName));
     595            std::cerr << "':\n";
    581596            foreach (int i, dupes.byId)
    582                 qWarning("\n* ID: %s", qPrintable(message(i).id()));
     597                std::cerr << "\n* ID: " << qPrintable(message(i).id()) << std::endl;
    583598            foreach (int j, dupes.byContents) {
    584599                const TranslatorMessage &msg = message(j);
    585                 qWarning("\n* Context: %s\n* Source: %s",
    586                         qPrintable(msg.context()),
    587                         qPrintable(msg.sourceText()));
     600                std::cerr << "\n* Context: " << qPrintable(msg.context())
     601                          << "\n* Source: " << qPrintable(msg.sourceText()) << std::endl;
    588602                if (!msg.comment().isEmpty())
    589                     qWarning("* Comment: %s", qPrintable(msg.comment()));
     603                    std::cerr << "* Comment: " << qPrintable(msg.comment()) << std::endl;
    590604            }
    591             qWarning();
     605            std::cerr << std::endl;
    592606        }
    593607    }
     
    653667    if (l != QLocale::C) {
    654668        QStringList forms;
    655         if (getNumerusInfo(l, c, 0, &forms))
     669        if (getNumerusInfo(l, c, 0, &forms, 0))
    656670            numPlurals = forms.count(); // includes singular
    657671    }
     
    676690            "Removed plural forms as the target language has less "
    677691            "forms.\nIf this sounds wrong, possibly the target language is "
    678             "not set or recognized.\n"));
     692            "not set or recognized."));
    679693}
    680694
     
    725739    if (!codec) {
    726740        if (!name.isEmpty())
    727             qWarning("No QTextCodec for %s available. Using Latin1\n", name.constData());
     741            std::cerr << "No QTextCodec for " << name.constData() << " available. Using Latin1.\n";
    728742        m_codec = QTextCodec::codecForName("ISO-8859-1");
    729743    } else {
Note: See TracChangeset for help on using the changeset viewer.