modules/demux/util/id3*: fixed up some dead comments

 modules/gui/kde/*: only set variable the user actually have changed when
apply is pressed in the preferences window.
parent 80921ca7
/***************************************************************************** /*****************************************************************************
* audio.c : mpeg audio Stream input module for vlc * id3.c: simple id3 tag skipper
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: id3.c,v 1.1 2002/08/24 21:35:31 sigmunau Exp $ * $Id: id3.c,v 1.2 2002/10/13 14:26:48 sigmunau Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
/***************************************************************************** /*****************************************************************************
* audio.c : mpeg audio Stream input module for vlc * id3tag.c: id3 tag parser/skipper based on libid3tag
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: id3tag.c,v 1.1 2002/08/24 21:35:31 sigmunau Exp $ * $Id: id3tag.c,v 1.2 2002/10/13 14:26:48 sigmunau Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* QConfigItem.cpp: The QConfigItem class * QConfigItem.cpp: The QConfigItem class
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: QConfigItem.cpp,v 1.2 2002/08/12 17:38:10 sigmunau Exp $ * $Id: QConfigItem.cpp,v 1.3 2002/10/13 14:26:47 sigmunau Exp $
* *
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> Mon 12.08.2002 * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> Mon 12.08.2002
* *
...@@ -27,6 +27,7 @@ QConfigItem::QConfigItem(QObject *parent, QString name, int iType, int i_val) : ...@@ -27,6 +27,7 @@ QConfigItem::QConfigItem(QObject *parent, QString name, int iType, int i_val) :
{ {
type = iType; type = iType;
iVal = i_val; iVal = i_val;
bChanged = false;
} }
QConfigItem::QConfigItem(QObject *parent, QString name, int iType, float f_val) : QConfigItem::QConfigItem(QObject *parent, QString name, int iType, float f_val) :
...@@ -34,6 +35,7 @@ QConfigItem::QConfigItem(QObject *parent, QString name, int iType, float f_val) ...@@ -34,6 +35,7 @@ QConfigItem::QConfigItem(QObject *parent, QString name, int iType, float f_val)
{ {
type = iType; type = iType;
fVal = f_val; fVal = f_val;
bChanged = false;
} }
QConfigItem::QConfigItem(QObject *parent, QString name, int iType, QString s_val) : QConfigItem::QConfigItem(QObject *parent, QString name, int iType, QString s_val) :
...@@ -41,6 +43,7 @@ QConfigItem::QConfigItem(QObject *parent, QString name, int iType, QString s_val ...@@ -41,6 +43,7 @@ QConfigItem::QConfigItem(QObject *parent, QString name, int iType, QString s_val
{ {
type = iType; type = iType;
sVal = s_val; sVal = s_val;
bChanged = false;
} }
QConfigItem::~QConfigItem() QConfigItem::~QConfigItem()
...@@ -71,19 +74,33 @@ QString QConfigItem::sValue() ...@@ -71,19 +74,33 @@ QString QConfigItem::sValue()
void QConfigItem::setValue(int val) void QConfigItem::setValue(int val)
{ {
iVal = val; iVal = val;
bChanged = true;
} }
void QConfigItem::setValue(float val) void QConfigItem::setValue(float val)
{ {
fVal = val; fVal = val;
bChanged = true;
} }
void QConfigItem::setValue(double val) void QConfigItem::setValue(double val)
{ {
fVal = (float)val; fVal = (float)val;
bChanged = true;
} }
void QConfigItem::setValue(const QString &val) void QConfigItem::setValue(const QString &val)
{ {
sVal = val; sVal = val;
bChanged = true;
}
bool QConfigItem::changed()
{
return bChanged;
}
void QConfigItem::resetChanged()
{
bChanged = false;
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* QConfigItem.h : includes for the QConfigItem class * QConfigItem.h : includes for the QConfigItem class
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: QConfigItem.h,v 1.2 2002/08/12 17:38:10 sigmunau Exp $ * $Id: QConfigItem.h,v 1.3 2002/10/13 14:26:47 sigmunau Exp $
* *
* Authors: Andres Krapf <dae@chez.com> Sun Mar 25 2001 * Authors: Andres Krapf <dae@chez.com> Sun Mar 25 2001
* *
...@@ -42,16 +42,19 @@ class QConfigItem : public QObject ...@@ -42,16 +42,19 @@ class QConfigItem : public QObject
float fValue(); float fValue();
int iValue(); int iValue();
QString sValue(); QString sValue();
bool changed();
public slots: public slots:
void setValue(int val); void setValue(int val);
void setValue(float val); void setValue(float val);
void setValue(double val); void setValue(double val);
void setValue(const QString &val); void setValue(const QString &val);
void resetChanged();
private: private:
int iVal, type; int iVal, type;
float fVal; float fVal;
QString sVal; QString sVal;
bool bChanged;
}; };
#endif #endif
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* preferences.cpp: preferences window for the kde gui * preferences.cpp: preferences window for the kde gui
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: preferences.cpp,v 1.6 2002/10/10 19:34:06 sigmunau Exp $ * $Id: preferences.cpp,v 1.7 2002/10/13 14:26:47 sigmunau Exp $
* *
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> Mon Aug 12 2002 * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> Mon Aug 12 2002
* *
...@@ -183,10 +183,10 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name, ...@@ -183,10 +183,10 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
QConfigItem *ci = new QConfigItem(this, p_item->psz_name, QConfigItem *ci = new QConfigItem(this, p_item->psz_name,
p_item->i_type, p_item->i_type,
p_item->i_value); p_item->i_value);
item_adj->setValue( p_item->i_value );
connect(item_adj, SIGNAL(valueChanged( int)), connect(item_adj, SIGNAL(valueChanged( int)),
ci, SLOT(setValue(int))); ci, SLOT(setValue(int)));
QToolTip::add(item_adj, p_item->psz_longtext); QToolTip::add(item_adj, p_item->psz_longtext);
item_adj->setValue( p_item->i_value );
} }
break; break;
...@@ -281,29 +281,33 @@ void KPreferences::slotApply() ...@@ -281,29 +281,33 @@ void KPreferences::slotApply()
while ( (obj=it.current()) != 0 ) { while ( (obj=it.current()) != 0 ) {
++it; ++it;
QConfigItem *p_config = (QConfigItem *)obj; QConfigItem *p_config = (QConfigItem *)obj;
msg_Dbg( p_intf, const_cast<char *>(p_config->name())); if ( p_config->changed() )
msg_Dbg( p_intf, "%d", p_config->getType()); {
msg_Dbg( p_intf, const_cast<char *>(p_config->name()));
msg_Dbg( p_intf, "%d", p_config->getType());
switch( p_config->getType() ) { switch( p_config->getType() ) {
case CONFIG_ITEM_STRING: case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE: case CONFIG_ITEM_FILE:
case CONFIG_ITEM_MODULE: case CONFIG_ITEM_MODULE:
if (p_config->sValue()) { if (p_config->sValue()) {
config_PutPsz( p_intf, p_config->name(), config_PutPsz( p_intf, p_config->name(),
strdup(p_config->sValue().latin1())); strdup(p_config->sValue().latin1()));
} }
else { else {
config_PutPsz( p_intf, p_config->name(), NULL ); config_PutPsz( p_intf, p_config->name(), NULL );
}
break;
case CONFIG_ITEM_INTEGER:
case CONFIG_ITEM_BOOL:
config_PutInt( p_intf, p_config->name(), p_config->iValue() );
break;
case CONFIG_ITEM_FLOAT:
config_PutFloat( p_intf, p_config->name(), p_config->fValue() );
break;
} }
break; p_config->resetChanged();
case CONFIG_ITEM_INTEGER:
case CONFIG_ITEM_BOOL:
config_PutInt( p_intf, p_config->name(), p_config->iValue() );
break;
case CONFIG_ITEM_FLOAT:
config_PutFloat( p_intf, p_config->name(), p_config->fValue() );
break;
} }
} }
delete l; delete l;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment