Changeset 846 for trunk/tools/linguist/shared/translator.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/tools/linguist/shared/translator.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) … … 44 44 #include "simtexth.h" 45 45 46 #include <iostream> 47 46 48 #include <stdio.h> 47 49 #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 50 57 #endif 51 58 … … 214 221 #ifdef Q_OS_WIN 215 222 // QFile is broken for text files 223 # ifdef Q_OS_WINCE 224 ::_setmode(stdin, _O_BINARY); 225 # else 216 226 ::_setmode(0, _O_BINARY); 227 # endif 217 228 #endif 218 229 if (!file.open(stdin, QIODevice::ReadOnly)) { … … 254 265 #ifdef Q_OS_WIN 255 266 // QFile is broken for text files 267 # ifdef Q_OS_WINCE 268 ::_setmode(stdout, _O_BINARY); 269 # else 256 270 ::_setmode(1, _O_BINARY); 271 # endif 257 272 #endif 258 273 if (!file.open(stdout, QIODevice::WriteOnly)) { … … 574 589 { 575 590 if (!dupes.byId.isEmpty() || !dupes.byContents.isEmpty()) { 591 std::cerr << "Warning: dropping duplicate messages in '" << qPrintable(fileName); 576 592 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"; 579 594 } else { 580 qWarning("Warning: dropping duplicate messages in '%s':", qPrintable(fileName));595 std::cerr << "':\n"; 581 596 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; 583 598 foreach (int j, dupes.byContents) { 584 599 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; 588 602 if (!msg.comment().isEmpty()) 589 qWarning("* Comment: %s", qPrintable(msg.comment()));603 std::cerr << "* Comment: " << qPrintable(msg.comment()) << std::endl; 590 604 } 591 qWarning();605 std::cerr << std::endl; 592 606 } 593 607 } … … 653 667 if (l != QLocale::C) { 654 668 QStringList forms; 655 if (getNumerusInfo(l, c, 0, &forms ))669 if (getNumerusInfo(l, c, 0, &forms, 0)) 656 670 numPlurals = forms.count(); // includes singular 657 671 } … … 676 690 "Removed plural forms as the target language has less " 677 691 "forms.\nIf this sounds wrong, possibly the target language is " 678 "not set or recognized. \n"));692 "not set or recognized.")); 679 693 } 680 694 … … 725 739 if (!codec) { 726 740 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"; 728 742 m_codec = QTextCodec::codecForName("ISO-8859-1"); 729 743 } else {
Note:
See TracChangeset
for help on using the changeset viewer.