Use nullptr consistently

parent a5760ca4
......@@ -77,7 +77,7 @@ AdjustSizeButton::AdjustSizeButton( QWidget *parent )
}
QEvent e( QEvent::Resize );
eventFilter( 0, &e );
eventFilter( nullptr, &e );
adjustSize();
show();
......
......@@ -25,9 +25,9 @@
#include <string.h>
FHT::FHT(int n) :
m_buf(0),
m_tab(0),
m_log(0)
m_buf(nullptr),
m_tab(nullptr),
m_log(nullptr)
{
if (n < 3) {
m_num = 0;
......
......@@ -34,7 +34,7 @@ class AudioView2 : public QWidget
Q_OBJECT
public:
explicit AudioView2(QWidget *parent = 0);
explicit AudioView2(QWidget *parent = nullptr);
~AudioView2() override;
void setupAnalyzer();
......
......@@ -82,31 +82,31 @@
namespace Dragon {
MainWindow *MainWindow::s_instance = 0;
MainWindow *MainWindow::s_instance = nullptr;
/// @see codeine.h
QWidget* mainWindow() { return MainWindow::s_instance; }
MainWindow::MainWindow()
: KXmlGuiWindow()
, m_mainView( 0 )
, m_audioView( 0 )
, m_mainView( nullptr )
, m_audioView( nullptr )
, m_loadView( new LoadView(this) )
, m_currentWidget( nullptr )
, m_leftDock( 0 )
, m_positionSlider( 0 )
, m_volumeSlider( 0 )
, m_timeLabel( 0 )
, m_leftDock( nullptr )
, m_positionSlider( nullptr )
, m_volumeSlider( nullptr )
, m_timeLabel( nullptr )
, m_titleLabel( new QLabel( this ) )
, m_playDialog( 0 )
, m_menuToggleAction( 0 )
, m_stopScreenSaver( 0 )
, m_playDialog( nullptr )
, m_menuToggleAction( nullptr )
, m_stopScreenSaver( nullptr )
, m_stopSleepCookie( -1 )
, m_stopScreenPowerMgmtCookie( -1 )
, m_profileMaxDays(30)
, m_toolbarIsHidden(false)
, m_statusbarIsHidden(false)
, m_menuBarIsHidden(false)
, m_FullScreenHandler( 0 )
, m_FullScreenHandler( nullptr )
{
s_instance = this;
setMouseTracking( true );
......@@ -143,7 +143,7 @@ MainWindow::MainWindow()
{
KActionCollection* ac = actionCollection();
KActionMenu *menuAction = 0;
KActionMenu *menuAction = nullptr;
#define make_menu( name, text ) \
menuAction = new KActionMenu( text, this ); \
menuAction->setObjectName( name ); \
......@@ -701,7 +701,7 @@ void
MainWindow::openRecentFile(const QUrl &url )
{
m_playDialog->deleteLater();
m_playDialog = 0;
m_playDialog = nullptr;
this->open( url );
}
......@@ -737,7 +737,7 @@ MainWindow::setFullScreen( bool isFullScreen )
action( "fullscreen" )->setEnabled( videoWindow()->state() == Phonon::PlayingState
|| videoWindow()->state() == Phonon::PausedState);
delete m_FullScreenHandler;
m_FullScreenHandler = 0;
m_FullScreenHandler = nullptr;
}
}
......@@ -861,7 +861,7 @@ MainWindow::releasePowerSave()
//stop disabling screensaver
delete m_stopScreenSaver; // It is always 0, I have been careful.
m_stopScreenSaver = 0;
m_stopScreenSaver = nullptr;
}
QMenu*
......@@ -920,8 +920,8 @@ actionCollection()
QAction*
action( const char *name )
{
KActionCollection *actionCollection = 0;
QAction *action = 0;
KActionCollection *actionCollection = nullptr;
QAction *action = nullptr;
if( mainWindow() )
if( ( actionCollection = ((MainWindow*)mainWindow() )->actionCollection() ) )
......
......@@ -48,7 +48,7 @@ namespace Dragon
Part::Part( QWidget* parentWidget, QObject* parent, const QList<QVariant>& /*args*/ )
: ReadOnlyPart( parent )
, m_statusBarExtension( new KParts::StatusBarExtension( this ) )
, m_playPause( 0 )
, m_playPause( nullptr )
{
KActionCollection * const ac = actionCollection();
......@@ -118,9 +118,9 @@ namespace Dragon
menu.exec( pos );
}
QAction *action( const char* /*actionName*/ ) { return 0; }
QAction *action( const char* /*actionName*/ ) { return nullptr; }
///fake mainWindow for VideoWindow
QWidget *mainWindow() { return 0; }
QWidget *mainWindow() { return nullptr; }
}
......
......@@ -29,14 +29,14 @@ namespace Dragon
PlayerApplication::PlayerApplication(int &argc, char **argv)
: QApplication(argc, argv)
, m_mainWindow(Q_NULLPTR)
, m_mainWindow(nullptr)
{
}
PlayerApplication::~PlayerApplication()
{
if (m_mainWindow) {
m_mainWindow = Q_NULLPTR;
m_mainWindow = nullptr;
delete m_mainWindow;
}
}
......
......@@ -74,7 +74,7 @@ using Phonon::MediaController;
namespace Dragon {
VideoWindow *VideoWindow::s_instance = 0;
VideoWindow *VideoWindow::s_instance = nullptr;
VideoWindow::VideoWindow( QWidget *parent )
: QWidget( parent )
......@@ -85,7 +85,7 @@ VideoWindow::VideoWindow( QWidget *parent )
, m_audioLanguages( new QActionGroup( this ) )
, m_logo( new QLabel( this ) )
, m_initialOffset( 0 )
, m_aDataOutput(0)
, m_aDataOutput(nullptr)
{
m_isPreview = false;
......
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