[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-multimedia
Subject:    Re: patch: knotify cleanup
From:       Charles <charles () derkarl ! org>
Date:       2000-08-29 21:48:18
[Download RAW message or body]

But what does this _do_ ?

On Tue, 29 Aug 2000, Stefan Schimanski wrote:
> Am Tue, 29 Aug 2000 schrieb Carsten Pfeiffer:
> > On Tue, Aug 29, 2000 at 09:02:47PM +0200, Stefan Schimanski wrote:
> >
> > Hi,
> >
> > > I've cleaned up the sources of knotify a bit.
> > > Here is the patch.
> >
> > do you have a readable patch showing the actual differences, not just the
> > indenting?
> >
> > Cheers,
> > Carsten Pfeiffer
>
> I've removed most lines that only include cosmetic changes. Here is the
> result ( a bit better to read, I hope ):
>
>
> -    if (!KUniqueApplication::start())
> -        exit(0);
> +    // initialize application
> +    if ( !KUniqueApplication::start() ) {
> +        kdDebug() << "Running knotify found" << endl;
> +        return 0;
> +    }
>
>
> -    (void) new KNotify;
> +    KNotify notify;
>
>
> +        // get sound file name
> +        sound = eventsFile->readEntry( "soundfile" );
> +        if ( sound.length()==0 )
> +            sound = eventsFile->readEntry( "default_sound" );
> +
> +        // get log file name
> +        file = eventsFile->readEntry( "logfile" );
> +        if ( file.length() )
> +            file = eventsFile->readEntry( "default_logfile" );
>
> -        sound=eventsfile->readEntry("soundfile", 0);
> -        if (sound.isNull())
> -            sound=eventsfile->readEntry("default_sound", "");
> +        // get default event level
> +        level = eventsFile->readNumEntry( "level", 0 );
>
> -        file=eventsfile->readEntry("logfile", 0);
> -        if (file.isNull())
> -            file=eventsfile->readEntry("default_logfile", "");
>
>
>      // Oh dear! we seem to have lost our connection to artsd!
> -    if(server.error())
> +    if( g_soundServer.isNull() || g_soundServer.error() )
>          connectSoundServer();
>
> -    QString f(sound);
> -    if (QFileInfo(sound).isRelative())
> -        f=locate("sound", sound);
> -
> -    kdDebug() << "KNotify::notifyBySound - Trying to play file " << sound
> << endl;
> -    if(!server.isNull()) server.play(QFile::encodeName(f).data());
> +    if ( !g_soundServer.isNull() && !g_soundServer.error() ) {
>
> -    return true;
> +        // get file name
> +        QString soundFile(sound);
> +        if ( QFileInfo(sound).isRelative() )
> +            soundFile = locate( "sound", sound );
> +
> +        // play sound finally
> +        kdDebug() << "KNotify::notifyBySound - trying to play file " <<
> soundFile << endl;
> +        g_soundServer.play( QFile::encodeName(soundFile).data() );
> +
> +        return true;
> +    } else {
> +        kdDebug() << "KNotify::notifyBySound - can't connect to aRts
> daemon" << endl;
> +        return false;
> +    }
>  }
>
> _______________________________________________
> Kde-multimedia mailing list
> Kde-multimedia@master.kde.org
> http://master.kde.org/mailman/listinfo/kde-multimedia

-- 

Charles - charles@kde.org
"Flotte sko, vil du knulle?"
_______________________________________________
Kde-multimedia mailing list
Kde-multimedia@master.kde.org
http://master.kde.org/mailman/listinfo/kde-multimedia

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic