Ignore:
Timestamp:
Mar 8, 2010, 12:52:58 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.2 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tools/linguist/shared/translator.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4545
    4646#include <stdio.h>
     47#ifdef Q_OS_WIN
     48#include <io.h> // required for _setmode, to avoid _O_TEXT streams...
     49#include <fcntl.h> // for _O_BINARY
     50#endif
    4751
    4852#include <QtCore/QDebug>
     
    208212    QFile file;
    209213    if (filename.isEmpty() || filename == QLatin1String("-")) {
     214#ifdef Q_OS_WIN
     215        // QFile is broken for text files
     216        ::_setmode(0, _O_BINARY);
     217#endif
    210218        if (!file.open(stdin, QIODevice::ReadOnly)) {
    211219            cd.appendError(QString::fromLatin1("Cannot open stdin!? (%1)")
     
    244252    QFile file;
    245253    if (filename.isEmpty() || filename == QLatin1String("-")) {
     254#ifdef Q_OS_WIN
     255        // QFile is broken for text files
     256        ::_setmode(1, _O_BINARY);
     257#endif
    246258        if (!file.open(stdout, QIODevice::WriteOnly)) {
    247259            cd.appendError(QString::fromLatin1("Cannot open stdout!? (%1)")
Note: See TracChangeset for help on using the changeset viewer.