Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 18d852e2 authored by Laurent Montel's avatar Laurent Montel 😁

Add explicit + nullptr + override

parent 1941ae6c
......@@ -75,7 +75,7 @@ class KDEGAMES_EXPORT KgSound : public QObject
///expensive operation which you might want to do during application
///startup. However, you can reuse the same Sound instance for multiple
///playback events.
explicit KgSound(const QString& file, QObject* parent = 0);
explicit KgSound(const QString& file, QObject* parent = nullptr);
///Destroys this KgSound instance.
virtual ~KgSound();
......
......@@ -92,7 +92,7 @@ class KDEGAMES_EXPORT KHighscore : public QObject
* is convenient for converting highscores from legacy applications.
* @param parent parent widget for this widget
*/
explicit KHighscore(bool forceLocal=true, QObject *parent=0);
explicit KHighscore(bool forceLocal=true, QObject *parent=nullptr);
/**
* Read the current state of the highscore file. Remember that when
......@@ -128,7 +128,7 @@ class KDEGAMES_EXPORT KHighscore : public QObject
* @return false on error or if the config file is locked by another
* process. In such case, the config stays read-only.
*/
bool lockForWriting(QWidget *widget = 0);
bool lockForWriting(QWidget *widget = nullptr);
/**
* Effectively write and unlock the system-wide highscore file
......
......@@ -130,7 +130,7 @@ class KDEGAMES_EXPORT KScoreDialog : public QDialog
* @param fields Bitwise OR of the @ref Fields that should be listed (Score is always present)
* @param parent passed to parent QWidget constructor.
*/
explicit KScoreDialog(int fields=Name, QWidget *parent=0);
explicit KScoreDialog(int fields=Name, QWidget *parent=nullptr);
~KScoreDialog();
......
......@@ -41,7 +41,7 @@ public:
/**
* @return Constructor
*/
explicit KGameClock(QObject *parent = 0, ClockType clocktype = HourMinSec);
explicit KGameClock(QObject *parent = nullptr, ClockType clocktype = HourMinSec);
virtual ~KGameClock();
......
......@@ -40,7 +40,7 @@ class TextItemWithOpacity : public QGraphicsTextItem
Q_OBJECT
public:
TextItemWithOpacity( QGraphicsItem* parent = 0 )
TextItemWithOpacity( QGraphicsItem* parent = nullptr )
:QGraphicsTextItem(parent), m_opacity(1.0) {}
void setOpacity(qreal opa) { m_opacity = opa; }
void setTextColor(KStatefulBrush brush) { m_brush = brush; }
......
......@@ -63,7 +63,7 @@ public:
/**
* Constructs a message item. It is hidden by default.
*/
KGamePopupItem(QGraphicsItem * parent = 0);
KGamePopupItem(QGraphicsItem * parent = nullptr);
/**
* Destructs a message item
*/
......
......@@ -41,7 +41,7 @@ class KDEGAMES_EXPORT KGameRenderedItem : public QGraphicsPixmapItem, public KGa
public:
///Creates a new KGameRenderedItem which renders the sprite with the
///given @a spriteKey as provided by the given @a renderer.
KGameRenderedItem(KGameRenderer* renderer, const QString& spriteKey, QGraphicsItem* parent = 0);
KGameRenderedItem(KGameRenderer* renderer, const QString& spriteKey, QGraphicsItem* parent = nullptr);
virtual ~KGameRenderedItem();
protected:
void receivePixmap(const QPixmap& pixmap) Q_DECL_OVERRIDE;
......
......@@ -64,7 +64,7 @@ class KDEGAMES_EXPORT KGameRenderedObjectItem : public QGraphicsObject, public K
public:
///Creates a new KGameRenderedObjectItem which renders the sprite with
///the given @a spriteKey as provided by the given @a renderer.
KGameRenderedObjectItem(KGameRenderer* renderer, const QString& spriteKey, QGraphicsItem* parent = 0);
KGameRenderedObjectItem(KGameRenderer* renderer, const QString& spriteKey, QGraphicsItem* parent = nullptr);
virtual ~KGameRenderedObjectItem();
///@return the item's offset, which defines the point of the top-left
......
......@@ -45,7 +45,7 @@ public:
///Construcs a new KgDeclarativeView with KDE specific environment.
///@param parent The parent widget for this view (usually the main
///window of the game)
KgDeclarativeView(QWidget *parent=0);
explicit KgDeclarativeView(QWidget *parent=nullptr);
private:
class Private;
......
......@@ -348,7 +348,7 @@ namespace KgDifficultyGUI
private:
KgDifficulty* d;
public:
Selector(KgDifficulty* difficulty, QWidget* parent = 0)
Selector(KgDifficulty* difficulty, QWidget* parent = nullptr)
: KComboBox(parent), d(difficulty) {}
Q_SIGNALS:
void signalSelected(int levelIndex);
......
......@@ -103,7 +103,7 @@ class KDEGAMES_EXPORT KgDifficulty : public QObject
Q_PROPERTY(bool editable READ isEditable WRITE setEditable NOTIFY editableChanged)
Q_PROPERTY(bool gameRunning READ isGameRunning WRITE setGameRunning NOTIFY gameRunningChanged)
public:
explicit KgDifficulty(QObject* parent = 0);
explicit KgDifficulty(QObject* parent = nullptr);
///Destroys this instance and all DifficultyLevel instances in it.
virtual ~KgDifficulty();
......
......@@ -85,7 +85,7 @@ class KDEGAMES_EXPORT KgTheme : public QObject
Q_DISABLE_COPY(KgTheme)
public:
///Constructor. The @a identifier must be application-unique.
explicit KgTheme(const QByteArray& identifier, QObject* parent = 0);
explicit KgTheme(const QByteArray& identifier, QObject* parent = nullptr);
///Destructor.
virtual ~KgTheme();
......
......@@ -53,7 +53,7 @@ class KDEGAMES_EXPORT KgThemeProvider : public QObject
///
///If there are multiple KgThemeProvider instances, make sure they use
///different config keys to avoid collisions.
explicit KgThemeProvider(const QByteArray& configKey = QByteArray("Theme"), QObject* parent = 0);
explicit KgThemeProvider(const QByteArray& configKey = QByteArray("Theme"), QObject* parent = nullptr);
///Destructor.
virtual ~KgThemeProvider();
......
......@@ -53,7 +53,7 @@ class KDEGAMES_EXPORT KgThemeSelector : public QWidget
};
Q_DECLARE_FLAGS(Options, Option)
explicit KgThemeSelector(KgThemeProvider* provider, Options options = DefaultBehavior, QWidget* parent = 0);
explicit KgThemeSelector(KgThemeProvider* provider, Options options = DefaultBehavior, QWidget* parent = nullptr);
virtual ~KgThemeSelector();
public Q_SLOTS:
///Create and show a non-modal dialog which displays this selector.
......
......@@ -34,7 +34,7 @@ class KgThemeDelegate : public QStyledItemDelegate
IdRole //not displayed, but used internally
};
KgThemeDelegate(QObject* parent = 0);
KgThemeDelegate(QObject* parent = nullptr);
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const Q_DECL_OVERRIDE;
///@note The implementation is independent of @a option and @a index.
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const Q_DECL_OVERRIDE;
......
......@@ -84,8 +84,8 @@ public:
* choose where to send messages to (either globally or just to some
* players) will not be added.
**/
explicit KChatBase(QWidget* parent, KChatBaseModel* model=0,
KChatBaseItemDelegate* delegate=0,
explicit KChatBase(QWidget* parent, KChatBaseModel* model=nullptr,
KChatBaseItemDelegate* delegate=nullptr,
bool noComboBox = false);
/**
......
......@@ -42,7 +42,7 @@ class KDEGAMESPRIVATE_EXPORT KChatBaseItemDelegate : public QAbstractItemDelegat
/**
* Constructs a KChatBaseItemDelegate object
**/
explicit KChatBaseItemDelegate(QObject *parent = 0);
explicit KChatBaseItemDelegate(QObject *parent = nullptr);
/**
* Destruct a KChatBaseItemDelegate object.
......
......@@ -82,10 +82,10 @@ class KDEGAMESPRIVATE_EXPORT KChatBaseModel : public QAbstractListModel
public:
/** Default constructor */
KChatBaseModel(QObject *parent = 0);
explicit KChatBaseModel(QObject *parent = nullptr);
/** Default destructor */
virtual ~KChatBaseModel();
~KChatBaseModel() Q_DECL_OVERRIDE;
/**
* Reimplementation of the inherited method.
......
......@@ -102,12 +102,12 @@ public:
* game in load/save and network operations. Change this between
* games.
*/
explicit KGame(int cookie=42,QObject* parent=0);
explicit KGame(int cookie=42,QObject* parent=nullptr);
/**
* Destructs the game
*/
virtual ~KGame();
~KGame() Q_DECL_OVERRIDE;
/**
* Gives debug output of the game status
......
......@@ -51,7 +51,7 @@ public:
/**
* Create a KGameNetwork object
*/
explicit KGameNetwork(int cookie=42,QObject* parent=0);
explicit KGameNetwork(int cookie=42,QObject* parent=nullptr);
virtual ~KGameNetwork();
/**
......
......@@ -81,14 +81,14 @@ public:
* You have to call registerHandler before you can use this
* handler!
**/
KGamePropertyHandler(QObject* parent = 0);
KGamePropertyHandler(QObject* parent = nullptr);
/**
* Construct a registered handler.
*
* @see registerHandler
**/
KGamePropertyHandler(int id, const QObject* receiver, const char* sendf, const char* emitf, QObject* parent = 0);
KGamePropertyHandler(int id, const QObject* receiver, const char* sendf, const char* emitf, QObject* parent = nullptr);
~KGamePropertyHandler();
/**
......
......@@ -60,7 +60,7 @@ public:
Creates an unconnected KMessageClient object. Use setServer() later to connect to a
KMessageServer object.
*/
KMessageClient (QObject *parent = 0);
explicit KMessageClient (QObject *parent = nullptr);
/**
Destructor.
......
......@@ -67,7 +67,7 @@ public:
/**
* The usual QObject constructor, does nothing else.
**/
KMessageIO (QObject *parent = 0);
KMessageIO (QObject *parent = nullptr);
/**
* The usual destructor, does nothing special.
......@@ -187,7 +187,7 @@ public:
If the connection could not be established (e.g. unknown host or no server
socket at this port), the signal /e connectionBroken is emitted.
*/
KMessageSocket (const QString& host, quint16 port, QObject *parent = 0 );
KMessageSocket (const QString& host, quint16 port, QObject *parent = nullptr );
/**
Connects to a server socket on /e host with /e port. You can immediately
......@@ -197,7 +197,7 @@ public:
If the connection could not be established (e.g. unknown host or no server
socket at this port), the signal /e connectionBroken is emitted.
*/
KMessageSocket (QHostAddress host, quint16 port, QObject *parent = 0);
KMessageSocket (QHostAddress host, quint16 port, QObject *parent = nullptr);
/**
Uses /e socket to do the communication.
......@@ -210,7 +210,7 @@ public:
together with this KMessageSocket object. (Use 0 as parent for the QSocket
object t ensure it is not deleted.)
*/
explicit KMessageSocket (QTcpSocket *socket, QObject *parent = 0);
explicit KMessageSocket (QTcpSocket *socket, QObject *parent = nullptr);
/**
Uses the socket specified by the socket descriptor socketFD to do the
......@@ -223,7 +223,7 @@ public:
manipulate the socket afterwards, especially don't close it. The socket is
automatically closed when KMessageSocket is deleted.
*/
explicit KMessageSocket (int socketFD, QObject *parent = 0);
explicit KMessageSocket (int socketFD, QObject *parent = nullptr);
/**
Destructor, closes the socket.
......@@ -308,7 +308,7 @@ public:
If that object is already connected, the object remains unconnected.
*/
explicit KMessageDirect (KMessageDirect *partner = 0, QObject *parent = 0);
explicit KMessageDirect (KMessageDirect *partner = 0, QObject *parent = nullptr);
/**
Destructor, closes the connection.
......
......@@ -208,7 +208,7 @@ public:
/**
* Create a KGameNetwork object
**/
explicit KMessageServer(quint16 cookie = 42, QObject* parent = 0);
explicit KMessageServer(quint16 cookie = 42, QObject* parent = nullptr);
~KMessageServer();
......
......@@ -36,7 +36,7 @@ class KMessageServerSocket : public QTcpServer
Q_OBJECT
public:
explicit KMessageServerSocket (quint16 port, QObject *parent = 0);
explicit KMessageServerSocket (quint16 port, QObject *parent = nullptr);
~KMessageServerSocket ();
public slots:
......
......@@ -123,7 +123,7 @@ class KDEGAMESPRIVATE_EXPORT KGameDifficulty
* @param slotStandard Slot to call when the player changed the difficulty level to a standard one. Slot should have the signature like: SLOT(levelChanged(KGameDifficulty::standardLevel))
* @param slotCustom Slot to call when the player changed the difficulty level to a custom one. (Optional). Slot should have the signature like: SLOT(customLevelChanged(int))
*/
static void init(KXmlGuiWindow* window, const QObject *recvr, const char* slotStandard, const char* slotCustom = 0);
static void init(KXmlGuiWindow* window, const QObject *recvr, const char* slotStandard, const char* slotCustom = nullptr);
/**
* @brief Set if a new game has to be started by change
......
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