[vlmc-devel] commit: Settings: Comply with the HACKING rules. (Ludovic Fauvet )
git at videolan.org
git at videolan.org
Wed Apr 14 01:10:23 CEST 2010
vlmc | branch: master | Ludovic Fauvet <etix at l0cal.com> | Wed Apr 14 01:08:57 2010 +0200| [562dfa3872709e272570aaa850dd3ea2d9465f6e] | committer: Ludovic Fauvet
Settings: Comply with the HACKING rules.
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=562dfa3872709e272570aaa850dd3ea2d9465f6e
---
src/Gui/settings/Settings.cpp | 35 ++++++++++++++++++++---------------
src/Gui/settings/Settings.h | 16 ++++++++--------
2 files changed, 28 insertions(+), 23 deletions(-)
diff --git a/src/Gui/settings/Settings.cpp b/src/Gui/settings/Settings.cpp
index fca706f..b268c1a 100644
--- a/src/Gui/settings/Settings.cpp
+++ b/src/Gui/settings/Settings.cpp
@@ -38,7 +38,7 @@
#include <QtDebug>
-Settings::Settings( SettingsManager::Type type, QWidget* parent, Qt::WindowFlags f ) :
+Settings::Settings( SettingsManager::Type type, QWidget *parent, Qt::WindowFlags f ) :
QDialog( parent, f ),
m_type( type )
{
@@ -60,10 +60,11 @@ Settings::Settings( SettingsManager::Type type, QWidget* parent, Qt::WindowFlags
this, SLOT( switchWidget( int ) ) );
}
-void Settings::addCategory( const char* name,
- SettingsManager::Type type,
- const QIcon& icon,
- const QString& label )
+void
+Settings::addCategory( const char *name,
+ SettingsManager::Type type,
+ const QIcon &icon,
+ const QString &label )
{
PreferenceWidget *pWidget = new PreferenceWidget( name, type, this );
@@ -83,7 +84,7 @@ Settings::buildLayout()
m_panel->setMaximumWidth( 130 );
// Create the master layout
- QGridLayout* mLayout = new QGridLayout( this );
+ QGridLayout *mLayout = new QGridLayout( this );
mLayout->addWidget( m_panel, 0, 0, 2, 1 );
m_title = new QLabel( this );
@@ -100,21 +101,22 @@ Settings::buildLayout()
mLayout->addWidget( m_buttons, 2, 2 );
}
-void Settings::buttonClicked( QAbstractButton* button )
+void
+Settings::buttonClicked( QAbstractButton *button )
{
bool save = false;
bool hide = false;
switch ( m_buttons->standardButton( button ) )
{
- case QDialogButtonBox::Ok :
+ case QDialogButtonBox::Ok:
save = true;
hide = true;
break;
- case QDialogButtonBox::Cancel :
+ case QDialogButtonBox::Cancel:
hide = true;
break;
- case QDialogButtonBox::Apply :
+ case QDialogButtonBox::Apply:
save = true;
break;
default :
@@ -133,7 +135,8 @@ void Settings::buttonClicked( QAbstractButton* button )
setVisible( false );
}
-void Settings::switchWidget( int index )
+void
+Settings::switchWidget( int index )
{
m_stackedLayout->setCurrentIndex( index );
@@ -141,7 +144,8 @@ void Settings::switchWidget( int index )
retranslateUi();
}
-void Settings::changeEvent( QEvent *e )
+void
+Settings::changeEvent( QEvent *e )
{
switch ( e->type() )
{
@@ -153,10 +157,11 @@ void Settings::changeEvent( QEvent *e )
}
}
-void Settings::retranslateUi()
+void
+Settings::retranslateUi()
{
- PreferenceWidget* pWidget =
- qobject_cast<PreferenceWidget*>( m_stackedLayout->widget( m_stackedLayout->currentIndex() ) );
+ PreferenceWidget *pWidget = qobject_cast<PreferenceWidget*>(
+ m_stackedLayout->widget( m_stackedLayout->currentIndex() ) );
Q_ASSERT( pWidget != NULL );
// Translate the category name using the current locale
diff --git a/src/Gui/settings/Settings.h b/src/Gui/settings/Settings.h
index c995fea..bfd9938 100644
--- a/src/Gui/settings/Settings.h
+++ b/src/Gui/settings/Settings.h
@@ -45,12 +45,12 @@ class Settings : public QDialog
Q_DISABLE_COPY( Settings )
public:
- Settings( SettingsManager::Type type, QWidget* parent = 0, Qt::WindowFlags f = 0 );
+ Settings( SettingsManager::Type type, QWidget *parent = 0, Qt::WindowFlags f = 0 );
- void addCategory( const char* name,
+ void addCategory( const char *name,
SettingsManager::Type type,
- const QIcon& icon,
- const QString& label );
+ const QIcon &icon,
+ const QString &label );
protected:
void changeEvent( QEvent *e );
@@ -59,9 +59,9 @@ class Settings : public QDialog
void retranslateUi();
private:
- QDialogButtonBox* m_buttons;
- Panel* m_panel;
- QLabel* m_title;
+ QDialogButtonBox *m_buttons;
+ Panel *m_panel;
+ QLabel *m_title;
QStackedLayout *m_stackedLayout;
SettingsManager::Type m_type;
@@ -69,7 +69,7 @@ class Settings : public QDialog
void switchWidget( int index );
private slots:
- void buttonClicked( QAbstractButton* button );
+ void buttonClicked( QAbstractButton *button );
signals:
void loadSettings();
More information about the Vlmc-devel
mailing list