Commit ea078ed1 authored by Tomas Mecir's avatar Tomas Mecir

Clean up warnings about obsolete methods

parent d7e7b037
......@@ -53,7 +53,7 @@ cCmdParser::~cCmdParser()
removeGlobalEventHandler ("global-settings-changed");
}
void cCmdParser::eventNothingHandler (QString event, int session)
void cCmdParser::eventNothingHandler (QString event, int /*session*/)
{
if (event == "global-settings-changed") {
cGlobalSettings *gs = cGlobalSettings::self();
......
......@@ -89,7 +89,7 @@ cCmdProcessor::~cCmdProcessor()
delete expcache;
}
void cCmdProcessor::eventNothingHandler (QString event, int session)
void cCmdProcessor::eventNothingHandler (QString event, int /*session*/)
{
if (event == "global-settings-changed") {
setFocusCommandString (cGlobalSettings::self()->getString ("str-focus"));
......
......@@ -90,7 +90,7 @@ void cCmdQueues::timeout ()
}
void cCmdQueues::gotLine (const QString &line)
void cCmdQueues::gotLine (const QString &/*line*/)
{
// TODO: handle the queues waiting for a line here ...
......
......@@ -43,6 +43,8 @@ public:
CMapPluginBase(QObject *parent=0);
virtual ~CMapPluginBase();
virtual QString tagName() = 0;
/** Used to get a list of the tools */
virtual QList<CMapToolBase *> *getToolList(void);
/** Used to get a list of the property pages for a map element */
......
......@@ -571,7 +571,7 @@
<property name="title">
<string>Background</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<layout class="QGridLayout" name="gridLayout3">
<item row="0" column="0">
<widget class="QLabel" name="lblBackground">
<property name="text">
......
......@@ -97,7 +97,7 @@ void DlgMapRoomProperties::slotAccept()
CMapCmdElementProperties *command = new CMapCmdElementProperties(mapManager,i18n("Changed Room Properties"),room);
command->compare("Label",room->getLabel(),txtLabel->text().trimmed());
command->compare("Description",room->getDescription(),txtDescription->text().trimmed());
command->compare("Description",room->getDescription(),txtDescription->toPlainText().trimmed());
command->compare("Color",room->getColor(),cmdRoomColor->color());
command->compare("DefaultColor",room->getUseDefaultCol(),chkUseDefaltColor->isChecked());
command->compare("LabelPos",(int)room->getLabelPosition(),(int)getLabelPos());
......
......@@ -177,7 +177,7 @@ void DlgMapTextProperties::slotSetSize(void)
QString width;
QString height;
QStringList textList;
CMapText::stringToList(txtText->text(),&textList);
CMapText::stringToList(txtText->toPlainText(),&textList);
int tmpWidth = 0;
for (QStringList::iterator it = textList.begin(); it != textList.end(); ++it)
{
......@@ -225,7 +225,7 @@ void DlgMapTextProperties::slotAccept()
int width = txtWidth->text().toInt();
int height = txtHeight->text().toInt();
command->compare("Text",text->getText(),txtText->text());
command->compare("Text",text->getText(),txtText->toPlainText());
command->compare("Color",text->getColor(),textColor);
command->compare("Font",text->getFont(),textFont);
command->compare("Size",text->getSize(),QSize(width,height));
......@@ -247,7 +247,7 @@ void DlgMapTextProperties::slotUpdatePreview()
textScrollView->setFont(textFont);
textScrollView->setColor(textColor);
textScrollView->setSize(QSize(width,height));
textScrollView->setText(txtText->text());
textScrollView->setText(txtText->toPlainText());
textScrollView->resize(txtWidth->text().toInt(),txtHeight->text().toInt());
textScrollView->update();
}
......@@ -293,93 +293,89 @@ int CMapFileFilterXML::loadData(const QString &filename)
//int CMapFileFilterXML::loadXMLData(QString filename)
int CMapFileFilterXML::loadXMLData(const QByteArray & buffer)
{
// TODO_jp : Make sure Zone ID and level ID max value is set corretly
QDomDocument doc ("map");
// TODO_jp : Make sure Zone ID and level ID max value is set corretly
QDomDocument doc ("map");
if (!doc.setContent( buffer))
{
kDebug() << "Unable to open the map file, not a valid xml document";
// file.close();
return -1;
}
if (!doc.setContent( buffer))
{
kDebug() << "Unable to open the map file, not a valid xml document";
// file.close();
return -1;
}
for (CMapPluginBase *plugin : m_mapManager->getPluginList())
plugin->loadAboutToStart();
QDomElement docElem = doc.documentElement();
QDomElement docElem = doc.documentElement();
// Check that this version of the file can be loaded
QDomElement e = readChildElement(&docElem,"Version");
if (!e.isNull())
{
QString major = e.attribute("Major","");
QString minor = e.attribute("Minor","");
if (major != "1" || minor != "0")
{
//TODO_jp : Output error message
kDebug() << "This version can't be loaded";
return -4;
}
}
else
// Check that this version of the file can be loaded
QDomElement e = readChildElement(&docElem,"Version");
if (!e.isNull())
{
QString major = e.attribute("Major","");
QString minor = e.attribute("Minor","");
if (major != "1" || minor != "0")
{
//TODO_jp : Output error message
kDebug() << "Unable to find version";
return -2;
//TODO_jp : Output error message
kDebug() << "This version can't be loaded";
return -4;
}
}
else
{
//TODO_jp : Output error message
kDebug() << "Unable to find version";
return -2;
}
// Find Root Zone
QDomElement rootZoneNode = readChildElement(&docElem,"Zone");
if (rootZoneNode.isNull())
{
//TODO_jp : Output error message
kDebug() << "Unable to find root zone";
return -2;
}
// Find Root Zone
QDomElement rootZoneNode = readChildElement(&docElem,"Zone");
if (rootZoneNode.isNull())
{
//TODO_jp : Output error message
kDebug() << "Unable to find root zone";
return -2;
}
// Load Root Zone
int errorZone =loadZone(&rootZoneNode);
if (errorZone!=0)
{
return errorZone;
}
// Load Root Zone
int errorZone =loadZone(&rootZoneNode);
if (errorZone!=0)
return errorZone;
// Find Paths
QDomElement pathsNode = readChildElement(&docElem,"Paths");
if (pathsNode.isNull())
{
//TODO_jp : Output error message
kDebug() << "Unable to find paths";
return -2;
}
// Find Paths
QDomElement pathsNode = readChildElement(&docElem,"Paths");
if (pathsNode.isNull())
{
//TODO_jp : Output error message
kDebug() << "Unable to find paths";
return -2;
}
// Load Paths
int errorPath = loadPaths(&pathsNode);
// Load Paths
int errorPath = loadPaths(&pathsNode);
if (errorPath!=0)
{
return errorPath;
}
if (errorPath!=0)
{
return errorPath;
}
// Find Links
QDomElement linksNode = readChildElement(&docElem,"Links");
if (pathsNode.isNull())
{
//TODO_jp : Output error message
kDebug() << "Unable to find links";
return -2;
}
// Find Links
QDomElement linksNode = readChildElement(&docElem,"Links");
if (pathsNode.isNull())
{
//TODO_jp : Output error message
kDebug() << "Unable to find links";
return -2;
}
int errorLinks = loadLinks(&linksNode);
if (errorLinks!=0)
{
return errorLinks;
}
int errorLinks = loadLinks(&linksNode);
if (errorLinks)
return errorLinks;
// Return no error
return 0;
// Return no error
return 0;
}
/** This method is used to load all of the links
......@@ -637,21 +633,21 @@ void CMapFileFilterXML::savePluginPropertiesForElement(CMapElement *element,QDom
for (CMapPluginBase *plugin : m_mapManager->getPluginList())
{
QDomElement pNode = doc->createElement(plugin->name());
KMemConfig pluginProperties;
plugin->saveElementProperties(element,&pluginProperties);
{
QDomElement pNode = doc->createElement(plugin->tagName());
KMemConfig pluginProperties;
plugin->saveElementProperties(element,&pluginProperties);
EntryMap entries = pluginProperties.entryMap("Properties");
for (EntryMap::ConstIterator it = entries.begin(); it != entries.end(); ++it)
{
pNode.setAttribute(it.key(),it.data());
}
pluginsNode.appendChild(pNode);
}
EntryMap entries = pluginProperties.entryMap("Properties");
for (EntryMap::ConstIterator it = entries.begin(); it != entries.end(); ++it)
{
pNode.setAttribute(it.key(),it.value());
}
pluginsNode.appendChild(pNode);
}
elProperties->appendChild(pluginsNode);
elProperties->appendChild(pluginsNode);
}
/**
......@@ -674,7 +670,7 @@ void CMapFileFilterXML::loadPluginPropertiesForElement(CMapElement *element,QDom
{
for (CMapPluginBase *plugin : m_mapManager->getPluginList())
{
if (plugin->name()==e.tagName())
if (plugin->tagName()==e.tagName())
{
KMemConfig pluginProperties;
......
......@@ -193,8 +193,7 @@ void CMapPluginStandard::afterElementUndeleted(CMapElement *element)
if (found)
{
addNote(element,(*e).note);
m_deletedElements.remove(e);
m_deletedElements.erase(e);
}
}
......
......@@ -36,6 +36,8 @@ public:
CMapPluginStandard(QObject *);
~CMapPluginStandard();
virtual QString tagName() { return QString("standard"); }
virtual QList<CMapPropertiesPaneBase *> createPropertyPanes(elementTyp type,CMapElement *element,QWidget *parent);
void profileChanged(void);
......
......@@ -51,7 +51,7 @@ CMapNotesPane::~CMapNotesPane()
/** This is called when the ok button of the property dialog is pressed */
void CMapNotesPane::slotOk()
{
CMapCMDNotes *cmd = new CMapCMDNotes(m_plugin,m_element,txtNotes->text());
CMapCMDNotes *cmd = new CMapCMDNotes(m_plugin,m_element,txtNotes->toPlainText());
m_plugin->getManager()->addCommand(cmd);
}
......
......@@ -61,8 +61,8 @@ CMapToolEraser::CMapToolEraser(KActionCollection *actionCollection,CMapManager *
manager,"toolsEraser",0)
{
QBitmap delete_cb( 32, 32, delete_cb_bits, TRUE );
QBitmap delete_cm( 32, 32, delete_cm_bits, TRUE );
QBitmap delete_cb = QBitmap::fromData (QSize(32, 32), delete_cb_bits);
QBitmap delete_cm = QBitmap::fromData (QSize(32, 32), delete_cm_bits);
deleteCursor = new QCursor( delete_cb, delete_cm, 1,1);
}
......@@ -73,7 +73,7 @@ CMapToolEraser::~CMapToolEraser()
}
/** Called when the tool recives a mouse release event */
void CMapToolEraser::mouseReleaseEvent(QPoint mousePos, QMouseEvent *e, CMapLevel *currentLevel)
void CMapToolEraser::mouseReleaseEvent(QPoint mousePos, QMouseEvent * /*e*/, CMapLevel *currentLevel)
{
if (!currentLevel) return;
CMapElement *element = currentLevel->findElementAt(mousePos);
......
......@@ -43,10 +43,10 @@ CMapToolPath::CMapToolPath(KActionCollection *actionCollection,CMapManager *mana
BarIcon(("kmud_path.png")),
manager,"toolsPath",0)
{
QBitmap pathStart_cb(16,16, path1_bits,TRUE);
QBitmap pathStart_cb = QBitmap::fromData (QSize(16,16), path1_bits);
pathStartCursor = new QCursor( pathStart_cb,pathStart_cb, 4,0);
QBitmap pathEnd_cb(16,16, path2_bits,TRUE);
QBitmap pathEnd_cb = QBitmap::fromData (QSize(16,16), path2_bits);
pathEndCursor = new QCursor( pathEnd_cb, pathEnd_cb, 4,0);
}
......@@ -57,7 +57,7 @@ CMapToolPath::~CMapToolPath()
}
/** Called when the tool recives a mouse release event */
void CMapToolPath::mouseReleaseEvent(QPoint mousePos, QMouseEvent *e, CMapLevel *currentLevel)
void CMapToolPath::mouseReleaseEvent(QPoint mousePos, QMouseEvent * /*e*/, CMapLevel *currentLevel)
{
if (!currentLevel) return;
CMapRoom *destRoom = currentLevel->findRoomAt(mousePos);
......
......@@ -54,7 +54,7 @@ void CMapToolRoom::paint(QPainter *p)
}
/** Called when the tool recives a mouse release event */
void CMapToolRoom::mouseReleaseEvent(QPoint mousePos, QMouseEvent *e, CMapLevel *currentLevel)
void CMapToolRoom::mouseReleaseEvent(QPoint mousePos, QMouseEvent * /*e*/, CMapLevel *currentLevel)
{
//FIXME_jp : Check to see if the room was placed at the edge of the map and move map if nescerary
......
......@@ -174,7 +174,7 @@ void CMapToolSelect::mousePressEvent(QPoint mousePos, QMouseEvent *, CMapLevel *
mapManager->levelChanged(currentLevel);
kDebug() << "CMapToolSelect: timer start";
mouseDownTimer.start(150,false);
mouseDownTimer.start(150);
}
QPoint CMapToolSelect::alignToGrid(QPoint offset)
......
......@@ -49,7 +49,7 @@ CMapToolText::~CMapToolText()
}
/** Called when the tool recives a mouse release event */
void CMapToolText::mouseReleaseEvent(QPoint mousePos, QMouseEvent *e, CMapLevel *currentLevel)
void CMapToolText::mouseReleaseEvent(QPoint mousePos, QMouseEvent * /*e*/, CMapLevel *currentLevel)
{
CMapText *text = (CMapText *) currentLevel->findElementAt(mousePos, TEXT);
if (!text) {
......@@ -115,7 +115,7 @@ void CMapToolText::keyPressEvent(QKeyEvent *e)
}
else
{
text->insertString(QString(QChar(e->ascii())));
text->insertString(e->text());
}
//FIXME_jp: Ensure that cursor is visiable
......
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