From: Kelvie W. <ke...@ie...> - 2008-05-31 01:56:59
|
I think we'll make a distinction between animation and multimedia in the future; these two classes (QMovie, QImageReader) operate on animations and images, whereas when we do a Multimedia note, it'll do sound and video (ala Phonon). --- src/notefactory.cpp | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/notefactory.cpp b/src/notefactory.cpp index 0ee44e3..c85cf8a 100644 --- a/src/notefactory.cpp +++ b/src/notefactory.cpp @@ -660,12 +660,16 @@ bool NoteFactory::maybeImageOrAnimation(const KUrl &url) {"BMP", "GIF", "JPEG", "MNG", "PBM", "PGM", "PNG", "PPM", "XBM", "XPM"} QImageDecoder::inputFormats(): {"GIF", "MNG", "PNG"} */ - Q3StrList list = QImageIO::inputFormats(); - list.prepend("jpg"); // Since QImageDrag return only "JPEG" and extensions can be "JPG"; preprend for heuristic optim. - char *s; + QList<QByteArray> formats = QImageReader::supportedImageFormats(); + formats << QMovie::supportedFormats(); + + // Since QImageDrag return only "JPEG" and extensions can be "JPG"; + // preprend for heuristic optim. + formats.prepend("jpg"); + QString path = url.url().toLower(); - for (s = list.first(); s; s = list.next()) - if (path.endsWith(QString(".") + QString(s).toLower())) + foreach (QByteArray format, formats) + if (path.endsWith(QString(".") + QString(format).toLower())) return true; // TODO: Search real MIME type for local files? return false; -- 1.5.5.GIT |