Commit 25d71630 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Jean-Baptiste Kempf

qt4: preferences_widget: Adding some 'const'

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 6af2a7d1
...@@ -560,7 +560,7 @@ void StringListConfigControl::finish(module_config_t *p_module_config, bool byca ...@@ -560,7 +560,7 @@ void StringListConfigControl::finish(module_config_t *p_module_config, bool byca
label->setBuddy( combo ); label->setBuddy( combo );
} }
QString StringListConfigControl::getValue() QString StringListConfigControl::getValue() const
{ {
return combo->itemData( combo->currentIndex() ).toString(); return combo->itemData( combo->currentIndex() ).toString();
} }
...@@ -685,7 +685,7 @@ void ModuleConfigControl::finish( bool bycat ) ...@@ -685,7 +685,7 @@ void ModuleConfigControl::finish( bool bycat )
label->setBuddy( combo ); label->setBuddy( combo );
} }
QString ModuleConfigControl::getValue() QString ModuleConfigControl::getValue() const
{ {
return combo->itemData( combo->currentIndex() ).toString(); return combo->itemData( combo->currentIndex() ).toString();
} }
...@@ -803,7 +803,7 @@ void ModuleListConfigControl::finish( bool bycat ) ...@@ -803,7 +803,7 @@ void ModuleListConfigControl::finish( bool bycat )
} }
#undef CHECKBOX_LISTS #undef CHECKBOX_LISTS
QString ModuleListConfigControl::getValue() QString ModuleListConfigControl::getValue() const
{ {
assert( text ); assert( text );
return text->text(); return text->text();
...@@ -909,7 +909,7 @@ void IntegerConfigControl::finish() ...@@ -909,7 +909,7 @@ void IntegerConfigControl::finish()
label->setBuddy( spin ); label->setBuddy( spin );
} }
int IntegerConfigControl::getValue() int IntegerConfigControl::getValue() const
{ {
return spin->value(); return spin->value();
} }
...@@ -960,7 +960,7 @@ IntegerRangeSliderConfigControl::IntegerRangeSliderConfigControl( ...@@ -960,7 +960,7 @@ IntegerRangeSliderConfigControl::IntegerRangeSliderConfigControl(
label->setBuddy( slider ); label->setBuddy( slider );
} }
int IntegerRangeSliderConfigControl::getValue() int IntegerRangeSliderConfigControl::getValue() const
{ {
return slider->value(); return slider->value();
} }
...@@ -1081,7 +1081,7 @@ void IntegerListConfigControl::actionRequested( int i_action ) ...@@ -1081,7 +1081,7 @@ void IntegerListConfigControl::actionRequested( int i_action )
} }
} }
int IntegerListConfigControl::getValue() int IntegerListConfigControl::getValue() const
{ {
return combo->itemData( combo->currentIndex() ).toInt(); return combo->itemData( combo->currentIndex() ).toInt();
} }
...@@ -1127,7 +1127,7 @@ void BoolConfigControl::finish() ...@@ -1127,7 +1127,7 @@ void BoolConfigControl::finish()
checkbox->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) ); checkbox->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
} }
int BoolConfigControl::getValue() int BoolConfigControl::getValue() const
{ {
return checkbox->isChecked(); return checkbox->isChecked();
} }
...@@ -1191,7 +1191,7 @@ void FloatConfigControl::finish() ...@@ -1191,7 +1191,7 @@ void FloatConfigControl::finish()
label->setBuddy( spin ); label->setBuddy( spin );
} }
float FloatConfigControl::getValue() float FloatConfigControl::getValue() const
{ {
return (float)spin->value(); return (float)spin->value();
} }
......
...@@ -91,10 +91,10 @@ public: ...@@ -91,10 +91,10 @@ public:
widget = NULL; widget = NULL;
} }
virtual ~ConfigControl() {}; virtual ~ConfigControl() {};
virtual int getType() = 0; virtual int getType() const = 0;
const char * getName() { return p_item->psz_name; } const char * getName() const { return p_item->psz_name; }
QWidget *getWidget() { assert( widget ); return widget; } QWidget *getWidget() const { assert( widget ); return widget; }
bool isAdvanced() { return p_item->b_advanced; } bool isAdvanced() const { return p_item->b_advanced; }
virtual void hide() { getWidget()->hide(); }; virtual void hide() { getWidget()->hide(); };
virtual void show() { getWidget()->show(); }; virtual void show() { getWidget()->show(); };
...@@ -128,8 +128,8 @@ public: ...@@ -128,8 +128,8 @@ public:
VIntConfigControl( vlc_object_t *a, module_config_t *b ) : VIntConfigControl( vlc_object_t *a, module_config_t *b ) :
ConfigControl(a,b) {}; ConfigControl(a,b) {};
virtual ~VIntConfigControl() {}; virtual ~VIntConfigControl() {};
virtual int getValue() = 0; virtual int getValue() const = 0;
virtual int getType() { return CONFIG_ITEM_INTEGER; } virtual int getType() const { return CONFIG_ITEM_INTEGER; }
}; };
class IntegerConfigControl : public VIntConfigControl class IntegerConfigControl : public VIntConfigControl
...@@ -143,9 +143,9 @@ public: ...@@ -143,9 +143,9 @@ public:
IntegerConfigControl( vlc_object_t *, module_config_t *, IntegerConfigControl( vlc_object_t *, module_config_t *,
QLabel*, QSlider* ); QLabel*, QSlider* );
virtual ~IntegerConfigControl() {}; virtual ~IntegerConfigControl() {};
virtual int getValue(); virtual int getValue() const;
virtual void show() { spin->show(); if( label ) label->show(); } virtual void show() const { spin->show(); if( label ) label->show(); }
virtual void hide() { spin->hide(); if( label ) label->hide(); } virtual void hide() const { spin->hide(); if( label ) label->hide(); }
protected: protected:
QSpinBox *spin; QSpinBox *spin;
...@@ -171,7 +171,7 @@ public: ...@@ -171,7 +171,7 @@ public:
IntegerRangeSliderConfigControl( vlc_object_t *, module_config_t *, IntegerRangeSliderConfigControl( vlc_object_t *, module_config_t *,
QLabel *, QSlider * ); QLabel *, QSlider * );
virtual ~IntegerRangeSliderConfigControl() {}; virtual ~IntegerRangeSliderConfigControl() {};
virtual int getValue(); virtual int getValue() const;
protected: protected:
QSlider *slider; QSlider *slider;
private: private:
...@@ -188,7 +188,7 @@ public: ...@@ -188,7 +188,7 @@ public:
IntegerListConfigControl( vlc_object_t *, module_config_t *, QLabel *, IntegerListConfigControl( vlc_object_t *, module_config_t *, QLabel *,
QComboBox*, bool ); QComboBox*, bool );
virtual ~IntegerListConfigControl() {}; virtual ~IntegerListConfigControl() {};
virtual int getValue(); virtual int getValue() const;
virtual void hide() { combo->hide(); if( label ) label->hide(); } virtual void hide() { combo->hide(); if( label ) label->hide(); }
virtual void show() { combo->show(); if( label ) label->show(); } virtual void show() { combo->show(); if( label ) label->show(); }
private: private:
...@@ -208,10 +208,10 @@ public: ...@@ -208,10 +208,10 @@ public:
BoolConfigControl( vlc_object_t *, module_config_t *, BoolConfigControl( vlc_object_t *, module_config_t *,
QLabel *, QAbstractButton*, bool ); QLabel *, QAbstractButton*, bool );
virtual ~BoolConfigControl() {}; virtual ~BoolConfigControl() {};
virtual int getValue(); virtual int getValue() const;
virtual void show() { checkbox->show(); } virtual void show() { checkbox->show(); }
virtual void hide() { checkbox->hide(); } virtual void hide() { checkbox->hide(); }
virtual int getType() { return CONFIG_ITEM_BOOL; } virtual int getType() const { return CONFIG_ITEM_BOOL; }
private: private:
QAbstractButton *checkbox; QAbstractButton *checkbox;
void finish(); void finish();
...@@ -229,8 +229,8 @@ public: ...@@ -229,8 +229,8 @@ public:
VFloatConfigControl( vlc_object_t *a, module_config_t *b ) : VFloatConfigControl( vlc_object_t *a, module_config_t *b ) :
ConfigControl(a,b) {}; ConfigControl(a,b) {};
virtual ~VFloatConfigControl() {}; virtual ~VFloatConfigControl() {};
virtual float getValue() = 0; virtual float getValue() const = 0;
virtual int getType() { return CONFIG_ITEM_FLOAT; } virtual int getType() const { return CONFIG_ITEM_FLOAT; }
}; };
class FloatConfigControl : public VFloatConfigControl class FloatConfigControl : public VFloatConfigControl
...@@ -242,7 +242,7 @@ public: ...@@ -242,7 +242,7 @@ public:
FloatConfigControl( vlc_object_t *, module_config_t *, FloatConfigControl( vlc_object_t *, module_config_t *,
QLabel*, QDoubleSpinBox* ); QLabel*, QDoubleSpinBox* );
virtual ~FloatConfigControl() {}; virtual ~FloatConfigControl() {};
virtual float getValue(); virtual float getValue() const;
virtual void show() { spin->show(); if( label ) label->show(); } virtual void show() { spin->show(); if( label ) label->show(); }
virtual void hide() { spin->hide(); if( label ) label->hide(); } virtual void hide() { spin->hide(); if( label ) label->hide(); }
...@@ -278,8 +278,8 @@ public: ...@@ -278,8 +278,8 @@ public:
VStringConfigControl( vlc_object_t *a, module_config_t *b ) : VStringConfigControl( vlc_object_t *a, module_config_t *b ) :
ConfigControl(a,b) {}; ConfigControl(a,b) {};
virtual ~VStringConfigControl() {}; virtual ~VStringConfigControl() {};
virtual QString getValue() = 0; virtual QString getValue() const = 0;
virtual int getType() { return CONFIG_ITEM_STRING; } virtual int getType() const { return CONFIG_ITEM_STRING; }
}; };
class StringConfigControl : public VStringConfigControl class StringConfigControl : public VStringConfigControl
...@@ -291,7 +291,7 @@ public: ...@@ -291,7 +291,7 @@ public:
StringConfigControl( vlc_object_t *, module_config_t *, QLabel *, StringConfigControl( vlc_object_t *, module_config_t *, QLabel *,
QLineEdit*, bool pwd ); QLineEdit*, bool pwd );
virtual ~StringConfigControl() {}; virtual ~StringConfigControl() {};
virtual QString getValue() { return text->text(); }; virtual QString getValue() const { return text->text(); };
virtual void show() { text->show(); if( label ) label->show(); } virtual void show() { text->show(); if( label ) label->show(); }
virtual void hide() { text->hide(); if( label ) label->hide(); } virtual void hide() { text->hide(); if( label ) label->hide(); }
private: private:
...@@ -309,7 +309,7 @@ public: ...@@ -309,7 +309,7 @@ public:
FileConfigControl( vlc_object_t *, module_config_t *, QLabel *, FileConfigControl( vlc_object_t *, module_config_t *, QLabel *,
QLineEdit *, QPushButton * ); QLineEdit *, QPushButton * );
virtual ~FileConfigControl() {}; virtual ~FileConfigControl() {};
virtual QString getValue() { return text->text(); }; virtual QString getValue() const { return text->text(); };
virtual void show() { text->show(); if( label ) label->show(); browse->show(); } virtual void show() { text->show(); if( label ) label->show(); browse->show(); }
virtual void hide() { text->hide(); if( label ) label->hide(); browse->hide(); } virtual void hide() { text->hide(); if( label ) label->hide(); browse->hide(); }
public slots: public slots:
...@@ -343,7 +343,7 @@ public: ...@@ -343,7 +343,7 @@ public:
FontConfigControl( vlc_object_t *, module_config_t *, QLabel *, FontConfigControl( vlc_object_t *, module_config_t *, QLabel *,
QFontComboBox *); QFontComboBox *);
virtual ~FontConfigControl() {}; virtual ~FontConfigControl() {};
virtual QString getValue(){ return font->currentFont().family(); } virtual QString getValue() const { return font->currentFont().family(); }
protected: protected:
QLabel *label; QLabel *label;
QFontComboBox *font; QFontComboBox *font;
...@@ -357,7 +357,7 @@ public: ...@@ -357,7 +357,7 @@ public:
ModuleConfigControl( vlc_object_t *, module_config_t *, QLabel *, ModuleConfigControl( vlc_object_t *, module_config_t *, QLabel *,
QComboBox*, bool ); QComboBox*, bool );
virtual ~ModuleConfigControl() {}; virtual ~ModuleConfigControl() {};
virtual QString getValue(); virtual QString getValue() const;
virtual void hide() { combo->hide(); if( label ) label->hide(); } virtual void hide() { combo->hide(); if( label ) label->hide(); }
virtual void show() { combo->show(); if( label ) label->show(); } virtual void show() { combo->show(); if( label ) label->show(); }
private: private:
...@@ -381,7 +381,7 @@ public: ...@@ -381,7 +381,7 @@ public:
// ModuleListConfigControl( vlc_object_t *, module_config_t *, QLabel *, // ModuleListConfigControl( vlc_object_t *, module_config_t *, QLabel *,
// QComboBox*, bool ); // QComboBox*, bool );
virtual ~ModuleListConfigControl(); virtual ~ModuleListConfigControl();
virtual QString getValue(); virtual QString getValue() const;
virtual void hide(); virtual void hide();
virtual void show(); virtual void show();
public slots: public slots:
...@@ -402,7 +402,7 @@ public: ...@@ -402,7 +402,7 @@ public:
StringListConfigControl( vlc_object_t *, module_config_t *, QLabel *, StringListConfigControl( vlc_object_t *, module_config_t *, QLabel *,
QComboBox*, bool ); QComboBox*, bool );
virtual ~StringListConfigControl() {}; virtual ~StringListConfigControl() {};
virtual QString getValue(); virtual QString getValue() const;
virtual void hide() { combo->hide(); if( label ) label->hide(); } virtual void hide() { combo->hide(); if( label ) label->hide(); }
virtual void show() { combo->show(); if( label ) label->show(); } virtual void show() { combo->show(); if( label ) label->show(); }
QComboBox *combo; QComboBox *combo;
...@@ -467,7 +467,7 @@ class KeySelectorControl : public ConfigControl ...@@ -467,7 +467,7 @@ class KeySelectorControl : public ConfigControl
public: public:
KeySelectorControl( vlc_object_t *, module_config_t *, QWidget *, KeySelectorControl( vlc_object_t *, module_config_t *, QWidget *,
QGridLayout*, int& ); QGridLayout*, int& );
virtual int getType() { return CONFIG_ITEM_KEY; } virtual int getType() const { return CONFIG_ITEM_KEY; }
virtual ~KeySelectorControl() {}; virtual ~KeySelectorControl() {};
virtual void hide() { table->hide(); if( label ) label->hide(); } virtual void hide() { table->hide(); if( label ) label->hide(); }
virtual void show() { table->show(); if( label ) label->show(); } virtual void show() { table->show(); if( label ) label->show(); }
......
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