Commit 8a61b418 authored by Hugo Pereira Da Costa's avatar Hugo Pereira Da Costa

partial update to c++11

- use auto
- use override
- added some std::initializer_list
parent 629b0698
......@@ -11,6 +11,14 @@ if(BREEZE_USE_KDE4)
endif()
# do not warn on deprecated calls. this is because we need to still support QT4 compilation
# which uses many classes deprecated in QT5
if(NOT BREEZE_USE_KDE4)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
endif()
################# Qt/KDE #################
if(BREEZE_USE_KDE4)
......
......@@ -43,14 +43,14 @@ namespace Breeze
{ setDuration( duration ); }
//* destructor
virtual ~Animation( void ) = default;
virtual ~Animation() = default;
//* true if running
bool isRunning( void ) const
bool isRunning() const
{ return state() == Animation::Running; }
//* restart
void restart( void )
void restart()
{
if( isRunning() ) stop();
start();
......
......@@ -47,7 +47,7 @@ namespace Breeze
{ Q_ASSERT( _target ); }
//* destructor
virtual ~AnimationData( void )
virtual ~AnimationData()
{}
//* duration
......@@ -58,7 +58,7 @@ namespace Breeze
{ _steps = value; }
//* enability
virtual bool enabled( void ) const
virtual bool enabled() const
{ return _enabled; }
//* enability
......@@ -66,7 +66,7 @@ namespace Breeze
{ _enabled = value; }
//* target
const WeakPointer<QWidget>& target( void ) const
const WeakPointer<QWidget>& target() const
{ return _target; }
//* invalid opacity
......@@ -85,7 +85,7 @@ namespace Breeze
}
//* trigger target update
virtual void setDirty( void ) const
virtual void setDirty() const
{ if( _target ) _target.data()->update(); }
private:
......
......@@ -61,7 +61,7 @@ namespace Breeze
}
//____________________________________________________________
void Animations::setupEngines( void )
void Animations::setupEngines()
{
// animation steps
......
......@@ -47,10 +47,6 @@ namespace Breeze
//* constructor
explicit Animations( QObject* );
//* destructor
virtual ~Animations( void )
{}
//* register animations corresponding to given widget, depending on its type.
void registerWidget( QWidget* widget ) const;
......@@ -58,55 +54,55 @@ namespace Breeze
void unregisterWidget( QWidget* widget ) const;
//* enability engine
WidgetStateEngine& widgetEnabilityEngine( void ) const
WidgetStateEngine& widgetEnabilityEngine() const
{ return *_widgetEnabilityEngine; }
//* abstractButton engine
WidgetStateEngine& widgetStateEngine( void ) const
WidgetStateEngine& widgetStateEngine() const
{ return *_widgetStateEngine; }
//* editable combobox arrow hover engine
WidgetStateEngine& comboBoxEngine( void ) const
WidgetStateEngine& comboBoxEngine() const
{ return *_comboBoxEngine; }
//! Tool buttons arrow hover engine
WidgetStateEngine& toolButtonEngine( void ) const
//* Tool buttons arrow hover engine
WidgetStateEngine& toolButtonEngine() const
{ return *_toolButtonEngine; }
//! item view engine
WidgetStateEngine& inputWidgetEngine( void ) const
//* item view engine
WidgetStateEngine& inputWidgetEngine() const
{ return *_inputWidgetEngine; }
//* busy indicator
BusyIndicatorEngine& busyIndicatorEngine( void ) const
BusyIndicatorEngine& busyIndicatorEngine() const
{ return *_busyIndicatorEngine; }
//* header view engine
HeaderViewEngine& headerViewEngine( void ) const
HeaderViewEngine& headerViewEngine() const
{ return *_headerViewEngine; }
//* scrollbar engine
ScrollBarEngine& scrollBarEngine( void ) const
ScrollBarEngine& scrollBarEngine() const
{ return *_scrollBarEngine; }
//* dial engine
DialEngine& dialEngine( void ) const
DialEngine& dialEngine() const
{ return *_dialEngine; }
//* spinbox engine
SpinBoxEngine& spinBoxEngine( void ) const
SpinBoxEngine& spinBoxEngine() const
{ return *_spinBoxEngine; }
//* tabbar
TabBarEngine& tabBarEngine( void ) const
TabBarEngine& tabBarEngine() const
{ return *_tabBarEngine; }
//* toolbox
ToolBoxEngine& toolBoxEngine( void ) const
ToolBoxEngine& toolBoxEngine() const
{ return *_toolBoxEngine; }
//* setup engines
void setupEngines( void );
void setupEngines();
protected Q_SLOTS:
......@@ -115,46 +111,46 @@ namespace Breeze
private:
//* register new engine
void registerEngine( BaseEngine* engine );
void registerEngine( BaseEngine* );
//* busy indicator
BusyIndicatorEngine* _busyIndicatorEngine;
BusyIndicatorEngine* _busyIndicatorEngine = nullptr;
//* headerview hover effect
HeaderViewEngine* _headerViewEngine;
HeaderViewEngine* _headerViewEngine = nullptr;
//* widget enability engine
WidgetStateEngine* _widgetEnabilityEngine;
WidgetStateEngine* _widgetEnabilityEngine = nullptr;
//* abstract button engine
WidgetStateEngine* _widgetStateEngine;
WidgetStateEngine* _widgetStateEngine = nullptr;
//* editable combobox arrow hover effect
WidgetStateEngine* _comboBoxEngine;
WidgetStateEngine* _comboBoxEngine = nullptr;
//! mennu toolbutton arrow hover effect
WidgetStateEngine* _toolButtonEngine;
//* mennu toolbutton arrow hover effect
WidgetStateEngine* _toolButtonEngine = nullptr;
//! item view engine
WidgetStateEngine* _inputWidgetEngine;
//* item view engine
WidgetStateEngine* _inputWidgetEngine = nullptr;
//* scrollbar engine
ScrollBarEngine* _scrollBarEngine;
ScrollBarEngine* _scrollBarEngine = nullptr;
//* dial engine
DialEngine* _dialEngine;
DialEngine* _dialEngine = nullptr;
//* spinbox engine
SpinBoxEngine* _spinBoxEngine;
SpinBoxEngine* _spinBoxEngine = nullptr;
//* stacked widget engine
StackedWidgetEngine* _stackedWidgetEngine;
StackedWidgetEngine* _stackedWidgetEngine = nullptr;
//* tabbar engine
TabBarEngine* _tabBarEngine;
TabBarEngine* _tabBarEngine = nullptr;
//* toolbar engine
ToolBoxEngine* _toolBoxEngine;
ToolBoxEngine* _toolBoxEngine = nullptr;
//* keep list of existing engines
QList< BaseEngine::Pointer > _engines;
......
......@@ -47,7 +47,7 @@ namespace Breeze
{}
//* destructor
virtual ~BaseEngine( void )
virtual ~BaseEngine()
{}
//* enability
......@@ -55,7 +55,7 @@ namespace Breeze
{ _enabled = value; }
//* enability
virtual bool enabled( void ) const
virtual bool enabled() const
{ return _enabled; }
//* duration
......@@ -63,7 +63,7 @@ namespace Breeze
{ _duration = value; }
//* duration
virtual int duration( void ) const
virtual int duration() const
{ return _duration; }
//* unregister widget
......@@ -73,7 +73,7 @@ namespace Breeze
using WidgetList = QSet<QWidget*>;
//* returns registered widgets
virtual WidgetList registeredWidgets( void ) const
virtual WidgetList registeredWidgets() const
{ return WidgetList(); }
private:
......
......@@ -39,14 +39,14 @@ namespace Breeze
{}
//* destructor
virtual ~BusyIndicatorData( void )
virtual ~BusyIndicatorData()
{}
//*@name accessors
//@{
//* animated
bool isAnimated( void ) const
bool isAnimated() const
{ return _animated; }
//@}
......
......@@ -43,7 +43,7 @@ namespace Breeze
explicit BusyIndicatorEngine( QObject* );
//* destructor
virtual ~BusyIndicatorEngine( void )
virtual ~BusyIndicatorEngine()
{}
//*@name accessors
......@@ -53,7 +53,7 @@ namespace Breeze
virtual bool isAnimated( const QObject* );
//* value
virtual int value( void ) const
virtual int value() const
{ return _value; }
//@}
......
......@@ -40,14 +40,14 @@ namespace Breeze
using Value = WeakPointer<T>;
//* constructor
BaseDataMap( void ):
BaseDataMap():
QMap<Key, Value>(),
_enabled( true ),
_lastKey( NULL )
{}
//* destructor
virtual ~BaseDataMap( void )
virtual ~BaseDataMap()
{}
//* insertion
......@@ -109,7 +109,7 @@ namespace Breeze
}
//* enability
bool enabled( void ) const
bool enabled() const
{ return _enabled; }
//* duration
......@@ -139,11 +139,11 @@ namespace Breeze
public:
//* constructor
DataMap( void )
DataMap()
{}
//* destructor
virtual ~DataMap( void )
virtual ~DataMap()
{}
};
......@@ -155,11 +155,11 @@ namespace Breeze
public:
//* constructor
PaintDeviceDataMap( void )
PaintDeviceDataMap()
{}
//* destructor
virtual ~PaintDeviceDataMap( void )
virtual ~PaintDeviceDataMap()
{}
};
......
......@@ -37,7 +37,7 @@ namespace Breeze
DialData( QObject* parent, QWidget* target, int );
//* destructor
virtual ~DialData( void )
virtual ~DialData()
{}
//* event filter
......@@ -48,7 +48,7 @@ namespace Breeze
{ _handleRect = rect; }
//* mouse position
QPoint position( void ) const
QPoint position() const
{ return _position; }
protected:
......
......@@ -40,7 +40,7 @@ namespace Breeze
{}
//* destructor
virtual ~DialEngine( void )
virtual ~DialEngine()
{}
//* register dial
......
......@@ -39,7 +39,7 @@ namespace Breeze
{ target->installEventFilter( this ); }
//* destructor
virtual ~EnableData( void )
virtual ~EnableData()
{}
//* event filter
......
......@@ -44,7 +44,7 @@ namespace Breeze
GenericData( QObject* parent, QWidget* widget, int duration );
//* destructor
virtual ~GenericData( void )
virtual ~GenericData()
{}
//* return animation object
......@@ -56,7 +56,7 @@ namespace Breeze
{ _animation.data()->setDuration( duration ); }
//* opacity
virtual qreal opacity( void ) const
virtual qreal opacity() const
{ return _opacity; }
//* opacity
......
......@@ -146,7 +146,7 @@ namespace Breeze
//__________________________________________________________
void HeaderViewData::setDirty( void ) const
void HeaderViewData::setDirty() const
{
QHeaderView* header = qobject_cast<QHeaderView*>( target().data() );
if( !header ) return;
......
......@@ -42,7 +42,7 @@ namespace Breeze
HeaderViewData( QObject* parent, QWidget* target, int duration );
//* destructor
virtual ~HeaderViewData( void )
virtual ~HeaderViewData()
{}
//* duration
......@@ -59,7 +59,7 @@ namespace Breeze
//@{
//* current opacity
virtual qreal currentOpacity( void ) const
virtual qreal currentOpacity() const
{ return _current._opacity; }
//* current opacity
......@@ -72,7 +72,7 @@ namespace Breeze
}
//* current index
virtual int currentIndex( void ) const
virtual int currentIndex() const
{ return _current._index; }
//* current index
......@@ -80,7 +80,7 @@ namespace Breeze
{ _current._index = index; }
//* current index animation
virtual const Animation::Pointer& currentIndexAnimation( void ) const
virtual const Animation::Pointer& currentIndexAnimation() const
{ return _current._animation; }
//@}
......@@ -89,7 +89,7 @@ namespace Breeze
//@{
//* previous opacity
virtual qreal previousOpacity( void ) const
virtual qreal previousOpacity() const
{ return _previous._opacity; }
//* previous opacity
......@@ -102,7 +102,7 @@ namespace Breeze
}
//* previous index
virtual int previousIndex( void ) const
virtual int previousIndex() const
{ return _previous._index; }
//* previous index
......@@ -110,7 +110,7 @@ namespace Breeze
{ _previous._index = index; }
//* previous index Animation
virtual const Animation::Pointer& previousIndexAnimation( void ) const
virtual const Animation::Pointer& previousIndexAnimation() const
{ return _previous._animation; }
//@}
......@@ -124,7 +124,7 @@ namespace Breeze
protected:
//* dirty
virtual void setDirty( void ) const;
virtual void setDirty() const;
private:
......@@ -134,7 +134,7 @@ namespace Breeze
public:
//* default constructor
Data( void ):
Data():
_opacity(0),
_index(-1)
{}
......
......@@ -41,7 +41,7 @@ namespace Breeze
{}
//* destructor
virtual ~HeaderViewEngine( void )
virtual ~HeaderViewEngine()
{}
//* register headerview
......
......@@ -42,7 +42,7 @@ namespace Breeze
ScrollBarData( QObject* parent, QWidget* target, int );
//* destructor
virtual ~ScrollBarData( void )
virtual ~ScrollBarData()
{}
//* event filter
......@@ -120,7 +120,7 @@ namespace Breeze
}
//* addLine opacity
virtual qreal addLineOpacity( void ) const
virtual qreal addLineOpacity() const
{ return _addLineData._opacity; }
//* subLine opacity
......@@ -133,7 +133,7 @@ namespace Breeze
}
//* subLine opacity
virtual qreal subLineOpacity( void ) const
virtual qreal subLineOpacity() const
{ return _subLineData._opacity; }
//* groove opacity
......@@ -146,24 +146,24 @@ namespace Breeze
}
//* groove opacity
virtual qreal grooveOpacity( void ) const
virtual qreal grooveOpacity() const
{ return _grooveData._opacity; }
//* mouse position
QPoint position( void ) const
QPoint position() const
{ return _position; }
protected Q_SLOTS:
//* clear addLineRect
void clearAddLineRect( void )
void clearAddLineRect()
{
if( addLineAnimation().data()->direction() == Animation::Backward )
{ _addLineData._rect = QRect(); }
}
//* clear subLineRect
void clearSubLineRect( void )
void clearSubLineRect()
{
if( subLineAnimation().data()->direction() == Animation::Backward )
{ _subLineData._rect = QRect(); }
......@@ -180,19 +180,19 @@ namespace Breeze
//*@name hover flags
//@{
virtual bool addLineArrowHovered( void ) const
virtual bool addLineArrowHovered() const
{ return _addLineData._hovered; }
virtual void setAddLineArrowHovered( bool value )
{ _addLineData._hovered = value; }
virtual bool subLineArrowHovered( void ) const
virtual bool subLineArrowHovered() const
{ return _subLineData._hovered; }
virtual void setSubLineArrowHovered( bool value )
{ _subLineData._hovered = value; }
virtual bool grooveHovered( void ) const
virtual bool grooveHovered() const
{ return _grooveData._hovered; }
virtual void setGrooveHovered( bool value )
......@@ -209,13 +209,13 @@ namespace Breeze
//*@name timelines
//@{
virtual const Animation::Pointer& addLineAnimation( void ) const
virtual const Animation::Pointer& addLineAnimation() const
{ return _addLineData._animation; }
virtual const Animation::Pointer& subLineAnimation( void ) const
virtual const Animation::Pointer& subLineAnimation() const
{ return _subLineData._animation; }
virtual const Animation::Pointer& grooveAnimation( void ) const
virtual const Animation::Pointer& grooveAnimation() const
{ return _grooveData._animation; }
private:
......@@ -227,7 +227,7 @@ namespace Breeze
public:
//* constructor
Data( void ):
Data():
_hovered( false ),
_opacity( AnimationData::OpacityInvalid )
{}
......
......@@ -40,7 +40,7 @@ namespace Breeze
{}
//* destructor
virtual ~ScrollBarEngine( void )
virtual ~ScrollBarEngine()
{}
//* register scrollbar
......
......@@ -43,7 +43,7 @@ namespace Breeze
SpinBoxData( QObject*, QWidget*, int );
//* destructor
virtual ~SpinBoxData( void )
virtual ~SpinBoxData()
{}
//* animation state
......@@ -81,7 +81,7 @@ namespace Breeze
//@{
//* opacity
qreal upArrowOpacity( void ) const
qreal upArrowOpacity() const
{ return _upArrowData._opacity; }
//* opacity
......@@ -94,7 +94,7 @@ namespace Breeze
}
//* animation
Animation::Pointer upArrowAnimation( void ) const
Animation::Pointer upArrowAnimation() const
{ return _upArrowData._animation; }
//@}
......@@ -103,7 +103,7 @@ namespace Breeze
//@{
//* opacity
qreal downArrowOpacity( void ) const
qreal downArrowOpacity() const
{ return _downArrowData._opacity; }
//* opacity
......@@ -116,7 +116,7 @@ namespace Breeze
}
//* animation
Animation::Pointer downArrowAnimation( void ) const
Animation::Pointer downArrowAnimation() const
{ return _downArrowData._animation; }
//@}
......@@ -130,7 +130,7 @@ namespace Breeze
public:
//* default constructor
Data( void ):
Data():
_state( false ),
_opacity(0)
{}
......
......@@ -41,7 +41,7 @@ namespace Breeze
{}
//* destructor
virtual ~SpinBoxEngine( void )
virtual ~SpinBoxEngine()
{}
//* register widget
......
......@@ -49,7 +49,7 @@ namespace Breeze
}
//___________________________________________________________________
bool StackedWidgetData::initializeAnimation( void )