Commit 8d1f4bcf authored by Rohit Yadav's avatar Rohit Yadav

Src: Apply Hackings, function return types placed on its own line.

For whole src/ applies Hackings rule that every function return type
gets placed on its own line. TagWidget gets few spelling corrections.
parent ff3dc82b
......@@ -36,12 +36,14 @@
#include <QtDebug>
void Commands::trigger( QUndoCommand* command )
void
Commands::trigger( QUndoCommand* command )
{
UndoStack::getInstance()->push( command );
}
#else
void Commands::trigger( Commands::Generic* command )
void
Commands::trigger( Commands::Generic* command )
{
command->redo();
}
......
......@@ -52,7 +52,8 @@ KeyboardShortcutHelper::KeyboardShortcutHelper( const QString& name, QAction *ac
SettingsManager::Vlmc );
}
void KeyboardShortcutHelper::shortcutUpdated( const QVariant& value )
void
KeyboardShortcutHelper::shortcutUpdated( const QVariant& value )
{
if ( m_action == NULL )
setKey( QKeySequence( value.toString() ) );
......
......@@ -37,7 +37,7 @@ TagWidget::TagWidget( QWidget *parent, int nbButton, QStringList tagList ) :
m_currentClip( NULL )
{
m_ui->setupUi( this );
m_defaultTagList << "OutDoor" << "Hollidays" << "Seaside" << "Sunset" << "Familly";
m_defaultTagList << "Outdoor" << "Holiday" << "Seaside" << "Sunset" << "Family";
for( int i = 0; i < m_defaultTagList.count(); i++ )
{
......@@ -55,7 +55,8 @@ TagWidget::~TagWidget()
delete m_ui;
}
void TagWidget::clipSelected( Clip* clip )
void
TagWidget::clipSelected( Clip* clip )
{
m_currentClip = clip;
setTagTextEdit();
......@@ -72,7 +73,8 @@ void TagWidget::clipSelected( Clip* clip )
connect( clip, SIGNAL( destroyed() ), this, SLOT( clipDestroyed() ) );
}
void TagWidget::setMetaTags()
void
TagWidget::setMetaTags()
{
if ( m_currentClip != NULL )
{
......@@ -81,7 +83,8 @@ void TagWidget::setMetaTags()
}
}
void TagWidget:: buttonTagClicked()
void
TagWidget:: buttonTagClicked()
{
if ( m_currentClip != NULL )
{
......@@ -99,7 +102,8 @@ void TagWidget:: buttonTagClicked()
}
}
void TagWidget::setTagTextEdit()
void
TagWidget::setTagTextEdit()
{
QString tags;
if ( m_currentClip != NULL )
......@@ -116,7 +120,8 @@ void TagWidget::setTagTextEdit()
}
}
void TagWidget::setButtonList( QStringList tagList )
void
TagWidget::setButtonList( QStringList tagList )
{
if ( m_currentClip != NULL )
{
......@@ -128,7 +133,8 @@ void TagWidget::setButtonList( QStringList tagList )
}
}
void TagWidget::changeEvent( QEvent *e )
void
TagWidget::changeEvent( QEvent *e )
{
QWidget::changeEvent( e );
switch ( e->type() )
......
......@@ -54,22 +54,26 @@ ListViewController::~ListViewController()
// ViewController method implementation
const QString& ListViewController::title() const
const QString&
ListViewController::title() const
{
return m_title;
}
QWidget* ListViewController::view() const
QWidget*
ListViewController::view() const
{
return m_scrollArea;
}
void ListViewController::addCell( QWidget* cell )
void
ListViewController::addCell( QWidget* cell )
{
m_layout->addWidget( cell );
}
void ListViewController::removeCell( QWidget* cell )
void
ListViewController::removeCell( QWidget* cell )
{
m_layout->removeWidget( cell );
delete cell;
......
......@@ -166,8 +166,8 @@ MediaCellView::setThumbnail( const QPixmap &pixmap )
m_ui->thumbnail->setPixmap( pixmap.scaled( 64, 64, Qt::KeepAspectRatio ) );
}
const
QPixmap* MediaCellView::getThumbnail() const
const QPixmap*
MediaCellView::getThumbnail() const
{
return m_ui->thumbnail->pixmap();
}
......
......@@ -42,7 +42,8 @@ StackViewController::~StackViewController()
delete m_controllerStack;
}
void StackViewController::pushViewController( ViewController* viewController,
void
StackViewController::pushViewController( ViewController* viewController,
bool animated )
{
animated = false;
......
......@@ -30,7 +30,7 @@
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
<string>Media List</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
......
......@@ -30,7 +30,8 @@ LCDTimecode::LCDTimecode( QWidget* parent )
setTime( 0, 0, 0, 0 );
}
void LCDTimecode::setTime( int hours, int minutes, int seconds, int frames )
void
LCDTimecode::setTime( int hours, int minutes, int seconds, int frames )
{
QString s = QString("%1:%2:%3.%4")
.arg( QString::number( hours ), 2, '0' )
......
......@@ -38,7 +38,8 @@ PreviewRuler::PreviewRuler( QWidget* parent ) :
m_markerStop = MARKER_DEFAULT;
}
void PreviewRuler::setRenderer( GenericRenderer* renderer )
void
PreviewRuler::setRenderer( GenericRenderer* renderer )
{
if ( m_renderer )
{
......@@ -54,7 +55,8 @@ void PreviewRuler::setRenderer( GenericRenderer* renderer )
this, SLOT( clear() ) );
}
void PreviewRuler::paintEvent( QPaintEvent * event )
void
PreviewRuler::paintEvent( QPaintEvent * event )
{
Q_UNUSED( event );
Q_ASSERT( m_renderer );
......@@ -190,7 +192,8 @@ void PreviewRuler::paintEvent( QPaintEvent * event )
painter.drawPolygon( cursor );
}
void PreviewRuler::mousePressEvent( QMouseEvent* event )
void
PreviewRuler::mousePressEvent( QMouseEvent* event )
{
m_isSliding = true;
if ( m_renderer->length() > 0 )
......@@ -199,7 +202,8 @@ void PreviewRuler::mousePressEvent( QMouseEvent* event )
}
}
void PreviewRuler::mouseMoveEvent( QMouseEvent* event )
void
PreviewRuler::mouseMoveEvent( QMouseEvent* event )
{
if ( m_isSliding )
{
......@@ -212,12 +216,14 @@ void PreviewRuler::mouseMoveEvent( QMouseEvent* event )
}
}
void PreviewRuler::mouseReleaseEvent( QMouseEvent* )
void
PreviewRuler::mouseReleaseEvent( QMouseEvent* )
{
m_isSliding = false;
}
void PreviewRuler::setFrame( qint64 frame, bool broadcastEvent /*= false*/ )
void
PreviewRuler::setFrame( qint64 frame, bool broadcastEvent /*= false*/ )
{
m_frame = frame;
if ( m_isSliding && broadcastEvent == true )
......@@ -227,7 +233,8 @@ void PreviewRuler::setFrame( qint64 frame, bool broadcastEvent /*= false*/ )
update();
}
void PreviewRuler::updateTimecode( qint64 frames /*= -1*/ )
void
PreviewRuler::updateTimecode( qint64 frames /*= -1*/ )
{
if ( m_renderer->length() > 0 )
{
......@@ -252,7 +259,8 @@ void PreviewRuler::updateTimecode( qint64 frames /*= -1*/ )
}
}
void PreviewRuler::setMarker( Marker m )
void
PreviewRuler::setMarker( Marker m )
{
if ( m == Start )
m_markerStart = m_frame;
......@@ -261,7 +269,8 @@ void PreviewRuler::setMarker( Marker m )
update();
}
qint64 PreviewRuler::getMarker( Marker m ) const
qint64
PreviewRuler::getMarker( Marker m ) const
{
return ( m == Start ? m_markerStart : m_markerStop );
}
......@@ -275,7 +284,8 @@ PreviewRuler::hideMarker( Marker m )
m_markerStop = -1;
}
void PreviewRuler::clear()
void
PreviewRuler::clear()
{
m_markerStart = MARKER_DEFAULT;
m_markerStop = MARKER_DEFAULT;
......
......@@ -45,7 +45,8 @@ KeyboardShortcutInput::KeyboardShortcutInput( const QString& name,
setMaximumWidth( 300 );
}
void KeyboardShortcutInput::mousePressEvent( QMouseEvent* )
void
KeyboardShortcutInput::mousePressEvent( QMouseEvent* )
{
m_capturing = true;
setDown( true );
......@@ -55,7 +56,8 @@ void KeyboardShortcutInput::mousePressEvent( QMouseEvent* )
setText( "" );
}
void KeyboardShortcutInput::mouseReleaseEvent( QMouseEvent* )
void
KeyboardShortcutInput::mouseReleaseEvent( QMouseEvent* )
{
}
......@@ -66,7 +68,8 @@ KeyboardShortcutInput::shortcut() const
return seq.toString();
}
void KeyboardShortcutInput::release()
void
KeyboardShortcutInput::release()
{
QKeySequence seq( m_shortcuts[0], m_shortcuts[1], m_shortcuts[2], m_shortcuts[3] );
......@@ -75,13 +78,15 @@ void KeyboardShortcutInput::release()
setText( seq.toString() );
}
void KeyboardShortcutInput::cancel()
void
KeyboardShortcutInput::cancel()
{
memcpy( m_shortcuts, m_initialValue, 4 * sizeof(int) );
release();
}
void KeyboardShortcutInput::keyPressEvent( QKeyEvent* e )
void
KeyboardShortcutInput::keyPressEvent( QKeyEvent* e )
{
if ( m_capturing == false )
{
......@@ -112,7 +117,8 @@ void KeyboardShortcutInput::keyPressEvent( QKeyEvent* e )
}
}
void KeyboardShortcutInput::timeout()
void
KeyboardShortcutInput::timeout()
{
release();
}
......@@ -52,7 +52,8 @@ Panel::Panel( QWidget* parent ) : QWidget( parent )
QSizePolicy::Expanding );
}
void Panel::addButton( const char* name,
void
Panel::addButton( const char* name,
const QIcon& icon,
int index )
{
......
......@@ -67,7 +67,8 @@ AbstractGraphicsMediaItem::~AbstractGraphicsMediaItem()
ungroup();
}
void AbstractGraphicsMediaItem::contextMenuEvent( QGraphicsSceneContextMenuEvent* event )
void
AbstractGraphicsMediaItem::contextMenuEvent( QGraphicsSceneContextMenuEvent* event )
{
if ( !tracksView() )
return;
......
......@@ -45,18 +45,21 @@ GraphicsCursorItem::GraphicsCursorItem( const QPen& pen ) :
m_boundingRect = QRectF( -2, 0, 3, 0 );
}
QRectF GraphicsCursorItem::boundingRect() const
QRectF
GraphicsCursorItem::boundingRect() const
{
return m_boundingRect;
}
void GraphicsCursorItem::paint( QPainter* painter, const QStyleOptionGraphicsItem*, QWidget* )
void
GraphicsCursorItem::paint( QPainter* painter, const QStyleOptionGraphicsItem*, QWidget* )
{
painter->setPen( m_pen );
painter->drawLine( 0, 0, 0, m_boundingRect.height() );
}
QVariant GraphicsCursorItem::itemChange( GraphicsItemChange change, const QVariant& value )
QVariant
GraphicsCursorItem::itemChange( GraphicsItemChange change, const QVariant& value )
{
//Position is changing :
if ( change == QGraphicsItem::ItemPositionChange )
......@@ -80,7 +83,8 @@ QVariant GraphicsCursorItem::itemChange( GraphicsItemChange change, const QVaria
return QGraphicsItem::itemChange( change, value );
}
void GraphicsCursorItem::mousePressEvent( QGraphicsSceneMouseEvent* event )
void
GraphicsCursorItem::mousePressEvent( QGraphicsSceneMouseEvent* event )
{
m_mouseDown = true;
......@@ -88,7 +92,8 @@ void GraphicsCursorItem::mousePressEvent( QGraphicsSceneMouseEvent* event )
QGraphicsItem::mousePressEvent( event );
}
void GraphicsCursorItem::mouseReleaseEvent( QGraphicsSceneMouseEvent* event )
void
GraphicsCursorItem::mouseReleaseEvent( QGraphicsSceneMouseEvent* event )
{
m_mouseDown = false;
......@@ -96,7 +101,8 @@ void GraphicsCursorItem::mouseReleaseEvent( QGraphicsSceneMouseEvent* event )
QGraphicsItem::mouseReleaseEvent( event );
}
void GraphicsCursorItem::frameChanged( qint64 newFrame, Vlmc::FrameChangedReason reason )
void
GraphicsCursorItem::frameChanged( qint64 newFrame, Vlmc::FrameChangedReason reason )
{
if ( reason != Vlmc::TimelineCursor )
{
......@@ -104,7 +110,8 @@ void GraphicsCursorItem::frameChanged( qint64 newFrame, Vlmc::FrameChangedReason
}
}
void GraphicsCursorItem::setHeight( int height )
void
GraphicsCursorItem::setHeight( int height )
{
prepareGeometryChange();
m_boundingRect.setHeight( height );
......
......@@ -65,7 +65,8 @@ Workflow::TrackType GraphicsMovieItem::trackType() const
return Workflow::VideoTrack;
}
void GraphicsMovieItem::paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* )
void
GraphicsMovieItem::paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* )
{
painter->save();
paintRect( painter, option );
......@@ -76,7 +77,8 @@ void GraphicsMovieItem::paint( QPainter* painter, const QStyleOptionGraphicsItem
painter->restore();
}
void GraphicsMovieItem::paintRect( QPainter* painter, const QStyleOptionGraphicsItem* option )
void
GraphicsMovieItem::paintRect( QPainter* painter, const QStyleOptionGraphicsItem* option )
{
QRectF drawRect;
bool drawRound;
......@@ -148,7 +150,8 @@ void GraphicsMovieItem::paintRect( QPainter* painter, const QStyleOptionGraphics
setZValue( zNotSelected() );
}
void GraphicsMovieItem::paintTitle( QPainter* painter, const QStyleOptionGraphicsItem* option )
void
GraphicsMovieItem::paintTitle( QPainter* painter, const QStyleOptionGraphicsItem* option )
{
Q_UNUSED( option );
......
......@@ -129,7 +129,7 @@ EmphasizedTrackItem::EmphasizedTrackItem( GraphicsTrack *parent, qreal width, qr
{
}
QRectF
QRectF
EmphasizedTrackItem::boundingRect() const
{
return QRectF( 0, 0, m_width, m_height );
......@@ -138,6 +138,6 @@ EmphasizedTrackItem::boundingRect() const
void
EmphasizedTrackItem::paint(QPainter *painter, const QStyleOptionGraphicsItem* , QWidget* )
{
painter->setBrush( QBrush( Qt::darkBlue ));
painter->setBrush( QBrush( Qt::darkBlue ) );
painter->drawRect( boundingRect() );
}
......@@ -69,7 +69,6 @@ Timeline::Timeline( WorkflowRenderer* renderer, QWidget *parent ) :
m_ui.controlsFrame->setLayout( tracksControlsLayout );
tracksControlsLayout->addWidget( m_tracksControls );
changeZoom( 10 );
setDuration( 0 );
......@@ -119,7 +118,8 @@ Timeline::~Timeline()
MainWorkflow::destroyInstance();
}
void Timeline::changeEvent( QEvent *e )
void
Timeline::changeEvent( QEvent *e )
{
switch ( e->type() )
{
......@@ -131,26 +131,30 @@ void Timeline::changeEvent( QEvent *e )
}
}
void Timeline::clear()
void
Timeline::clear()
{
// The main workflow will ask the GUI to clear itself.
m_mainWorkflow->clear();
}
void Timeline::changeZoom( int factor )
void
Timeline::changeZoom( int factor )
{
m_tracksRuler->setPixelPerMark( factor );
m_scale = (double) FRAME_SIZE / m_tracksRuler->comboScale[factor];
m_tracksView->setScale( m_scale );
}
void Timeline::setDuration( int duration )
void
Timeline::setDuration( int duration )
{
m_tracksView->setDuration( duration );
m_tracksRuler->setDuration( duration );
}
void Timeline::setTool( ToolButtons button )
void
Timeline::setTool( ToolButtons button )
{
tracksView()->setTool( button );
}
......
......@@ -53,7 +53,8 @@ TracksControls::TracksControls( QWidget* parent )
setWidget( m_centralWidget );
}
void TracksControls::addVideoTrack( GraphicsTrack* track )
void
TracksControls::addVideoTrack( GraphicsTrack* track )
{
TrackControls* item = new TrackControls( track, m_centralWidget );
item->setMinimumWidth( 108 );
......@@ -62,7 +63,8 @@ void TracksControls::addVideoTrack( GraphicsTrack* track )
m_layout->insertWidget( 0, item );
}
void TracksControls::addAudioTrack( GraphicsTrack* track )
void
TracksControls::addAudioTrack( GraphicsTrack* track )
{
TrackControls* item = new TrackControls( track, m_centralWidget );
item->setMinimumWidth( 108 );
......@@ -71,7 +73,8 @@ void TracksControls::addAudioTrack( GraphicsTrack* track )
m_layout->insertWidget( -1, item );
}
void TracksControls::removeVideoTrack()
void
TracksControls::removeVideoTrack()
{
QLayoutItem* item = m_layout->takeAt( 0 );
if ( item->widget() )
......@@ -83,7 +86,8 @@ void TracksControls::removeVideoTrack()
m_centralWidget->setGeometry( 0, 0, 1, 1 );
}
void TracksControls::removeAudioTrack()
void
TracksControls::removeAudioTrack()
{
QLayoutItem* item = m_layout->takeAt( m_layout->count() - 1 );
if ( item->widget() )
......@@ -95,7 +99,8 @@ void TracksControls::removeAudioTrack()
m_centralWidget->setGeometry( 0, 0, 1, 1 );
}
void TracksControls::clear()
void
TracksControls::clear()
{
m_layout->removeWidget( m_separator );
QLayoutItem* child;
......
......@@ -52,7 +52,8 @@ TracksRuler::TracksRuler( TracksView* tracksView, QWidget* parent )
this, SLOT( update() ) );
}
void TracksRuler::setPixelPerMark( double rate )
void
TracksRuler::setPixelPerMark( double rate )
{
int scale = comboScale[ ( int )rate ];
m_factor = 1.0 / ( double ) scale * FRAME_SIZE;
......@@ -95,7 +96,8 @@ void TracksRuler::setPixelPerMark( double rate )
update();
}
void TracksRuler::setDuration( int duration )
void
TracksRuler::setDuration( int duration )
{
int oldDuration = m_duration;
m_duration = duration;
......@@ -109,7 +111,8 @@ void TracksRuler::setDuration( int duration )
update();
}
void TracksRuler::paintEvent( QPaintEvent* e )
void
TracksRuler::paintEvent( QPaintEvent* e )
{
QStylePainter painter( this );
painter.setClipRect( e->rect() );
......@@ -136,7 +139,6 @@ void TracksRuler::paintEvent( QPaintEvent* e )
painter.drawText( ( int )f - m_offset + 2, LABEL_SIZE + 1, time );
}
// Draw the marks
offsetMin = ( e->rect().left() + m_offset ) / m_littleMarkDistance;
offsetMin = offsetMin * m_littleMarkDistance;
......@@ -167,7 +169,8 @@ void TracksRuler::paintEvent( QPaintEvent* e )
painter.drawPolygon( cursor );
}
void TracksRuler::mousePressEvent( QMouseEvent* event )
void
TracksRuler::mousePressEvent( QMouseEvent* event )
{
if ( event->buttons() == Qt::LeftButton &&
event->modifiers() == Qt::NoModifier )
......@@ -176,7 +179,8 @@ void TracksRuler::mousePressEvent( QMouseEvent* event )
}
}
void TracksRuler::mouseMoveEvent( QMouseEvent* event )
void
TracksRuler::mouseMoveEvent( QMouseEvent* event )
{
if ( event->buttons() == Qt::LeftButton &&
event->modifiers() == Qt::NoModifier )
......@@ -185,13 +189,15 @@ void TracksRuler::mouseMoveEvent( QMouseEvent* event )
}
}
void TracksRuler::moveRuler( int pos )
void
TracksRuler::moveRuler( int pos )
{
m_offset = pos;
update();
}
QString TracksRuler::getTimeCode( int frames ) const
QString
TracksRuler::getTimeCode( int frames ) const
{
int seconds = frames / m_fps;
frames = frames % m_fps;
......
......@@ -42,7 +42,8 @@ TracksScene::TracksScene( QObject* parent ) : QGraphicsScene( parent )
{
}
void TracksScene::keyPressEvent( QKeyEvent* keyEvent )
void
TracksScene::keyPressEvent( QKeyEvent* keyEvent )
{
TracksView* tv = Timeline::getInstance()->tracksView();
if ( !tv ) return;
......@@ -59,7 +60,8 @@ void TracksScene::keyPressEvent( QKeyEvent* keyEvent )
QGraphicsScene::keyPressEvent( keyEvent );
}
void TracksScene::contextMenuEvent( QGraphicsSceneContextMenuEvent* event )
void
TracksScene::contextMenuEvent( QGraphicsSceneContextMenuEvent* event )
{
QGraphicsScene::contextMenuEvent( event );
if ( event->isAccepted() )
......
......@@ -60,7 +60,8 @@ CrashHandler::~CrashHandler()
delete ui;
}
void CrashHandler::changeEvent(QEvent *e)
void
CrashHandler::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch ( e->type() )
......@@ -73,12 +74,14 @@ void CrashHandler::changeEvent(QEvent *e)
}
}
void CrashHandler::close()
void
CrashHandler::close()
{
done(1);
}
void CrashHandler::restart()
void
CrashHandler::restart()
{
done(2);
}
......@@ -37,7 +37,8 @@ OpenPage::OpenPage( QWidget *parent ) :
setFinalPage( true );
}
void OpenPage::changeEvent( QEvent *e )
void
OpenPage::changeEvent( QEvent *e )
{
QWizardPage::changeEvent( e );
switch ( e->type() ) {
......@@ -49,7 +50,8 @@ void OpenPage::changeEvent( QEvent *e )
}
}
bool OpenPage::validatePage()
bool
OpenPage::validatePage()
{
ProjectManager* pm = GUIProjectManager::getInstance();
......@@ -59,7 +61,8 @@ bool OpenPage::validatePage()
return true;
}
int OpenPage::nextId() const
int
OpenPage::nextId() const
{
// This an ending page
return -1;
......
......@@ -75,7 +75,8 @@ ProjectWizard::~ProjectWizard()
{
}
void ProjectWizard::showHelp()
void
ProjectWizard::showHelp()
{
QString message;
......@@ -91,7 +92,8 @@ void ProjectWizard::showHelp()
QMessageBox::information( this, tr( "Project wizard help" ), message );
}
void ProjectWizard::accept()
void
ProjectWizard::accept()
{
//This intend to check if the user opened a project, or created one.
//If he was creating a project, the current page will be the video/audio settings one.
......@@ -110,7 +112,8 @@ void ProjectWizard::accept()
QDialog::accept();
}
void ProjectWizard::reject()
void
ProjectWizard::reject()
{
QDialog::reject();
}
......@@ -24,7 +24,8 @@
int VLMCmain( int, char** );
LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *)
LONG WINAPI
vlc_exception_filter(struct _EXCEPTION_POINTERS *)
{
if(IsDebuggerPresent())
{
......@@ -36,7 +37,8 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *)
return 0;