summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index ec861ee..b5ae4e5 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -751,65 +751,67 @@ void ODevice::sendSuspendmsg()
751 * 751 *
752 * @param aFilter The KeyFilter to be prepended to the list of filters 752 * @param aFilter The KeyFilter to be prepended to the list of filters
753 * 753 *
754 * @see Opie::Core::OKeyFilter 754 * @see Opie::Core::OKeyFilter
755 * @see Opie::Core::OKeyFilter::inst() 755 * @see Opie::Core::OKeyFilter::inst()
756 */ 756 */
757void ODevice::addPreHandler(QWSServer::KeyboardFilter*aFilter) 757void ODevice::addPreHandler(QWSServer::KeyboardFilter*aFilter)
758{ 758{
759 Opie::Core::OKeyFilter::inst()->addPreHandler(aFilter); 759 Opie::Core::OKeyFilter::inst()->addPreHandler(aFilter);
760} 760}
761 761
762/** 762/**
763 * \brief Remove the QWSServer::KeyboardFilter in the param from the list 763 * \brief Remove the QWSServer::KeyboardFilter in the param from the list
764 * 764 *
765 * Remove the QWSServer::KeyboardFilter \par aFilter from the List 765 * Remove the QWSServer::KeyboardFilter \par aFilter from the List
766 * of Keyfilters. Call this when you delete the KeyFilter! 766 * of Keyfilters. Call this when you delete the KeyFilter!
767 * 767 *
768 * @param aFilter The filter to be removed from the Opie::Core::OKeyFilter 768 * @param aFilter The filter to be removed from the Opie::Core::OKeyFilter
769 * @see Opie::Core::ODevice::addPreHandler 769 * @see Opie::Core::ODevice::addPreHandler
770 */ 770 */
771void ODevice::remPreHandler(QWSServer::KeyboardFilter*aFilter) 771void ODevice::remPreHandler(QWSServer::KeyboardFilter*aFilter)
772{ 772{
773 Opie::Core::OKeyFilter::inst()->remPreHandler(aFilter); 773 Opie::Core::OKeyFilter::inst()->remPreHandler(aFilter);
774} 774}
775 775
776 776
777/** 777/**
778 * @internal 778 * @internal
779 * 779 *
780 * @see changeMixerForAlarm 780 * @see changeMixerForAlarm
781 */ 781 */
782void ODevice::playingStopped() { 782void ODevice::playingStopped() {
783 const_cast<QObject*>(sender())->disconnect( this ); 783 if ( sender() )
784 const_cast<QObject*>(sender())->disconnect( this );
785
784#ifndef QT_NO_SOUND 786#ifndef QT_NO_SOUND
785 if ( d->m_sound >= 0 ) { 787 if ( d->m_sound >= 0 ) {
786 ::ioctl ( d->m_sound, MIXER_WRITE( d->m_mixer ), &d->m_vol ); 788 ::ioctl ( d->m_sound, MIXER_WRITE( d->m_mixer ), &d->m_vol );
787 ::close ( d->m_sound ); 789 ::close ( d->m_sound );
788 } 790 }
789#endif 791#endif
790} 792}
791 793
792 794
793/** 795/**
794 * \brief Change the Volume for the Alarm and set it back after playing is finished 796 * \brief Change the Volume for the Alarm and set it back after playing is finished
795 * 797 *
796 * If you play an Alarm Sound you might want to change the Mixer to 798 * If you play an Alarm Sound you might want to change the Mixer to
797 * full volume and ignore the user setting. After it \sa Sound::isFinished 799 * full volume and ignore the user setting. After it \sa Sound::isFinished
798 * you would turn the volume back to the user preference. 800 * you would turn the volume back to the user preference.
799 * The problem is that we used to enter the event loop while waiting 801 * The problem is that we used to enter the event loop while waiting
800 * for the sound to be finished triggering all kind of reentrance 802 * for the sound to be finished triggering all kind of reentrance
801 * problems what a library shouldn't introduce. 803 * problems what a library shouldn't introduce.
802 * Instead of manually waiting for the sound to be finished use 804 * Instead of manually waiting for the sound to be finished use
803 * this Method and it will automatically restore the Mixer to 805 * this Method and it will automatically restore the Mixer to
804 * the user configuration after the sound finished playing. 806 * the user configuration after the sound finished playing.
805 * 807 *
806 * Note: The onwership of \param snd is not transfered and playing 808 * Note: The onwership of \param snd is not transfered and playing
807 * is not started in this method. If 'snd' gets deleted before 809 * is not started in this method. If 'snd' gets deleted before
808 * playing is finished the volume doesn't get set back to 810 * playing is finished the volume doesn't get set back to
809 * the user preference! 811 * the user preference!
810 * 812 *
811 * \code 813 * \code
812 * static Sound snd("alarm"); 814 * static Sound snd("alarm");
813 * if(!snd.isFinished()) 815 * if(!snd.isFinished())
814 * return; 816 * return;
815 * 817 *