Commit 3381c656 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Our hacking file says we don't use Q_NULLPTR, so let's not use it

parent 04d12bb3
......@@ -115,7 +115,7 @@ void Palette::removeEntry(int index, const QString &/*groupName*/)
int col = index % columnCount();
int tmp = index;
int row = (index - col) / columnCount();
KisSwatchGroup *groupFoundIn = Q_NULLPTR;
KisSwatchGroup *groupFoundIn = 0;
Q_FOREACH(const QString &name, groupNames()) {
KisSwatchGroup *g = d->palette->getGroup(name);
tmp -= g->rowCount() * columnCount();
......
......@@ -116,7 +116,7 @@ KoColorSet::KoColorSet(const QString& filename)
/// Create an copied palette
KoColorSet::KoColorSet(const KoColorSet& rhs)
: QObject(Q_NULLPTR)
: QObject(0)
, KoResource(rhs)
, d(new Private(this))
{
......@@ -431,7 +431,7 @@ int KoColorSet::rowCount() const
KisSwatchGroup *KoColorSet::getGroup(const QString &name)
{
if (!d->groups.contains(name)) {
return Q_NULLPTR;
return 0;
}
return &(d->groups[name]);
}
......
......@@ -123,7 +123,7 @@ void KisPaletteEditor::addPalette()
void KisPaletteEditor::importPalette()
{
KoFileDialog dialog(Q_NULLPTR, KoFileDialog::OpenFile, "Open Palette");
KoFileDialog dialog(0, KoFileDialog::OpenFile, "Open Palette");
dialog.setDefaultDir(QDir::homePath());
dialog.setMimeTypeFilters(QStringList() << "krita/x-colorset" << "application/x-gimp-color-palette");
QString filename = dialog.filename();
......
......@@ -46,7 +46,7 @@ public:
struct PaletteInfo;
public:
explicit KisPaletteEditor(QObject *parent = Q_NULLPTR);
explicit KisPaletteEditor(QObject *parent = 0);
~KisPaletteEditor();
void setPaletteModel(KisPaletteModel *model);
......
......@@ -98,7 +98,7 @@ public:
* @param parent parent widget.
* @param caption the dialog caption.
*/
static KoColor getModalColorDialog(const KoColor color, QWidget* parent = Q_NULLPTR, QString caption = QString());
static KoColor getModalColorDialog(const KoColor color, QWidget* parent = 0, QString caption = QString());
/**
* @brief getCurrentColor
......
......@@ -30,7 +30,7 @@
KisPaletteComboBox::KisPaletteComboBox(QWidget *parent)
: KisSqueezedComboBox(parent)
, m_model(Q_NULLPTR)
, m_model(0)
{
setEditable(true);
setInsertPolicy(NoInsert);
......
......@@ -46,7 +46,7 @@ private /* typedef */:
typedef QHash<SwatchPosType, int> PosIdxMapType;
public:
explicit KisPaletteComboBox(QWidget *parent = Q_NULLPTR);
explicit KisPaletteComboBox(QWidget *parent = 0);
~KisPaletteComboBox();
Q_SIGNALS:
......
......@@ -33,7 +33,7 @@
KisPaletteModel::KisPaletteModel(QObject* parent)
: QAbstractTableModel(parent)
, m_colorSet(Q_NULLPTR)
, m_colorSet(0)
, m_displayRenderer(KoDumbColorDisplayRenderer::instance())
{
connect(this, SIGNAL(sigPaletteModified()), SLOT(slotPaletteModified()));
......
......@@ -43,7 +43,7 @@ class KRITAWIDGETS_EXPORT KisPaletteModel : public QAbstractTableModel
{
Q_OBJECT
public:
explicit KisPaletteModel(QObject* parent = Q_NULLPTR);
explicit KisPaletteModel(QObject* parent = 0);
~KisPaletteModel() override;
enum AdditionalRoles {
......
......@@ -231,7 +231,7 @@ void KisPaletteView::slotSelectColor(const KoColor &color)
void KisPaletteView::setPaletteModel(KisPaletteModel *model)
{
if (m_d->model) {
disconnect(m_d->model, Q_NULLPTR, this, Q_NULLPTR);
disconnect(m_d->model, 0, this, 0);
}
m_d->model = model;
setModel(model);
......
......@@ -42,7 +42,7 @@ class KRITAWIDGETS_EXPORT KisPaletteView : public QTableView
private:
static int MININUM_ROW_HEIGHT;
public:
explicit KisPaletteView(QWidget *parent = Q_NULLPTR);
explicit KisPaletteView(QWidget *parent = 0);
~KisPaletteView() override;
void setPaletteModel(KisPaletteModel *model);
......
......@@ -49,7 +49,7 @@ class KCheckAcceleratorsInitializer : public QObject
{
Q_OBJECT
public:
explicit KCheckAcceleratorsInitializer(QObject *parent = Q_NULLPTR)
explicit KCheckAcceleratorsInitializer(QObject *parent = 0)
: QObject(parent)
{
}
......
......@@ -67,10 +67,10 @@ PaletteDockerDock::PaletteDockerDock( )
, m_ui(new Ui_WdgPaletteDock())
, m_model(new KisPaletteModel(this))
, m_paletteChooser(new KisPaletteListWidget(this))
, m_view(Q_NULLPTR)
, m_resourceProvider(Q_NULLPTR)
, m_view(0)
, m_resourceProvider(0)
, m_rServer(KoResourceServerProvider::instance()->paletteServer())
, m_activeDocument(Q_NULLPTR)
, m_activeDocument(0)
, m_paletteEditor(new KisPaletteEditor)
, m_actAdd(new QAction(KisIconUtils::loadIcon("list-add"), i18n("Add a color")))
, m_actRemove(new QAction(KisIconUtils::loadIcon("edit-delete"), i18n("Delete color")))
......@@ -152,7 +152,6 @@ void PaletteDockerDock::setViewManager(KisViewManager* kisview)
SLOT(loadFromWorkspace(KisWorkspaceResource*)));
connect(m_resourceProvider, SIGNAL(sigFGColorChanged(KoColor)),
this, SLOT(slotFGColorResourceChanged(KoColor)));
kisview->nodeManager()->disconnect(m_model);
}
......@@ -196,7 +195,7 @@ void PaletteDockerDock::slotExportPalette(KoColorSet *palette)
void PaletteDockerDock::setCanvas(KoCanvasBase *canvas)
{
setEnabled(canvas != Q_NULLPTR);
setEnabled(canvas != 0);
if (canvas) {
KisCanvas2 *cv = qobject_cast<KisCanvas2*>(canvas);
m_ui->paletteView->setDisplayRenderer(cv->displayColorConverter()->displayRendererInterface());
......@@ -220,15 +219,15 @@ void PaletteDockerDock::setCanvas(KoCanvasBase *canvas)
}
if (!m_currentColorSet) {
slotSetColorSet(Q_NULLPTR);
slotSetColorSet(0);
}
}
void PaletteDockerDock::unsetCanvas()
{
setEnabled(false);
m_ui->paletteView->setDisplayRenderer(Q_NULLPTR);
m_paletteEditor->setView(Q_NULLPTR);
m_ui->paletteView->setDisplayRenderer(0);
m_paletteEditor->setView(0);
for (KoResource *r : m_rServer->resources()) {
KoColorSet *c = static_cast<KoColorSet*>(r);
......@@ -237,7 +236,7 @@ void PaletteDockerDock::unsetCanvas()
}
}
if (!m_currentColorSet) {
slotSetColorSet(Q_NULLPTR);
slotSetColorSet(0);
}
}
......
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