diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-09 17:47:56 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-09 17:47:56 (GMT) |
commit | 9227f8606c85ad9a472628a8a06c312452d69f14 (patch) | |
tree | 004e193bd008fb5bf3c33d128223f425a0e8d614 /src/plugins/imageformats/jpeg | |
parent | e06d011cc08de370ece3b0c324b0a735a2625820 (diff) | |
parent | 0edda17e2edb4da968b026ac6658f740323d6dd5 (diff) | |
download | Qt-9227f8606c85ad9a472628a8a06c312452d69f14.zip Qt-9227f8606c85ad9a472628a8a06c312452d69f14.tar.gz Qt-9227f8606c85ad9a472628a8a06c312452d69f14.tar.bz2 |
Merge branch '4.7-cutoff' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7-cutoff' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (82 commits)
Revert 12b6987031be9faee3886d7623888feb4e1762af
Changed TEST_COMPILER from CC to CXX in configure script.
doc: Fixed several qdoc errors.
Carbon: Native filedialog does not apply filters on app-bundles
Cocoa: Native filedialog does not apply filters on app-bundles
Improve performance of QTimer::singleShot
Add a benchmark comparing single shot timer with invokeMethod
use Qt's private mac functions, reduce code redundancy
Assistant: Fix compile warning for empty header.
Doc: mark QEasingCurve support functions as new in 4.7.
Modify the XML test suite not to use non-characters.
Autotest: Fix failing QTextCodec tests
Doc: mark methods as internal (as they were in previous releases)
Doc: add image for Qt Quick to "What's New" page.
qdoc: Clear a static multimap after each qdocconf file.
qdoc: Added some debug output to track down a crash
Fixed mouse wheel handling in scrollareas.
Added two missing keys for X11
Carbon: usage of menu bars can cause exceptions to be thrown
Mac: compile fix
...
Diffstat (limited to 'src/plugins/imageformats/jpeg')
-rw-r--r-- | src/plugins/imageformats/jpeg/qjpeghandler.cpp | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp index 6eed824..0f0d6f6 100644 --- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp +++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp @@ -793,15 +793,16 @@ bool QJpegHandler::supportsOption(ImageOption option) const QVariant QJpegHandler::option(ImageOption option) const { - if (option == Quality) { + switch(option) { + case Quality: return quality; - } else if (option == ScaledSize) { + case ScaledSize: return scaledSize; - } else if (option == ScaledClipRect) { + case ScaledClipRect: return scaledClipRect; - } else if (option == ClipRect) { + case ClipRect: return clipRect; - } else if (option == Size) { + case Size: if (canRead() && !device()->isSequential()) { qint64 pos = device()->pos(); int width = 0; @@ -810,7 +811,8 @@ QVariant QJpegHandler::option(ImageOption option) const device()->seek(pos); return QSize(width, height); } - } else if (option == ImageFormat) { + return QVariant(); + case ImageFormat: if (canRead() && !device()->isSequential()) { qint64 pos = device()->pos(); QImage::Format format = QImage::Format_Invalid; @@ -819,20 +821,29 @@ QVariant QJpegHandler::option(ImageOption option) const return format; } return QImage::Format_Invalid; + default: + return QVariant(); } - return QVariant(); } void QJpegHandler::setOption(ImageOption option, const QVariant &value) { - if (option == Quality) + switch(option) { + case Quality: quality = value.toInt(); - else if ( option == ScaledSize ) + break; + case ScaledSize: scaledSize = value.toSize(); - else if ( option == ScaledClipRect ) + break; + case ScaledClipRect: scaledClipRect = value.toRect(); - else if ( option == ClipRect ) + break; + case ClipRect: clipRect = value.toRect(); + break; + default: + break; + } } QByteArray QJpegHandler::name() const |