[Kwintv] "on" and "off"

John Ryland kwintv@mail.kde.org
Wed, 04 Dec 2002 00:00:18 +1000


Hi KWinTV team :)

In kwintv/kwintv/v4lxif.h there is:

const bool on  = true;
const bool off = false;

And in kwintv/kwintv/wintvscreen_v4l.cpp there is:

//==============================================================================

void WinTVScreen_v4l::switch_capture(int on)
{
  //kdDebug() << "screen: switch_capture from " << captureIsOn << " to " << 
on << endl;
  if (on && captureIsOn) {
    if ( isVisible() ) {
      v4lx->setCapture( on );
      captureIsOn = true;
    }
  } else {
    v4lx->setCapture( off );
  }
}

It looks like the code needs a bit of cleaning. The 'captureIsOn = true;' is 
redundent because we just tested that it is true (same code is repeated in 
the _xv file too). Also I don't particually like how the 'on' arguement is 
used in one place, and the 'off' const variable is used in the other. The 
on/off thing is confusing with variables called 'on' about the place, I 
think it would be better just putting true/false everywhere and getting rid 
of those. Just my 2c.

I'm currently just going through this to fix a bug I get on SuSE 8.1 when I 
resize and move my window around and I get crap left on the screen. I'm 
using the 'Quartz' window manager if that is relevant. Anyway hopefully I'll 
have a patch to send soon which fixes this for me.

Regards
John



_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail