[mythtv] Correct way to write out to the settings table?

Matt Zimmerman mdz at debian.org
Fri Feb 21 08:47:00 EST 2003


On Sat, Feb 22, 2003 at 02:23:04AM +1300, Drew Whittle wrote:

> I'm having a go at adding some bits and pieces to Myth, but I haven't
> been able to figure out the correct way to write a changed setting out
> to the DB.
> 
> Currently I am doing:
> 
>  thequery = QString("UPDATE settings SET data = \"%1\" WHERE value = "
>         "\"Theme\";").arg(themename);
>     db->exec(thequery);
> 
> This works, but it's not correct (ie it updates all clients to that
> theme), now I could go and get the right host name etc and add that into
> the where clause, but I figure there must be something I can call that
> will take care of all of this for me.

ThemeSelector theme;
theme.setValue(themename);
theme.save(db);

should work.

However, I am interested to know why you would be doing something like this.

-- 
 - mdz


More information about the mythtv-dev mailing list