Commit c0828500 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add some nullptrAdd some nullptrAdd some nullptr

parent 95128d63
......@@ -32,7 +32,7 @@ namespace KExtHighscore
{
//-----------------------------------------------------------------------------
ManagerPrivate *internal = 0;
ManagerPrivate *internal = nullptr;
uint gameType()
{
......@@ -124,7 +124,7 @@ Manager::Manager(uint nbGameTypes, uint maxNbEntries)
Manager::~Manager()
{
delete internal;
internal = 0;
internal = nullptr;
}
void Manager::setTrackLostGames(bool track)
......@@ -207,7 +207,7 @@ bool Manager::isStrictlyLess(const Score &s1, const Score &s2) const
Item *Manager::createItem(ItemType type)
{
Item *item = 0;
Item *item = nullptr;
switch (type) {
case ScoreDefault:
item = new Item((uint)0, i18n("Score"), Qt::AlignRight);
......
......@@ -79,7 +79,7 @@ ScoresList::ScoresList(QWidget *parent)
void ScoresList::addHeader(const ItemArray &items)
{
// kDebug(11001) ;
addLineItem(items, 0, 0);
addLineItem(items, 0, nullptr);
}
QTreeWidgetItem *ScoresList::addLine(const ItemArray &items,
......@@ -131,7 +131,7 @@ void HighscoresList::load(const ItemArray &items, int highlight)
{
// kDebug(11001) ;
clear();
QTreeWidgetItem *line = 0;
QTreeWidgetItem *line = nullptr;
for (int j=items.nbEntries()-1; j>=0; j--) {
QTreeWidgetItem *item = addLine(items, j, j==highlight);
if ( j==highlight ) line = item;
......@@ -141,8 +141,7 @@ void HighscoresList::load(const ItemArray &items, int highlight)
//-----------------------------------------------------------------------------
HighscoresWidget::HighscoresWidget(QWidget *parent)
: QWidget(parent),
_scoresUrl(0), _playersUrl(0), _statsTab(0), _histoTab(0)
: QWidget(parent)
{
// kDebug(11001) << ": HighscoresWidget";
......@@ -158,24 +157,24 @@ HighscoresWidget::HighscoresWidget(QWidget *parent)
vbox->addWidget(_tw);
// scores tab
_scoresList = new HighscoresList(0);
_scoresList = new HighscoresList(nullptr);
_scoresList->addHeader(s);
_tw->addTab(_scoresList, i18n("Best &Scores"));
// players tab
_playersList = new HighscoresList(0);
_playersList = new HighscoresList(nullptr);
_playersList->addHeader(p);
_tw->addTab(_playersList, i18n("&Players"));
// statistics tab
if ( internal->showStatistics ) {
_statsTab = new StatisticsTab(0);
_statsTab = new StatisticsTab(nullptr);
_tw->addTab(_statsTab, i18n("Statistics"));
}
// histogram tab
if ( p.histogram().size()!=0 ) {
_histoTab = new HistogramTab(0);
_histoTab = new HistogramTab(nullptr);
_tw->addTab(_histoTab, i18n("Histogram"));
}
......@@ -243,7 +242,7 @@ HighscoresDialog::HighscoresDialog(int rank, QWidget *parent)
for (uint i=0; i<internal->nbGameTypes(); i++) {
QString title = internal->manager.gameTypeLabel(i, Manager::I18N);
QString icon = internal->manager.gameTypeLabel(i, Manager::Icon);
HighscoresWidget *hsw = new HighscoresWidget(0);
HighscoresWidget *hsw = new HighscoresWidget(nullptr);
KPageWidgetItem *pageItem = new KPageWidgetItem( hsw, title);
pageItem->setIcon(QIcon::fromTheme(icon).pixmap(IconSize(KIconLoader::Toolbar)));
// pageItem->setIcon( QIcon( BarIcon(icon, KIconLoader::SizeLarge) ) );
......@@ -281,7 +280,7 @@ void HighscoresDialog::slotUser1()
{
// kDebug(11001) ;
if ( KExtHighscore::configure(this) )
highscorePageChanged(currentPage(), 0);//update data
highscorePageChanged(currentPage(), nullptr);//update data
}
void HighscoresDialog::slotUser2()
......@@ -410,15 +409,15 @@ QString TotalMultipleScoresList::itemText(const ItemContainer &item,
//-----------------------------------------------------------------------------
ConfigDialog::ConfigDialog(QWidget *parent)
: QDialog(parent),
_saved(false), _WWHEnabled(0)
_saved(false), _WWHEnabled(nullptr)
{
// kDebug(11001) << ": ConfigDialog";
setWindowTitle( i18n("Configure Highscores") );
setModal( true );
QWidget *page = 0;
QTabWidget *tab = 0;
QWidget *page = nullptr;
QTabWidget *tab = nullptr;
QVBoxLayout *layout = new QVBoxLayout;
setLayout(layout);
......
......@@ -101,10 +101,13 @@ class HighscoresWidget : public QWidget
void tabChanged() { emit tabChanged(_tw->currentIndex()); }
private:
QTabWidget *_tw;
HighscoresList *_scoresList, *_playersList;
KUrlLabel *_scoresUrl, *_playersUrl;
AdditionalTab *_statsTab, *_histoTab;
QTabWidget *_tw = nullptr;
HighscoresList *_scoresList = nullptr;
HighscoresList *_playersList = nullptr;
KUrlLabel *_scoresUrl = nullptr;
KUrlLabel *_playersUrl = nullptr;
AdditionalTab *_statsTab = nullptr;
AdditionalTab *_histoTab = nullptr;
};
class HighscoresDialog : public KPageDialog
......@@ -121,7 +124,7 @@ class HighscoresDialog : public KPageDialog
private:
int _rank, _tab;
QWidget *_current;
QWidget *_current = nullptr;
QList<KPageWidgetItem*> _pages;
};
......@@ -172,11 +175,13 @@ class ConfigDialog : public QDialog
private:
bool _saved;
QCheckBox *_WWHEnabled;
QLineEdit *_nickname, *_comment;
QLineEdit *_key, *_registeredName;
QPushButton *_removeButton;
QDialogButtonBox *buttonBox;
QCheckBox *_WWHEnabled = nullptr;
QLineEdit *_nickname = nullptr;
QLineEdit *_comment = nullptr;
QLineEdit *_key = nullptr;
QLineEdit *_registeredName = nullptr;
QPushButton *_removeButton = nullptr;
QDialogButtonBox *buttonBox = nullptr;
void load();
bool save();
......@@ -196,8 +201,8 @@ class AskNameDialog : public QDialog
void nameChanged(QDialogButtonBox *box);
private:
QLineEdit *_edit;
QCheckBox *_checkbox;
QLineEdit *_edit = nullptr;
QCheckBox *_checkbox = nullptr;
};
} // namespace
......
......@@ -271,7 +271,7 @@ class ManagerPrivate
bool submitWorldWide(const Score &score, QWidget *parent) const;
static bool doQuery(const QUrl &url, QWidget *parent,
QDomNamedNodeMap *map = 0);
QDomNamedNodeMap *map = nullptr);
static bool getFromQuery(const QDomNamedNodeMap &map, const QString &name,
QString &value, QWidget *parent);
void convertToGlobal();
......
......@@ -35,7 +35,7 @@ class PlayersCombo : public QComboBox
{
Q_OBJECT
public:
PlayersCombo(QWidget *parent = 0);
PlayersCombo(QWidget *parent = nullptr);
void load();
......
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