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/src/gui/image/qimagewriter.cpp

    r769 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)
     
    115115#include <private/qpnghandler_p.h>
    116116#endif
     117#ifndef QT_NO_IMAGEFORMAT_JPEG
     118#include <private/qjpeghandler_p.h>
     119#endif
     120#ifndef QT_NO_IMAGEFORMAT_MNG
     121#include <private/qmnghandler_p.h>
     122#endif
     123#ifndef QT_NO_IMAGEFORMAT_TIFF
     124#include <private/qtiffhandler_p.h>
     125#endif
     126#ifdef QT_BUILTIN_GIF_READER
     127#include <private/qgifhandler_p.h>
     128#endif
    117129
    118130QT_BEGIN_NAMESPACE
    119131
    120 #if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     132#ifndef QT_NO_LIBRARY
    121133Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
    122134                          (QImageIOHandlerFactoryInterface_iid, QLatin1String("/imageformats")))
     
    130142    QImageIOHandler *handler = 0;
    131143
    132 #if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     144#ifndef QT_NO_LIBRARY
    133145    // check if any plugins can write the image
    134146    QFactoryLoader *l = loader();
     
    143155        if (QFile *file = qobject_cast<QFile *>(device)) {
    144156            if (!(suffix = QFileInfo(file->fileName()).suffix().toLower().toLatin1()).isEmpty()) {
    145 #if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     157#ifndef QT_NO_LIBRARY
    146158                int index = keys.indexOf(QString::fromLatin1(suffix));
    147159                if (index != -1)
     
    154166    QByteArray testFormat = !form.isEmpty() ? form : suffix;
    155167
    156 #if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     168#ifndef QT_NO_LIBRARY
    157169    if (suffixPluginIndex != -1) {
    158170        // when format is missing, check if we can find a plugin for the
     
    162174            handler = plugin->create(device, suffix);
    163175    }
    164 #endif // Q_NO_LIBRARY
     176#endif // QT_NO_LIBRARY
    165177
    166178    // check if any built-in handlers can write the image
     
    171183            handler = new QPngHandler;
    172184#endif
     185#ifndef QT_NO_IMAGEFORMAT_JPEG
     186        } else if (testFormat == "jpg" || testFormat == "jpeg") {
     187            handler = new QJpegHandler;
     188#endif
     189#ifndef QT_NO_IMAGEFORMAT_MNG
     190        } else if (testFormat == "mng") {
     191            handler = new QMngHandler;
     192#endif
     193#ifndef QT_NO_IMAGEFORMAT_TIFF
     194        } else if (testFormat == "tif" || testFormat == "tiff") {
     195            handler = new QTiffHandler;
     196#endif
     197#ifdef QT_BUILTIN_GIF_READER
     198        } else if (testFormat == "gif") {
     199            handler = new QGifHandler;
     200#endif
    173201#ifndef QT_NO_IMAGEFORMAT_BMP
    174202        } else if (testFormat == "bmp") {
     
    193221    }
    194222
    195 #if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     223#ifndef QT_NO_LIBRARY
    196224    if (!testFormat.isEmpty()) {
    197225        for (int i = 0; i < keys.size(); ++i) {
     
    204232        }
    205233    }
    206 #endif
     234#endif // QT_NO_LIBRARY
    207235
    208236    if (!handler)
     
    670698    formats << "png";
    671699#endif
    672 
    673 #if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     700#ifndef QT_NO_IMAGEFORMAT_JPEG
     701    formats << "jpg" << "jpeg";
     702#endif
     703#ifndef QT_NO_IMAGEFORMAT_MNG
     704    formats << "mng";
     705#endif
     706#ifndef QT_NO_IMAGEFORMAT_TIFF
     707    formats << "tif" << "tiff";
     708#endif
     709#ifdef QT_BUILTIN_GIF_READER
     710    formats << "gif";
     711#endif
     712
     713#ifndef QT_NO_LIBRARY
    674714    QFactoryLoader *l = loader();
    675715    QStringList keys = l->keys();
Note: See TracChangeset for help on using the changeset viewer.