Commit cc5c836e authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use more nullptr

parent e8d4a41f
......@@ -50,8 +50,8 @@ DrawZone::DrawZone(QWidget *parent,KImageMapEditor* _imageMapEditor)
imageMapEditor=_imageMapEditor;
// setPicture(QImage());
currentAction=None;
currentArea=0L;
oldArea=0L;
currentArea = nullptr;
oldArea = nullptr;
_zoom=1;
// QWidget* w = new QWidget(this);
// setWidget(w);
......@@ -358,7 +358,7 @@ void DrawZone::mousePressLeftNoneOnBackground(QMouseEvent*, QPoint drawStart) {
// leftclicked with the arrow at an areafree position
if (toolType==KImageMapEditor::Selection)
{
currentArea=0L;
currentArea = nullptr;
imageMapEditor->deselectAll();
// Start drawing a selection rectangle
currentAction=DoSelect;
......@@ -422,7 +422,7 @@ void DrawZone::mousePressEvent(QMouseEvent* e)
drawStart=translateFromZoom(drawStart);
delete oldArea;
oldArea=0L;
oldArea = nullptr;
if (currentArea) {
oldArea = currentArea->clone();
......@@ -573,7 +573,7 @@ void DrawZone::mouseReleaseEvent(QMouseEvent *e) {
}
delete oldArea;
oldArea=0L;
oldArea = nullptr;
imageMapEditor->slotUpdateSelectionCoords();
}
......@@ -786,7 +786,7 @@ void DrawZone::cancelDrawing()
currentAction = None;
QRect r = translateToZoom(currentArea->selectionRect());
delete currentArea;
currentArea = 0L;
currentArea = nullptr;
repaint(r);
imageMapEditor->slotUpdateSelectionCoords();
}
......
......@@ -39,7 +39,7 @@ ImageMapChooseDialog::ImageMapChooseDialog(
: QDialog(parent)
{
qCDebug(KIMAGEMAPEDITOR_LOG) << "ImageMapChooseDialog::ImageMapChooseDialog";
if (parent == 0) {
if (parent == nullptr) {
qCWarning(KIMAGEMAPEDITOR_LOG) << "ImageMapChooseDialog: parent is null!";
}
......@@ -115,7 +115,7 @@ ImageMapChooseDialog::ImageMapChooseDialog(
initImageListTable(layout);
if (! maps.isEmpty()) {
mapListBox->setCurrentItem(0);
mapListBox->setCurrentItem(nullptr);
slotMapChanged(0);
}
......
......@@ -127,7 +127,7 @@ ImagesListViewItem* ImagesListView::findListViewItem(ImageTag* tag) {
}
qCDebug(KIMAGEMAPEDITOR_LOG) << "ImageListView::findListViewItem: found nothing ";
return 0L;
return nullptr;
}
......@@ -149,7 +149,7 @@ void ImagesListView::slotSelectionChanged() {
ImageTag* ImagesListView::selectedImage() {
if (selectedItems().isEmpty()) {
qCDebug(KIMAGEMAPEDITOR_LOG) << "ImagesListView::selectedImage: No Image is selected !";
return 0L;
return nullptr;
}
ImagesListViewItem* item = static_cast<ImagesListViewItem*>(selectedItems().first());
......
......@@ -91,8 +91,8 @@ KImageMapEditor::KImageMapEditor(QWidget *parentWidget,
// KDockMainWindow* mainWidget;
mainWindow = dynamic_cast<KXmlGuiWindow*>(parent) ;
QSplitter * splitter = 0L;
tabWidget = 0L;
QSplitter * splitter = nullptr;
tabWidget = nullptr;
if (mainWindow) {
// qCDebug(KIMAGEMAPEDITOR_LOG) << "KImageMapEditor: We got a KDockMainWindow !";
......@@ -122,9 +122,9 @@ KImageMapEditor::KImageMapEditor(QWidget *parentWidget,
}
else
{
areaDock = 0L;
mapsDock = 0L;
imagesDock = 0L;
areaDock = nullptr;
mapsDock = nullptr;
imagesDock = nullptr;
splitter = new QSplitter(parentWidget);
tabWidget = new QTabWidget(splitter);
areaListView = new AreaListView(tabWidget);
......@@ -173,7 +173,7 @@ KImageMapEditor::KImageMapEditor(QWidget *parentWidget,
setWidget(splitter);
} else {
QScrollArea *sa = new QScrollArea(mainWindow);
drawZone = new DrawZone(0L,this);
drawZone = new DrawZone(nullptr,this);
mainWindow->setCentralWidget(sa);
sa->setWidget(drawZone);
setWidget(mainWindow);
......@@ -184,9 +184,9 @@ KImageMapEditor::KImageMapEditor(QWidget *parentWidget,
areas = new AreaList();
currentSelected= new AreaSelection();
_currentToolType=KImageMapEditor::Selection;
copyArea=0L;
defaultArea=0L;
currentMapElement = 0L;
copyArea = nullptr;
defaultArea = nullptr;
currentMapElement = nullptr;
setupActions();
setupStatusBar();
......@@ -976,7 +976,7 @@ void KImageMapEditor::addArea(Area* area) {
// Perhaps we've got a selection of areas
// so test it and add all areas of the selection
// nested selections are possible but doesn't exist
AreaSelection *selection=0L;
AreaSelection *selection = nullptr;
if ( (selection = dynamic_cast <AreaSelection*> ( area ) ) )
{
AreaListIterator it = selection->getAreaListIterator();
......@@ -1028,7 +1028,7 @@ void KImageMapEditor::deleteArea( Area * area )
// Perhaps we've got a selection of areas
// so test it and delete the whole selection
// nested selections are possible but doesn't exist
AreaSelection *selection=0L;
AreaSelection *selection = nullptr;
if ( (selection = dynamic_cast <AreaSelection*> ( area ) ) )
{
AreaListIterator it = selection->getAreaListIterator();
......@@ -1173,7 +1173,7 @@ void KImageMapEditor::slotAreaChanged(Area *area)
setModified(true);
AreaSelection *selection=0L;
AreaSelection *selection = nullptr;
if ( (selection = dynamic_cast <AreaSelection*> ( area ) ) )
{
AreaListIterator it = selection->getAreaListIterator();
......@@ -1347,7 +1347,7 @@ Area* KImageMapEditor::onArea(const QPoint & p) const {
if (s->contains(p))
return s;
}
return 0L;
return nullptr;
}
......@@ -1859,13 +1859,13 @@ bool KImageMapEditor::openHTMLFile(const QUrl & url)
f.open(QIODevice::ReadOnly);
QTextStream s(&f);
QChar w;
QHash<QString,QString> *attr=0L;
QHash<QString,QString> *attr = nullptr;
QList<ImageTag*> images;
MapTag *map=0L;
MapTag *map = nullptr;
QList<MapTag*> maps;
_htmlContent.clear();
currentMapElement = 0L;
currentMapElement = nullptr;
QString temp;
QString origcode;
......@@ -1936,7 +1936,7 @@ bool KImageMapEditor::openHTMLFile(const QUrl & url)
QUrl imageUrl;
map = 0L;
map = nullptr;
// If we have more than on map or more than one image
// Let the user choose, otherwise take the only ones
......@@ -2056,7 +2056,7 @@ HtmlElement* KImageMapEditor::findHtmlElement(const QString & containingText) {
return el;
}
}
return 0L;
return nullptr;
}
/**
......@@ -2072,7 +2072,7 @@ HtmlImgElement* KImageMapEditor::findHtmlImgElement(ImageTag* tag) {
if (imgEl && imgEl->imgTag == tag)
return imgEl;
}
return 0L;
return nullptr;
}
void KImageMapEditor::addMap(const QString & name = QString()) {
......@@ -2121,7 +2121,7 @@ HtmlMapElement* KImageMapEditor::findHtmlMapElement(const QString & mapName) {
}
qCWarning(KIMAGEMAPEDITOR_LOG) << "KImageMapEditor::findHtmlMapElement: couldn't find map '" << mapName << "'";
return 0L;
return nullptr;
}
/**
......@@ -2215,7 +2215,7 @@ void KImageMapEditor::setMap(HtmlMapElement* mapElement) {
// Remove old areas only if a new map is loaded
deleteAllAreas();
delete defaultArea;
defaultArea = 0L;
defaultArea = nullptr;
// qCDebug(KIMAGEMAPEDITOR_LOG) << "KImageMapEditor::setMap : Setting new map : " << map->name;
_mapName = map->name;
AreaTag tag;
......@@ -2472,7 +2472,7 @@ void KImageMapEditor::slotBackOne()
AreaList list = currentSelected->getAreaList();
Area *a = 0L;
Area *a = nullptr;
// move every selected Area one step lower
for (int i=areas->count()-2; i > -1; i--)
{
......@@ -2498,7 +2498,7 @@ void KImageMapEditor::slotForwardOne()
AreaList list = currentSelected->getAreaList();
Area *a = 0L;
Area *a = nullptr;
// move every selected Area one step higher
for (int i=1; i < (int)areas->count(); i++)
{
......@@ -2697,7 +2697,7 @@ void KImageMapEditor::mapDelete()
_htmlContent.removeAll(mapEl);
if (mapsListView->count() == 0) {
currentMapElement = 0L;
currentMapElement = nullptr;
deleteAllAreas();
setMapActionsEnabled(false);
}
......@@ -2760,12 +2760,12 @@ bool KImageMapEditor::closeUrl()
imagesListView->clear();
delete copyArea;
copyArea=0L;
copyArea = nullptr;
delete defaultArea;
defaultArea=0L;
defaultArea = nullptr;
currentMapElement = 0L;
currentMapElement = nullptr;
init();
emit setWindowCaption("");
......
......@@ -83,7 +83,7 @@ public:
class HtmlMapElement : public HtmlElement {
public:
explicit HtmlMapElement(const QString & s) : HtmlElement(s) {
mapTag = 0L;
mapTag = nullptr;
};
~HtmlMapElement() override {};
......@@ -94,7 +94,7 @@ public:
class HtmlImgElement : public HtmlElement {
public:
explicit HtmlImgElement(const QString & s) : HtmlElement(s) {
imgTag = 0L;
imgTag = nullptr;
};
~HtmlImgElement() override {}
;
......
......@@ -140,7 +140,7 @@ Area::Area()
_finished=false;
_isSelected=false;
_name=i18n("noname");
_listViewItem=0L;
_listViewItem = nullptr;
currentHighlighted=-1;
_type=Area::None;
}
......@@ -276,7 +276,7 @@ void Area::setListViewItem(QTreeWidgetItem* item) {
void Area::deleteListViewItem()
{
delete _listViewItem;
_listViewItem = 0L;
_listViewItem = nullptr;
}
......@@ -487,7 +487,7 @@ SelectionPoint* Area::onSelectionPoint(const QPoint & p, double zoom) const
}
}
return 0L;
return nullptr;
}
......@@ -1286,7 +1286,7 @@ Area* AreaSelection::clone() const
void AreaSelection::add(Area *a)
{
// if a selection of areas was added get the areas of it
AreaSelection *selection=0L;
AreaSelection *selection = nullptr;
if ( (selection = dynamic_cast <AreaSelection*> ( a ) ) ) {
AreaList list = selection->getAreaList();
Area* area;
......@@ -1361,7 +1361,7 @@ SelectionPoint* AreaSelection::onSelectionPoint(const QPoint & p, double zoom) c
{
if (_areas->count() != 1)
return 0L;
return nullptr;
return _areas->first()->onSelectionPoint(p,zoom);
}
......
......@@ -414,7 +414,7 @@ AreaDialog::~AreaDialog() {
}
CoordsEdit* AreaDialog::createCoordsEdit(QWidget *parent, Area *a) {
if (!a) return 0;
if (!a) return nullptr;
switch (a->type()) {
case Area::Rectangle :
return new RectCoordsEdit(parent,a);
......@@ -479,7 +479,7 @@ void AreaDialog::slotApply() {
void AreaDialog::slotCancel() {
if (area) {
AreaSelection *selection=0L;
AreaSelection *selection = nullptr;
if ( (selection=dynamic_cast<AreaSelection*>(areaCopy)) )
area->setArea(*selection);
else
......
......@@ -63,7 +63,7 @@ KimeShell::KimeShell(const char * )
// setMainDockWidget( mainDock); // master dockwidget
qCDebug(KIMAGEMAPEDITOR_LOG) << "KimeShell starting 0";
m_part = new KImageMapEditor((QWidget*)0L, this);
m_part = new KImageMapEditor((QWidget*)nullptr, this);
// setCentralWidget( part->widget() );
......
......@@ -29,7 +29,7 @@ class KimeShell : public KParts::MainWindow
Q_OBJECT
public:
explicit KimeShell( const char *name=0 );
explicit KimeShell( const char *name=nullptr );
~KimeShell() override;
void setStdout(bool b);
......
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