|
From: <cn...@us...> - 2023-05-27 00:01:51
|
Revision: 1389
http://sourceforge.net/p/seq/svn/1389
Author: cn187
Date: 2023-05-27 00:01:48 +0000 (Sat, 27 May 2023)
Log Message:
-----------
[qt6] Fix warnings/deprecations
Modified Paths:
--------------
showeq/branches/cn187_devel/src/combatlog.cpp
showeq/branches/cn187_devel/src/editor.cpp
showeq/branches/cn187_devel/src/guildlist.cpp
showeq/branches/cn187_devel/src/mapcore.cpp
showeq/branches/cn187_devel/src/messagewindow.cpp
showeq/branches/cn187_devel/src/netdiag.cpp
showeq/branches/cn187_devel/src/packetinfo.cpp
showeq/branches/cn187_devel/src/spawnlist.cpp
showeq/branches/cn187_devel/src/spawnlist2.cpp
showeq/branches/cn187_devel/src/spawnpointlist.cpp
showeq/branches/cn187_devel/src/spelllist.cpp
showeq/branches/cn187_devel/src/spells.cpp
showeq/branches/cn187_devel/src/xmlconv.cpp
showeq/branches/cn187_devel/src/xmlpreferences.cpp
Modified: showeq/branches/cn187_devel/src/combatlog.cpp
===================================================================
--- showeq/branches/cn187_devel/src/combatlog.cpp 2023-05-26 03:25:27 UTC (rev 1388)
+++ showeq/branches/cn187_devel/src/combatlog.cpp 2023-05-27 00:01:48 UTC (rev 1389)
@@ -907,9 +907,9 @@
seqDebug("CombatWindow::addOffenseRecord starting...");
#endif
- bool bFoundRecord = false;
+ bool bFoundRecord = false;
- CombatOffenseRecord *pRecord;
+ CombatOffenseRecord *pRecord = NULL;
QList<CombatOffenseRecord*>::iterator it;
@@ -941,14 +941,17 @@
}
}
- if(iDamage > 0)
- {
- pRecord->addHit(iDamage);
- }
- else if (iType != 231)
- {
- pRecord->addMiss(iDamage);
- }
+ if (pRecord)
+ {
+ if(iDamage > 0)
+ {
+ pRecord->addHit(iDamage);
+ }
+ else if (iType != 231)
+ {
+ pRecord->addMiss(iDamage);
+ }
+ }
#ifdef DEBUGCOMBAT
seqDebug("CombatWindow::addOffenseRecord finished...");
Modified: showeq/branches/cn187_devel/src/editor.cpp
===================================================================
--- showeq/branches/cn187_devel/src/editor.cpp 2023-05-26 03:25:27 UTC (rev 1388)
+++ showeq/branches/cn187_devel/src/editor.cpp 2023-05-27 00:01:48 UTC (rev 1389)
@@ -110,11 +110,17 @@
QMenu * file = new QMenu("&File", this);
menuBar()->addMenu(file);
+#if (QT_VERSION >= QT_VERSION_CHECK(6,3,0))
+ file->addAction( openIcon, "&Open", Qt::CTRL|Qt::Key_O, this, SLOT(load()));
+ file->addAction( saveIcon, "&Save", Qt::CTRL|Qt::Key_S, this, SLOT(save()));
+ file->addSeparator();
+ file->addAction( "&Close Editor", Qt::CTRL|Qt::Key_W, this, SLOT(close()));
+#else
file->addAction( openIcon, "&Open", this, SLOT(load()), Qt::CTRL+Qt::Key_O );
-
file->addAction( saveIcon, "&Save", this, SLOT(save()), Qt::CTRL+Qt::Key_S );
file->addSeparator();
file->addAction( "&Close Editor", this, SLOT(close()), Qt::CTRL+Qt::Key_W );
+#endif
e = new QTextEdit(this);
e->setObjectName("editor");
Modified: showeq/branches/cn187_devel/src/guildlist.cpp
===================================================================
--- showeq/branches/cn187_devel/src/guildlist.cpp 2023-05-26 03:25:27 UTC (rev 1388)
+++ showeq/branches/cn187_devel/src/guildlist.cpp 2023-05-27 00:01:48 UTC (rev 1389)
@@ -228,7 +228,11 @@
{
if (event->button() == Qt::RightButton)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ menu()->popup(event->globalPosition().toPoint());
+#else
menu()->popup(event->globalPos());
+#endif
}
}
Modified: showeq/branches/cn187_devel/src/mapcore.cpp
===================================================================
--- showeq/branches/cn187_devel/src/mapcore.cpp 2023-05-26 03:25:27 UTC (rev 1388)
+++ showeq/branches/cn187_devel/src/mapcore.cpp 2023-05-27 00:01:48 UTC (rev 1389)
@@ -1252,7 +1252,11 @@
}
// write out the start of the line info
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ fprintf (fh, "L,%s,%s,%lld",
+#else
fprintf (fh, "L,%s,%s,%d",
+#endif
currentLineL->name().toLatin1().data(),
currentLineL->colorName().toLatin1().data(),
currentLineL->size());
@@ -1276,7 +1280,11 @@
{
currentLineM = *mmit;
// write out the start of the line info
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ fprintf (fh, "M,%s,%s,%lld",
+#else
fprintf (fh, "M,%s,%s,%d",
+#endif
currentLineM->name().toLatin1().data(),
currentLineM->colorName().toLatin1().data(),
currentLineM->size());
@@ -1451,11 +1459,15 @@
if (m_mapLayers.count())
{
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ fileName = QString::asprintf("%s_%lld.map", m_zoneShortName.toLatin1().data(), m_mapLayers.count());
+#else
#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
fileName = QString::asprintf("%s_%d.map", m_zoneShortName.toLatin1().data(), m_mapLayers.count());
#else
fileName.sprintf("%s_%d.map", m_zoneShortName.toLatin1().data(), m_mapLayers.count());
#endif
+#endif
}
else
{
Modified: showeq/branches/cn187_devel/src/messagewindow.cpp
===================================================================
--- showeq/branches/cn187_devel/src/messagewindow.cpp 2023-05-26 03:25:27 UTC (rev 1388)
+++ showeq/branches/cn187_devel/src/messagewindow.cpp 2023-05-27 00:01:48 UTC (rev 1389)
@@ -659,17 +659,17 @@
SLOT(messageFilterDialog()));
m_menu->addSeparator();
- m_menu->addAction("&Find...", this, SLOT(findDialog()), Qt::CTRL+Qt::Key_F);
+ m_menu->addAction("&Find...", this, SLOT(findDialog()), Qt::CTRL|Qt::Key_F);
m_menu->addSeparator();
m_action_lockText = m_menu->addAction("&Lock Text", this,
- SLOT(toggleLockedText()), Qt::CTRL+Qt::Key_L);
+ SLOT(toggleLockedText()), Qt::CTRL|Qt::Key_L);
m_action_lockText->setCheckable(true);
m_action_lockText->setChecked(m_lockedText);
m_menu->addAction("Refresh Messages...", this,
- SLOT(refreshMessages()), Qt::CTRL+Qt::Key_R);
+ SLOT(refreshMessages()), Qt::CTRL|Qt::Key_R);
m_menu->addAction("Save Message Text...", this, SLOT(saveText()),
- Qt::CTRL+Qt::Key_S);
+ Qt::CTRL|Qt::Key_S);
m_menu->addSeparator();
tmpAction = m_menu->addAction("&Display Type", this,
Modified: showeq/branches/cn187_devel/src/netdiag.cpp
===================================================================
--- showeq/branches/cn187_devel/src/netdiag.cpp 2023-05-26 03:25:27 UTC (rev 1388)
+++ showeq/branches/cn187_devel/src/netdiag.cpp 2023-05-27 00:01:48 UTC (rev 1389)
@@ -33,7 +33,8 @@
NetDiag::NetDiag(EQPacket* packet, QWidget* parent, const char* name = NULL)
: SEQWindow("NetDiag", "ShowEQ - Network Diagnostics", parent, name),
m_packet(packet),
- m_playbackSpeed(NULL)
+ m_playbackSpeed(NULL),
+ m_packetStartTime{0}
{
QWidget* mainWidget = new QWidget();
@@ -327,7 +328,7 @@
void NetDiag::numPacket(int num, int stream)
{
// start the timer of not started
- if (!m_packetStartTime)
+ if (!m_packetStartTime[stream])
m_packetStartTime[stream] = mTime();
QString tempStr;
Modified: showeq/branches/cn187_devel/src/packetinfo.cpp
===================================================================
--- showeq/branches/cn187_devel/src/packetinfo.cpp 2023-05-26 03:25:27 UTC (rev 1388)
+++ showeq/branches/cn187_devel/src/packetinfo.cpp 2023-05-27 00:01:48 UTC (rev 1389)
@@ -514,13 +514,22 @@
QStringList comments = current->comments();
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
fprintf(stderr, "\t\t%lld comment(s)\n", comments.count());
+#else
+ fprintf(stderr, "\t\t%d comment(s)\n", comments.count());
+#endif
+
for (QStringList::Iterator cit = comments.begin();
cit != comments.end(); ++cit)
fprintf(stderr, "\t\t\t'%s'\n", (*cit).toLatin1().data());
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
fprintf(stderr, "\t\t%lld payload(s)\n", current->count());
+#else
+ fprintf(stderr, "\t\t%d payload(s)\n", current->count());
+#endif
QListIterator<EQPacketPayload*> pit(*current);
while (pit.hasNext())
Modified: showeq/branches/cn187_devel/src/spawnlist.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spawnlist.cpp 2023-05-26 03:25:27 UTC (rev 1388)
+++ showeq/branches/cn187_devel/src/spawnlist.cpp 2023-05-27 00:01:48 UTC (rev 1389)
@@ -1090,7 +1090,11 @@
if (event->button() == Qt::RightButton)
{
SpawnListMenu* spawnMenu = menu();
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ spawnMenu->popup(event->globalPosition().toPoint());
+#else
spawnMenu->popup(event->globalPos());
+#endif
}
}
Modified: showeq/branches/cn187_devel/src/spawnlist2.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spawnlist2.cpp 2023-05-26 03:25:27 UTC (rev 1388)
+++ showeq/branches/cn187_devel/src/spawnlist2.cpp 2023-05-27 00:01:48 UTC (rev 1389)
@@ -807,7 +807,11 @@
if (event->button() == Qt::RightButton)
{
SpawnListMenu* spawnMenu = (SpawnListMenu*)menu();
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ spawnMenu->popup(event->globalPosition().toPoint());
+#else
spawnMenu->popup(event->globalPos());
+#endif
}
}
Modified: showeq/branches/cn187_devel/src/spawnpointlist.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spawnpointlist.cpp 2023-05-26 03:25:27 UTC (rev 1388)
+++ showeq/branches/cn187_devel/src/spawnpointlist.cpp 2023-05-27 00:01:48 UTC (rev 1389)
@@ -292,7 +292,11 @@
{
// popup a context-menu
SpawnPointListMenu* spawnPointMenu = (SpawnPointListMenu*)menu();
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ spawnPointMenu->popup(event->globalPosition().toPoint());
+#else
spawnPointMenu->popup(event->globalPos());
+#endif
}
}
Modified: showeq/branches/cn187_devel/src/spelllist.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spelllist.cpp 2023-05-26 03:25:27 UTC (rev 1388)
+++ showeq/branches/cn187_devel/src/spelllist.cpp 2023-05-27 00:01:48 UTC (rev 1389)
@@ -347,7 +347,11 @@
QMenu* slMenu = menu();
if (slMenu)
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ slMenu->popup(event->globalPosition().toPoint());
+#else
slMenu->popup(event->globalPos());
+#endif
}
}
Modified: showeq/branches/cn187_devel/src/spells.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spells.cpp 2023-05-26 03:25:27 UTC (rev 1388)
+++ showeq/branches/cn187_devel/src/spells.cpp 2023-05-27 00:01:48 UTC (rev 1389)
@@ -287,7 +287,11 @@
if ((unicodeIndicator != 0xfffe) && (unicodeIndicator != 0xfeff))
text = textData;
else
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ text = QString((const QChar*)((char16_t*) textData.data()));
+#else
text = QString::fromUtf16((uint16_t*)textData.data());
+#endif
// split the file into at the line termination
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
Modified: showeq/branches/cn187_devel/src/xmlconv.cpp
===================================================================
--- showeq/branches/cn187_devel/src/xmlconv.cpp 2023-05-26 03:25:27 UTC (rev 1388)
+++ showeq/branches/cn187_devel/src/xmlconv.cpp 2023-05-27 00:01:48 UTC (rev 1389)
@@ -267,8 +267,12 @@
QDomNodeList stringNodeList = e.elementsByTagName("string");
QStringList stringList;
QDomElement stringElement;
-
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
for (int i = 0; i < stringNodeList.length(); i++)
+#else
+ for (unsigned int i = 0; i < stringNodeList.length(); i++)
+#endif
{
stringElement = stringNodeList.item(i).toElement();
if (!stringElement.hasAttribute("value"))
@@ -321,7 +325,11 @@
clearAttributes(e);
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ switch (v.typeId())
+#else
switch (v.type())
+#endif
{
case QMetaType::QString:
e.setTagName("string");
@@ -456,8 +464,12 @@
case QMetaType::QStringList:
{
e.setTagName("stringlist");
+#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
int j;
-
+#else
+ unsigned int j;
+#endif
+
QDomNode n;
QDomNodeList stringNodeList = e.elementsByTagName("string");
QDomElement stringElem;
@@ -515,7 +527,11 @@
#endif
default:
qWarning("Don't know how to persist variant of type: %s (%d)!",
- v.typeName(), v.type());
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ v.typeName(), v.typeId());
+#else
+ v.typeName(), v.type());
+#endif
ok = false;
break;
}
Modified: showeq/branches/cn187_devel/src/xmlpreferences.cpp
===================================================================
--- showeq/branches/cn187_devel/src/xmlpreferences.cpp 2023-05-26 03:25:27 UTC (rev 1388)
+++ showeq/branches/cn187_devel/src/xmlpreferences.cpp 2023-05-27 00:01:48 UTC (rev 1389)
@@ -164,7 +164,11 @@
/* not used*/ //bool foundValue;
sectionList = doc.elementsByTagName("section");
+#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
for (int i = 0; i < sectionList.length(); i++)
+#else
+ for (unsigned int i = 0; i < sectionList.length(); i++)
+#endif
{
section = sectionList.item(i).toElement();
if (!section.hasAttribute("name"))
@@ -202,8 +206,12 @@
}
propertyList = section.elementsByTagName("property");
-
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
for (int j = 0; j < propertyList.length(); j++)
+#else
+ for (unsigned int j = 0; j < propertyList.length(); j++)
+#endif
{
property = propertyList.item(j).toElement();
if (!property.hasAttribute("name"))
@@ -352,7 +360,11 @@
sectionDict = sdit.value();
// iterate over all the sections in the document
+#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
for (int i = 0; i < sectionList.length(); i++)
+#else
+ for (unsigned int i = 0; i < sectionList.length(); i++)
+#endif
{
e = sectionList.item(i).toElement();
if (!e.hasAttribute("name"))
@@ -399,7 +411,11 @@
propertyList = section.elementsByTagName("property");
// iterate over all the property elements until a match is found
+#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
for (int j = 0; j < propertyList.length(); j++)
+#else
+ for (unsigned int j = 0; j < propertyList.length(); j++)
+#endif
{
e = propertyList.item(j).toElement();
if (!e.hasAttribute("name"))
@@ -722,7 +738,11 @@
if (preference != NULL)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ switch(preference->typeId())
+#else
switch(preference->type())
+#endif
{
case QVariant::KeySequence:
return preference->value<QKeySequence>();
@@ -761,7 +781,11 @@
{
int64_t value = def;
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ switch((QMetaType::Type)preference->typeId())
+#else
switch((QMetaType::Type)preference->type())
+#endif
{
case QMetaType::QString:
// convert it to a uint64_t (in base 16)
@@ -813,7 +837,11 @@
{
uint64_t value = def;
+#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
+ switch(preference->typeId())
+#else
switch((QMetaType::Type)preference->type())
+#endif
{
case QMetaType::QString:
// convert it to a uint64_t (in base 16)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|