From 38d2ab6bccb8a8993db7b519aed30f50d49a87c7 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sun, 13 Apr 2008 20:02:53 +0000 Subject: [PATCH] Add ad-hoc conversion for sound annotations. This requires the sound annotation type I added 5 minutes ago in the development version of Poppler. svn path=/trunk/KDE/kdegraphics/okular/; revision=796581 --- generators/poppler/annots.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/generators/poppler/annots.cpp b/generators/poppler/annots.cpp index 60b98c446..2ab53b887 100644 --- a/generators/poppler/annots.cpp +++ b/generators/poppler/annots.cpp @@ -19,6 +19,8 @@ Q_DECLARE_METATYPE( Poppler::Annotation* ) +extern Okular::Sound* createSoundFromPopplerSound( const Poppler::SoundObject *popplerSound ); + static void disposeAnnotation( const Okular::Annotation *ann ) { Poppler::Annotation *popplerAnn = qvariant_cast< Poppler::Annotation * >( ann->nativeId() ); @@ -44,6 +46,17 @@ Okular::Annotation* createAnnotationFromPopplerAnnotation( Poppler::Annotation * f->setFileIconName( attachann->fileIconName() ); f->setEmbeddedFile( new PDFEmbeddedFile( attachann->embeddedFile() ) ); + break; + } + case Poppler::Annotation::ASound: + { + Poppler::SoundAnnotation * soundann = static_cast< Poppler::SoundAnnotation * >( ann ); + Okular::SoundAnnotation * s = new Okular::SoundAnnotation(); + annotation = s; + + s->setSoundIconName( soundann->soundIconName() ); + s->setSound( createSoundFromPopplerSound( soundann->sound() ) ); + break; } #endif