|
From: <cn...@us...> - 2023-05-24 22:21:14
|
Revision: 1382
http://sourceforge.net/p/seq/svn/1382
Author: cn187
Date: 2023-05-24 22:21:10 +0000 (Wed, 24 May 2023)
Log Message:
-----------
Fix warnings, deprecated functions
Modified Paths:
--------------
showeq/branches/cn187_devel/src/bazaarlog.cpp
showeq/branches/cn187_devel/src/combatlog.cpp
showeq/branches/cn187_devel/src/compass.cpp
showeq/branches/cn187_devel/src/diagnosticmessageslight.cpp
showeq/branches/cn187_devel/src/eqstr.cpp
showeq/branches/cn187_devel/src/filter.cpp
showeq/branches/cn187_devel/src/group.cpp
showeq/branches/cn187_devel/src/guild.cpp
showeq/branches/cn187_devel/src/guildshell.cpp
showeq/branches/cn187_devel/src/guildshell.h
showeq/branches/cn187_devel/src/interface.cpp
showeq/branches/cn187_devel/src/map.cpp
showeq/branches/cn187_devel/src/map.h
showeq/branches/cn187_devel/src/mapcore.cpp
showeq/branches/cn187_devel/src/mapicon.cpp
showeq/branches/cn187_devel/src/messageshell.cpp
showeq/branches/cn187_devel/src/messagewindow.cpp
showeq/branches/cn187_devel/src/packetinfo.cpp
showeq/branches/cn187_devel/src/packetlog.cpp
showeq/branches/cn187_devel/src/packetstream.cpp
showeq/branches/cn187_devel/src/pointarray.h
showeq/branches/cn187_devel/src/sortitem.cpp
showeq/branches/cn187_devel/src/spawn.cpp
showeq/branches/cn187_devel/src/spawn.h
showeq/branches/cn187_devel/src/spawnlist.cpp
showeq/branches/cn187_devel/src/spawnlist2.cpp
showeq/branches/cn187_devel/src/spawnlistcommon.cpp
showeq/branches/cn187_devel/src/spawnpointlist.cpp
showeq/branches/cn187_devel/src/spawnshell.cpp
showeq/branches/cn187_devel/src/spells.cpp
showeq/branches/cn187_devel/src/vpacket.cpp
showeq/branches/cn187_devel/src/xmlconv.cpp
showeq/branches/cn187_devel/src/xmlpreferences.cpp
Modified: showeq/branches/cn187_devel/src/bazaarlog.cpp
===================================================================
--- showeq/branches/cn187_devel/src/bazaarlog.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/bazaarlog.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -27,7 +27,6 @@
#include "spawnshell.h"
#include "diagnosticmessages.h"
-#pragma message("Once our minimum supported Qt version is greater than 5.14, this check can be removed and ENDL replaced with Qt::endl")
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
#define ENDL Qt::endl
#else
Modified: showeq/branches/cn187_devel/src/combatlog.cpp
===================================================================
--- showeq/branches/cn187_devel/src/combatlog.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/combatlog.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -571,7 +571,7 @@
QString s_avgnonmelee;
int iTotalDamage = 0;
- int iTotalHits = 0;
+ //int iTotalHits = 0;
double dPercentSpecial = 0.0;
double dPercentNonmelee = 0.0;
double dAvgMelee = 0.0;
@@ -730,7 +730,7 @@
}
iTotalDamage = iMeleeDamage + iSpecialDamage + iNonmeleeDamage;
- iTotalHits = iMeleeHits + iSpecialHits + iNonmeleeHits;
+ //iTotalHits = iMeleeHits + iSpecialHits + iNonmeleeHits;
dPercentSpecial = ((double)iSpecialDamage / (double)iTotalDamage) * 100.0;
dPercentNonmelee = ((double)iNonmeleeDamage / (double)iTotalDamage) * 100.0;
Modified: showeq/branches/cn187_devel/src/compass.cpp
===================================================================
--- showeq/branches/cn187_devel/src/compass.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/compass.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -123,7 +123,7 @@
QRect cr = compassRect();
QPixmap pix (cr.size());
QPainter tmp;
- pix.fill (this, cr.topLeft() );
+ pix.fill (this->palette().window().color());
int pwd2 = pix.width() >> 1;
int pwd4 = pix.width() >> 2;
int phd2 = pix.height() >> 1;
@@ -161,7 +161,7 @@
if (m_dSpawnAngle > 0)
{
- tmp.resetMatrix();
+ tmp.resetTransform();
tmp.translate(pwd2, phd2);
tmp.rotate(-m_dSpawnAngle);
tmp.setPen(Qt::green);
Modified: showeq/branches/cn187_devel/src/diagnosticmessageslight.cpp
===================================================================
--- showeq/branches/cn187_devel/src/diagnosticmessageslight.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/diagnosticmessageslight.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -59,10 +59,11 @@
void seqFatal(const char* format, ...)
{
- int ret;
+ /* not used */ //int ret;
va_list ap;
va_start(ap, format);
- ret = vfprintf(stderr, format, ap);
+ //ret = vfprintf(stderr, format, ap);
+ vfprintf(stderr, format, ap);
fputs("\n", stderr);
va_end(ap);
exit (-1);
Modified: showeq/branches/cn187_devel/src/eqstr.cpp
===================================================================
--- showeq/branches/cn187_devel/src/eqstr.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/eqstr.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -70,7 +70,11 @@
QRegExp lineTerm("[\r\n]{1,2}");
// split the data into lines at the line termination
+#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
+ QStringList lines = QString::fromUtf8(textData).split(lineTerm, Qt::SkipEmptyParts);
+#else
QStringList lines = QString::fromUtf8(textData).split(lineTerm, QString::SkipEmptyParts);
+#endif
// start iterating over the lines
QStringList::Iterator it = lines.begin();
Modified: showeq/branches/cn187_devel/src/filter.cpp
===================================================================
--- showeq/branches/cn187_devel/src/filter.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/filter.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -33,10 +33,10 @@
#include <QFile>
#include <QTextStream>
+#include <QXmlStreamReader>
#define MAXLEN 5000
-#pragma message("Once our minimum supported Qt version is greater than 5.14, this check can be removed and ENDL replaced with Qt::endl")
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
#define ENDL Qt::endl
#else
@@ -47,7 +47,7 @@
//----------------------------------------------------------------------
// LoadXmlContentHandler declaration
-class LoadXmlContentHandler : public QXmlDefaultHandler
+class LoadXmlContentHandler : public QObject
{
public:
LoadXmlContentHandler(Filters& filters, const FilterTypes& types);
@@ -56,7 +56,7 @@
// QXmlContentHandler overrides
bool startDocument();
bool startElement( const QString&, const QString&, const QString& ,
- const QXmlAttributes& );
+ const QXmlStreamAttributes& );
bool characters(const QString& ch);
bool endElement( const QString&, const QString&, const QString& );
bool endDocument();
@@ -533,23 +533,61 @@
// load filters
m_file = filename;
+ if (filename.isEmpty())
+ return false;
+
// create XML content handler
LoadXmlContentHandler handler(*this, m_types);
// create a file object on the file
QFile xmlFile(filename);
+ xmlFile.open(QIODevice::ReadOnly);
+ if (!xmlFile.isOpen())
+ return false;
- // create an XmlInputSource on the file
- QXmlInputSource source(&xmlFile);
-
- // create an XML parser
- QXmlSimpleReader reader;
+ QXmlStreamReader reader(&xmlFile);
- // set the content handler
- reader.setContentHandler(&handler);
+ bool status = true;
+ while(!reader.atEnd() && status)
+ {
+ switch(reader.readNext())
+ {
+ case QXmlStreamReader::NoToken:
+ break;
+ case QXmlStreamReader::Invalid:
+ status = false;
+ break;
+ case QXmlStreamReader::StartDocument:
+ if (!handler.startDocument())
+ status = false;
+ break;
+ case QXmlStreamReader::EndDocument:
+ if (!handler.endDocument())
+ status = false;
+ break;
+ case QXmlStreamReader::StartElement:
+ if (!handler.startElement(QString(), QString(), reader.name().toString(), reader.attributes()))
+ status = false;
+ break;
+ case QXmlStreamReader::EndElement:
+ if (!handler.endElement(QString(), QString(), reader.name().toString()))
+ status = false;
+ break;
+ case QXmlStreamReader::Characters:
+ if (!handler.characters(reader.text().toString()))
+ status = false;
+ break;
+ case QXmlStreamReader::Comment:
+ case QXmlStreamReader::DTD:
+ case QXmlStreamReader::EntityReference:
+ case QXmlStreamReader::ProcessingInstruction:
+ break;
+ }
+ }
- // parse the file
- return reader.parse(source);
+ xmlFile.close();
+
+ return status;
}
bool Filters::save(const QString& filename) const
@@ -823,7 +861,7 @@
bool LoadXmlContentHandler::startElement(const QString&,
const QString&,
const QString& name,
- const QXmlAttributes& attr)
+ const QXmlStreamAttributes& attr)
{
if (name == "oldfilter")
{
@@ -843,21 +881,13 @@
if (name == "level")
{
- int index;
-
- // first check for a min
- index = attr.index("min");
-
// if min attribute was found, use it
- if (index != -1)
- m_currentMinLevel = uint8_t(attr.value(index).toUShort());
+ if (!attr.value("min").isEmpty())
+ m_currentMinLevel = uint8_t(attr.value("min").toString().toUShort());
- // then check for a max
- index = attr.index("max");
-
// if max attribute was found, use it
- if (index != -1)
- m_currentMaxLevel = uint8_t(attr.value(index).toUShort());
+ if (!attr.value("max").isEmpty())
+ m_currentMaxLevel = uint8_t(attr.value("max").toString().toUShort());
// done
return true;
@@ -865,17 +895,16 @@
if (name == "section")
{
- int index = attr.index("name");
// section is only valid if a name is specified
- if (index == -1)
+ if (attr.value("name").isEmpty())
return false;
// get the current type for the name
- m_currentType = m_types.type(attr.value(index));
+ m_currentType = m_types.type(attr.value("name").toString());
return true;
}
-
+
return true;
}
Modified: showeq/branches/cn187_devel/src/group.cpp
===================================================================
--- showeq/branches/cn187_devel/src/group.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/group.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -30,7 +30,6 @@
#include <QTextStream>
-#pragma message("Once our minimum supported Qt version is greater than 5.14, this check can be removed and ENDL replaced with Qt::endl")
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
#define ENDL Qt::endl
#else
@@ -109,7 +108,9 @@
{
// it's a variable-length packet depending on number of group members and length of names
NetStream netStream(data, size);
- uint32_t memCount, memNumber, level;
+ uint32_t memCount;
+ /* not used */ //uint32_t memNumber;
+ /* not used */ //uint32_t level;
QString name;
netStream.skipBytes(4);
@@ -129,10 +130,12 @@
// update group member information
for(uint32_t i = 0; i < memCount; i++)
{
- memNumber = netStream.readUInt32NC();
+ //memNumber = netStream.readUInt32NC();
+ netStream.readUInt32NC(); //ignore/skip
name = netStream.readText();
netStream.skipBytes(4);
- level = netStream.readUInt32NC();
+ //level = netStream.readUInt32NC();
+ netStream.readUInt32NC(); //ignore/skip
// copy the member name
m_members[i]->m_name = name;
Modified: showeq/branches/cn187_devel/src/guild.cpp
===================================================================
--- showeq/branches/cn187_devel/src/guild.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/guild.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -34,7 +34,6 @@
#include <QDataStream>
#include <QTextStream>
-#pragma message("Once our minimum supported Qt version is greater than 5.14, this check can be removed and ENDL replaced with Qt::endl")
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
#define ENDL Qt::endl
#else
@@ -101,7 +100,7 @@
uint32_t size = 0; // to keep track of how much we're reading from the packet
uint32_t guildId = 0;
uint32_t guildServerId = 0;
- uint32_t numGuilds = 0;
+ /* not used */ //uint32_t numGuilds = 0;
uint32_t nameLen = netStream.readUInt32NC();
size += 4;
@@ -110,8 +109,9 @@
netStream.skipBytes(nameLen);
size += nameLen;
- numGuilds = netStream.readUInt32NC();
- size += 4;
+ //numGuilds = netStream.readUInt32NC();
+ netStream.readUInt32NC(); //ignore/skip
+ size += sizeof(uint32_t);
bool need_save = false;
@@ -118,10 +118,10 @@
while(!netStream.end())
{
guildId = netStream.readUInt32NC();
- size += 4;
+ size += sizeof(uint32_t);
guildServerId = netStream.readUInt32NC();
- size += 4;
+ size += sizeof(uint32_t);
uint32_t key = guildServerId << 16 | guildId;
Modified: showeq/branches/cn187_devel/src/guildshell.cpp
===================================================================
--- showeq/branches/cn187_devel/src/guildshell.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/guildshell.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -31,7 +31,6 @@
#include <QDateTime>
#include <QTextStream>
-#pragma message("Once our minimum supported Qt version is greater than 5.14, this check can be removed and ENDL replaced with Qt::endl")
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
#define ENDL Qt::endl
#else
@@ -278,11 +277,12 @@
gml.skipBytes(1);
// read the player count from the stream
- uint32_t count;
- count = gml.readUInt32NC();
+ /* not used */ //uint32_t count;
+ //count = gml.readUInt32NC();
+ gml.readUInt32NC(); //ignore/skip
#ifdef GUILDSHELL_DIAG
- seqDebug("Guild has %d members:", count);
+ //seqDebug("Guild has %d members:", count);
#endif
GuildMember* member;
Modified: showeq/branches/cn187_devel/src/guildshell.h
===================================================================
--- showeq/branches/cn187_devel/src/guildshell.h 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/guildshell.h 2023-05-24 22:21:10 UTC (rev 1382)
@@ -100,7 +100,7 @@
GuildShell(ZoneMgr* zoneMgr, QObject* parent = 0, const char* name = 0);
~GuildShell();
const GuildMemberDict& members() { return m_members; }
- size_t maxNameLength() { return m_maxNameLength; }
+ int32_t maxNameLength() { return m_maxNameLength; }
void dumpMembers(QTextStream& out);
@@ -120,7 +120,7 @@
protected:
GuildMemberDict m_members;
- size_t m_maxNameLength;
+ int32_t m_maxNameLength;
ZoneMgr* m_zoneMgr;
};
Modified: showeq/branches/cn187_devel/src/interface.cpp
===================================================================
--- showeq/branches/cn187_devel/src/interface.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/interface.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -94,7 +94,6 @@
#include <QDesktopWidget>
#include <QStyleFactory>
-#pragma message("Once our minimum supported Qt version is greater than 5.14, this check can be removed and ENDL replaced with Qt::endl")
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
#define ENDL Qt::endl
#else
Modified: showeq/branches/cn187_devel/src/map.cpp
===================================================================
--- showeq/branches/cn187_devel/src/map.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/map.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -83,7 +83,6 @@
#include <QTextStream>
#include <QMouseEvent>
-#pragma message("Once our minimum supported Qt version is greater than 5.14, this check can be removed and ENDL replaced with Qt::endl")
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
#define ENDL Qt::endl
#else
@@ -1854,43 +1853,55 @@
// Accelerators
- QShortcut *tmpShortcut = nullptr;
+ /* not used*/ //QShortcut *tmpShortcut = nullptr;
QKeySequence key;
key = pSEQPrefs->getPrefKey("ZoomInKey", prefString, "+");
- tmpShortcut = new QShortcut(key, this, SLOT(zoomIn()));
+ //tmpShortcut = new QShortcut(key, this, SLOT(zoomIn()));
+ new QShortcut(key, this, SLOT(zoomIn()));
key = pSEQPrefs->getPrefKey("ZoomOutKey", prefString, "-");
- tmpShortcut = new QShortcut(key, this, SLOT(zoomOut()));
+ //tmpShortcut = new QShortcut(key, this, SLOT(zoomOut()));
+ new QShortcut(key, this, SLOT(zoomOut()));
key = pSEQPrefs->getPrefKey("PanDownLeftKey", prefString, "Ctrl+1");
- tmpShortcut = new QShortcut(key, this, SLOT(panDownLeft()));
+ //tmpShortcut = new QShortcut(key, this, SLOT(panDownLeft()));
+ new QShortcut(key, this, SLOT(panDownLeft()));
key = pSEQPrefs->getPrefKey("PanDownKey", prefString, "Ctrl+2");
- tmpShortcut = new QShortcut(key, this, SLOT(panDown()));
+ //tmpShortcut = new QShortcut(key, this, SLOT(panDown()));
+ new QShortcut(key, this, SLOT(panDown()));
key = pSEQPrefs->getPrefKey("PanDownRightKey", prefString, "Ctrl+3");
- tmpShortcut = new QShortcut(key, this, SLOT(panDownRight()));
+ //tmpShortcut = new QShortcut(key, this, SLOT(panDownRight()));
+ new QShortcut(key, this, SLOT(panDownRight()));
key = pSEQPrefs->getPrefKey("PanLeftKey", prefString, "Ctrl+4");
- tmpShortcut = new QShortcut(key, this, SLOT(panLeft()));
+ //tmpShortcut = new QShortcut(key, this, SLOT(panLeft()));
+ new QShortcut(key, this, SLOT(panLeft()));
key = pSEQPrefs->getPrefKey("CenterSelectedKey", prefString, "Ctrl+5");
- tmpShortcut = new QShortcut(key, this, SLOT(viewTarget()));
+ //tmpShortcut = new QShortcut(key, this, SLOT(viewTarget()));
+ new QShortcut(key, this, SLOT(viewTarget()));
key = pSEQPrefs->getPrefKey("PanRightKey", prefString, "Ctrl+6");
- tmpShortcut = new QShortcut(key, this, SLOT(panRight()));
+ //tmpShortcut = new QShortcut(key, this, SLOT(panRight()));
+ new QShortcut(key, this, SLOT(panRight()));
key = pSEQPrefs->getPrefKey("PanUpLeftKey", prefString, "Ctrl+7");
- tmpShortcut = new QShortcut(key, this, SLOT(panUpLeft()));
+ //tmpShortcut = new QShortcut(key, this, SLOT(panUpLeft()));
+ new QShortcut(key, this, SLOT(panUpLeft()));
key = pSEQPrefs->getPrefKey("PanUpKey", prefString, "Ctrl+8");
- tmpShortcut = new QShortcut(key, this, SLOT(panUp()));
+ //tmpShortcut = new QShortcut(key, this, SLOT(panUp()));
+ new QShortcut(key, this, SLOT(panUp()));
key = pSEQPrefs->getPrefKey("PanUpRightKey", prefString, "Ctrl+9");
- tmpShortcut = new QShortcut(key, this, SLOT(panUpRight()));
+ //tmpShortcut = new QShortcut(key, this, SLOT(panUpRight()));
+ new QShortcut(key, this, SLOT(panUpRight()));
key = pSEQPrefs->getPrefKey("ViewLockKey", prefString, "Ctrl+0");
- tmpShortcut = new QShortcut(key, this, SLOT(viewLock()));
+ //tmpShortcut = new QShortcut(key, this, SLOT(viewLock()));
+ new QShortcut(key, this, SLOT(viewLock()));
m_followMode = tFollowPlayer;
@@ -3392,7 +3403,7 @@
QTime drawTime;
// get the current time
- drawTime.start();
+ drawTime = QTime::currentTime();
EQPoint playerPos;
@@ -3486,8 +3497,8 @@
m_paintCount++;
// get paint time
- int paintTime = drawTime.elapsed();
-
+ int paintTime = drawTime.msecsTo(QTime::currentTime());
+
// add paint time to sum
m_paintTimeSum += paintTime;
@@ -3895,7 +3906,7 @@
uint32_t filterFlags;
const QRect& screenBounds = m_param.screenBounds();
MapIcon mapIcon;
- bool up2date = false;
+ //bool up2date = false;
/* Paint the spawns */
const Spawn* spawn;
@@ -3934,7 +3945,8 @@
continue;
// get the approximate position of the spawn
- up2date = spawn->approximatePosition(m_animate, drawTime, location);
+ //up2date = spawn->approximatePosition(m_animate, drawTime, location);
+ spawn->approximatePosition(m_animate, drawTime, location);
// check that the spawn is within the screen bounds
if (!inRect(screenBounds, location.x(), location.y()))
@@ -4393,7 +4405,7 @@
// spawn time
if ( createDate != QDate::currentDate() )
- spawned = createDate.shortDayName( createDate.dayOfWeek() ) + " ";
+ spawned = QLocale().dayName(createDate.dayOfWeek(), QLocale::ShortFormat) + " ";
spawned += dateTime.time().toString();
@@ -5383,10 +5395,18 @@
tmpButton = new QToolButton();
tmpButton->setDefaultAction(tmpAction);
tmpButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
+#if (QT_VERSION >= QT_VERSION_CHECK(5,11,0))
+ tmpButton->setMinimumWidth(fontMetrics().horizontalAdvance(label));
+#else
tmpButton->setMinimumWidth(fontMetrics().width(label));
+#endif
layersBoxLayout->addWidget(tmpButton);
+#if (QT_VERSION >= QT_VERSION_CHECK(5,11,0))
+ w += fontMetrics().horizontalAdvance(label);
+#else
w += fontMetrics().width(label);
+#endif
connect(tmpButton, SIGNAL(triggered(QAction*)),
m_map, SLOT(toggleMapLayerVisibility(QAction*)));
@@ -5429,7 +5449,8 @@
void MapFrame::init_Menu(void)
{
- QMenu* mapMenu = m_map->menu();
+ //QMenu* mapMenu = m_map->menu();
+ m_map->menu();
m_action_topControl->setChecked(m_topControlBox->isVisible());
if (m_topControlBox->isVisible())
{
Modified: showeq/branches/cn187_devel/src/map.h
===================================================================
--- showeq/branches/cn187_devel/src/map.h 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/map.h 2023-05-24 22:21:10 UTC (rev 1382)
@@ -44,6 +44,7 @@
#include <QDateTime>
#include <QPen>
#include <QBrush>
+#include <QElapsedTimer>
// includes required for MapMenu
#include <QMenu>
@@ -616,7 +617,7 @@
#ifdef DEBUG
// debug timing info
- QTime m_time;
+ QElapsedTimer m_time;
int m_frameTimes[maxFrameTimes];
int m_frameTimeIndex;
int m_paintCount;
Modified: showeq/branches/cn187_devel/src/mapcore.cpp
===================================================================
--- showeq/branches/cn187_devel/src/mapcore.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/mapcore.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -541,7 +541,11 @@
QRegExp lineTerm("[\r\n]{1,2}");
// split the data into lines at the line termination
+#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
+ QStringList lines = QString::fromUtf8(textData).split(lineTerm, Qt::SkipEmptyParts);
+#else
QStringList lines = QString::fromUtf8(textData).split(lineTerm, QString::SkipEmptyParts);
+#endif
// start iterating over the lines
@@ -940,7 +944,7 @@
int16_t x2, y2, z2;
MapPoint src, dest, oldSrc;
uint8_t r, g, b;
- uint32_t numPoints = 0;
+ int32_t numPoints = 0;
uint32_t checkPoint = 0;
int filelines = 1; // number of lines in map file
QString name;
@@ -988,7 +992,11 @@
QRegExp lineTerm("[\r\n]{1,2}");
// split the data into lines at the line termination
+#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
+ QStringList lines = QString::fromUtf8(textData).split(lineTerm, Qt::SkipEmptyParts);
+#else
QStringList lines = QString::fromUtf8(textData).split(lineTerm, QString::SkipEmptyParts);
+#endif
// start iterating over the lines
@@ -1181,7 +1189,6 @@
qDebug ("saveMap()");
#endif /* DEBUG */
FILE * fh;
- uint32_t i;
if ((fh = fopen(fileName.toLatin1().data(), "w")) == NULL)
{
@@ -1229,7 +1236,7 @@
currentLineL->size());
// write out all the 2D points in the line
- for(i = 0; i < currentLineL->size(); i++)
+ for(int32_t i = 0; i < currentLineL->size(); i++)
{
QPoint curQPoint = currentLineL->point(i);
fprintf (fh, ",%d,%d", curQPoint.x(), curQPoint.y());
@@ -1253,7 +1260,7 @@
currentLineM->size());
// write out all the 3D points in the line
- for(i = 0; i < currentLineM->size(); i++)
+ for(int32_t i = 0; i < currentLineM->size(); i++)
{
MapPoint curMPoint = currentLineM->point(i);
@@ -1313,7 +1320,6 @@
qDebug ("saveMap()");
#endif /* DEBUG */
FILE * fh;
- uint i;
if ((fh = fopen(fileName.toLatin1().data(), "w")) == NULL)
{
@@ -1340,7 +1346,7 @@
QPoint lastQPoint = currentLineL->point(0);
// write out all the 2D points in the line
- for(i = 1; i < currentLineL->size(); ++i)
+ for(int32_t i = 1; i < currentLineL->size(); ++i)
{
const QPoint& curQPoint = currentLineL->point(i);
@@ -1371,7 +1377,7 @@
MapPoint lastMPoint = currentLineM->point(0);
// write out all the 3D points in the line
- for(i = 1; i < currentLineM->size() ; ++i)
+ for(int32_t i = 1; i < currentLineM->size() ; ++i)
{
const MapPoint& curMPoint = currentLineM->point(i);
Modified: showeq/branches/cn187_devel/src/mapicon.cpp
===================================================================
--- showeq/branches/cn187_devel/src/mapicon.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/mapicon.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -34,7 +34,6 @@
#include <QTextStream>
#include <QPolygon>
-#pragma message("Once our minimum supported Qt version is greater than 5.14, this check can be removed and ENDL replaced with Qt::endl")
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
#define ENDL Qt::endl
#else
@@ -976,7 +975,11 @@
if (mapIcon.showName())
{
QFontMetrics fm(param.font());
+#if (QT_VERSION >= QT_VERSION_CHECK(5,11,0))
+ int width = fm.horizontalAdvance(itemName);
+#else
int width = fm.width(itemName);
+#endif
p.setPen(Qt::gray);
p.drawText(point.x() - (width / 2),
point.y() + fm.height() + 1, itemName);
@@ -1048,6 +1051,9 @@
x_1 = trackPoint->x();
y_1 = trackPoint->y();
+ x_2 = x_1;
+ y_2 = y_1;
+
while (trackIt.hasNext())
{
trackPoint = trackIt.next();
@@ -1123,7 +1129,11 @@
#endif
QFontMetrics fm(param.font());
+#if (QT_VERSION >= QT_VERSION_CHECK(5,11,0))
+ int width = fm.horizontalAdvance(spawnNameText);
+#else
int width = fm.width(spawnNameText);
+#endif
p.setPen(Qt::gray);
p.drawText(point.x() - (width / 2),
point.y() + fm.height() + 1, spawnNameText);
@@ -1245,7 +1255,11 @@
#endif
QFontMetrics fm(param.font());
+#if (QT_VERSION >= QT_VERSION_CHECK(5,11,0))
+ int width = fm.horizontalAdvance(spawnNameText);
+#else
int width = fm.width(spawnNameText);
+#endif
p.setPen(Qt::gray);
p.drawText(point.x() - (width / 2),
point.y() + fm.height() + 1, spawnNameText);
Modified: showeq/branches/cn187_devel/src/messageshell.cpp
===================================================================
--- showeq/branches/cn187_devel/src/messageshell.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/messageshell.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -691,7 +691,10 @@
const spellFadedStruct *sf = (const spellFadedStruct *)data;
QString tempStr;
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
if (strlen(sf->message) > 0)
+#pragma GCC diagnostic pop
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
tempStr = QString::asprintf( "Faded: %s", sf->message);
Modified: showeq/branches/cn187_devel/src/messagewindow.cpp
===================================================================
--- showeq/branches/cn187_devel/src/messagewindow.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/messagewindow.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -48,7 +48,6 @@
#include <QMouseEvent>
#include <QEvent>
-#pragma message("Once our minimum supported Qt version is greater than 5.14, this check can be removed and ENDL replaced with Qt::endl")
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
#define ENDL Qt::endl
#else
Modified: showeq/branches/cn187_devel/src/packetinfo.cpp
===================================================================
--- showeq/branches/cn187_devel/src/packetinfo.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/packetinfo.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -30,6 +30,7 @@
#include <QXmlAttributes>
#include <QTextStream>
#include <QByteArray>
+#include <QXmlStreamReader>
#include <map>
@@ -38,7 +39,6 @@
#include "everquest.h"
#include "diagnosticmessages.h"
-#pragma message("Once our minimum supported Qt version is greater than 5.14, this check can be removed and ENDL replaced with Qt::endl")
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
#define ENDL Qt::endl
#else
@@ -53,7 +53,7 @@
//----------------------------------------------------------------------
// OPCodeXmlContentHandler declaration
-class OPCodeXmlContentHandler : public QXmlDefaultHandler
+class OPCodeXmlContentHandler : public QObject
{
public:
OPCodeXmlContentHandler(const EQPacketTypeDB& typeDB,
@@ -63,7 +63,7 @@
// QXmlContentHandler overrides
bool startDocument();
bool startElement( const QString&, const QString&, const QString& ,
- const QXmlAttributes& );
+ const QXmlStreamAttributes& );
bool characters(const QString& ch);
bool endElement( const QString&, const QString&, const QString& );
bool endDocument();
@@ -296,6 +296,8 @@
const QString& filename)
{
// load opcodes
+ if (filename.isEmpty())
+ return false;
// create XML content handler
OPCodeXmlContentHandler handler(typeDB, *this);
@@ -302,18 +304,53 @@
// create a file object on the file
QFile xmlFile(filename);
+ xmlFile.open(QIODevice::ReadOnly);
+ if (!xmlFile.isOpen())
+ return false;
- // create an XmlInputSource on the file
- QXmlInputSource source(&xmlFile);
-
- // create an XML parser
- QXmlSimpleReader reader;
+ QXmlStreamReader reader(&xmlFile);
- // set the content handler
- reader.setContentHandler(&handler);
+ bool status = true;
+ while(!reader.atEnd() && status)
+ {
+ switch(reader.readNext())
+ {
+ case QXmlStreamReader::NoToken:
+ break;
+ case QXmlStreamReader::Invalid:
+ status = false;
+ break;
+ case QXmlStreamReader::StartDocument:
+ if (!handler.startDocument())
+ status = false;
+ break;
+ case QXmlStreamReader::EndDocument:
+ if (!handler.endDocument())
+ status = false;
+ break;
+ case QXmlStreamReader::StartElement:
+ if (!handler.startElement(QString(), QString(), reader.name().toString(), reader.attributes()))
+ status = false;
+ break;
+ case QXmlStreamReader::EndElement:
+ if (!handler.endElement(QString(), QString(), reader.name().toString()))
+ status = false;
+ break;
+ case QXmlStreamReader::Characters:
+ if (!handler.characters(reader.text().toString()))
+ status = false;
+ break;
+ case QXmlStreamReader::Comment:
+ case QXmlStreamReader::DTD:
+ case QXmlStreamReader::EntityReference:
+ case QXmlStreamReader::ProcessingInstruction:
+ break;
+ }
+ }
- // parse the file
- return reader.parse(source);
+ xmlFile.close();
+
+ return status;
}
bool EQPacketOPCodeDB::save(const QString& filename)
@@ -590,15 +627,13 @@
bool OPCodeXmlContentHandler::startElement(const QString&, const QString&,
const QString& name,
- const QXmlAttributes& attr)
+ const QXmlStreamAttributes& attr)
{
if (name == "opcode")
{
bool ok = false;
- // get the index of the id attribute
- int index = attr.index("id");
- if (index == -1)
+ if (attr.value("id").isEmpty())
{
seqWarn("OPCodeXmlContentHandler::startElement(): opcode element without id!");
@@ -606,7 +641,7 @@
}
// the id attribute is the opcode value
- uint16_t opcode = attr.value(index).toUShort(&ok, 16);
+ uint16_t opcode = attr.value("id").toString().toUShort(&ok, 16);
#if 0 // ZBTEMP
opcode += 2;
@@ -615,16 +650,13 @@
if (!ok)
{
seqWarn("OPCodeXmlContentHandler::startElement(): opcode '%s' failed to convert to uint16_t (result: %#04x)",
- attr.value(index).toLatin1().data(), opcode);
+ attr.value("id").toString().toLatin1().data(), opcode);
return false; // this is an error
}
- // get the index of the name attribute
- index = attr.index("name");
-
// if name attribute was found, set the opcode objects name
- if (index == -1)
+ if (attr.value("name").isEmpty())
{
seqWarn("OPCodeXmlContentHandler::startElement(): opcode %#04x missing name parameter!",
opcode);
@@ -633,7 +665,7 @@
}
// add/create the new opcode object
- m_currentOPCode = m_opcodeDB.add(opcode, attr.value(index));
+ m_currentOPCode = m_opcodeDB.add(opcode, attr.value("name").toString());
if (!m_currentOPCode)
{
@@ -642,19 +674,13 @@
}
- // get the index of the updated attribute
- index = attr.index("updated");
-
// if the updated attribute was found, set the objects updated field
- if (index != -1)
- m_currentOPCode->setUpdated(attr.value(index));
+ if (!attr.value("updated").isEmpty())
+ m_currentOPCode->setUpdated(attr.value("updated").toString());
- // get the index of the implicitlen attribute
- index = attr.index("implicitlen");
-
// if implicitlen attribute was found, set the objects implicitLen field
- if (index != -1)
- m_currentOPCode->setImplicitLen(attr.value(index).toUShort());
+ if (!attr.value("implicitlen").isEmpty())
+ m_currentOPCode->setImplicitLen(attr.value("implicitlen").toString().toUShort());
return true;
}
@@ -676,53 +702,44 @@
// add the payload object to the opcode
m_currentOPCode->append(m_currentPayload);
- // check for direction attribute
- int index = attr.index("dir");
-
- // if an index attribute exists, then use it
- if (index != -1)
+ if (!attr.value("dir").isEmpty())
{
- QString value = attr.value(index);
+ QString value = attr.value("dir").toString();
if (value == "both")
- m_currentPayload->setDir(DIR_Client | DIR_Server);
+ m_currentPayload->setDir(DIR_Client | DIR_Server);
else if (value == "server")
- m_currentPayload->setDir(DIR_Server);
+ m_currentPayload->setDir(DIR_Server);
else if (value == "client")
- m_currentPayload->setDir(DIR_Client);
+ m_currentPayload->setDir(DIR_Client);
}
- // get the typename attribute
- index = attr.index("typename");
-
// if a typename attribute exist, then set the payload type
- if (index != -1)
+ if (!attr.value("typename").isEmpty())
{
- QString value = attr.value(index);
-
- if (!value.isEmpty())
- {
- if (!m_currentPayload->setType(m_typeDB, value.toLatin1().data()))
- seqWarn("Unknown payload typename '%s' for opcode '%04x'",
- value.toLatin1().data(), m_currentOPCode->opcode());
- }
+ QString value = attr.value("typename").toString();
+
+ if (!m_currentPayload->setType(m_typeDB, value.toLatin1().data()))
+ seqWarn("Unknown payload typename '%s' for opcode '%04x'",
+ value.toLatin1().data(), m_currentOPCode->opcode());
}
- // attempt to retrieve the sizechecktype
- index = attr.index("sizechecktype");
-
// if a sizechecktype exists, then set the payload size check type
- if (index != -1)
+ if (!attr.value("sizechecktype").isEmpty())
{
- QString value = attr.value(index);
+ QString value = attr.value("sizechecktype").toString();
- if (value.isEmpty() || (value == "none"))
- m_currentPayload->setSizeCheckType(SZC_None);
+ if (value == "none")
+ m_currentPayload->setSizeCheckType(SZC_None);
else if (value == "match")
- m_currentPayload->setSizeCheckType(SZC_Match);
+ m_currentPayload->setSizeCheckType(SZC_Match);
else if (value == "modulus")
- m_currentPayload->setSizeCheckType(SZC_Modulus);
+ m_currentPayload->setSizeCheckType(SZC_Modulus);
}
+ else
+ {
+ m_currentPayload->setSizeCheckType(SZC_None);
+ }
return true;
}
Modified: showeq/branches/cn187_devel/src/packetlog.cpp
===================================================================
--- showeq/branches/cn187_devel/src/packetlog.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/packetlog.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -29,7 +29,6 @@
#include "decode.h"
#include "diagnosticmessages.h"
-#pragma message("Once our minimum supported Qt version is greater than 5.14, this check can be removed and ENDL replaced with Qt::endl")
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
#define ENDL Qt::endl
#else
Modified: showeq/branches/cn187_devel/src/packetstream.cpp
===================================================================
--- showeq/branches/cn187_devel/src/packetstream.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/packetstream.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -125,7 +125,7 @@
return false;
}
- EQPacketPayload* payload;
+ EQPacketPayload* payload = NULL;
// try to find a matching payload for this opcode
EQPayloadListIterator pit(*opcode);
Modified: showeq/branches/cn187_devel/src/pointarray.h
===================================================================
--- showeq/branches/cn187_devel/src/pointarray.h 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/pointarray.h 2023-05-24 22:21:10 UTC (rev 1382)
@@ -90,7 +90,7 @@
minX = maxX = d->x();
minY = maxY = d->y();
- uint32_t i;
+ int32_t i;
for (++d, i = 1;
i < QVector<Point3D<_T> >::size();
i++, d++)
Modified: showeq/branches/cn187_devel/src/sortitem.cpp
===================================================================
--- showeq/branches/cn187_devel/src/sortitem.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/sortitem.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -27,7 +27,6 @@
#include "util.h"
-#pragma message("Once our minimum supported Qt version is greater than 5.14, this check can be removed and ENDL replaced with Qt::endl")
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
#define ENDL Qt::endl
#else
Modified: showeq/branches/cn187_devel/src/spawn.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spawn.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/spawn.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -241,8 +241,8 @@
m_NPC(99), // random bogus value
m_type(t)
{
- m_spawnTime.start();
- m_lastUpdate.start();
+ m_spawnTime = QTime::currentTime();
+ m_lastUpdate = QTime::currentTime();
updateLastChanged();
}
Modified: showeq/branches/cn187_devel/src/spawn.h
===================================================================
--- showeq/branches/cn187_devel/src/spawn.h 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/spawn.h 2023-05-24 22:21:10 UTC (rev 1382)
@@ -175,7 +175,7 @@
void updateLast()
{
- m_lastUpdate.restart();
+ m_lastUpdate = QTime::currentTime();
}
void updateLastChanged()
{
Modified: showeq/branches/cn187_devel/src/spawnlist.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spawnlist.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/spawnlist.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -538,7 +538,7 @@
while (litem)
{
// is it open
- if (!isItemExpanded(litem))
+ if (!litem->isExpanded())
{
// nope, stop looking at the parents, next item
bOpen = false;
Modified: showeq/branches/cn187_devel/src/spawnlist2.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spawnlist2.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/spawnlist2.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -639,7 +639,7 @@
// iterate over all spawn types
for (uint8_t i = 0; i < (sizeof(types) / sizeof(spawnItemType)) ; i++)
{
- uint8_t level = 0;
+ /* not used */ //uint8_t level = 0;
const ItemMap& itemMap = m_spawnShell->getConstMap(types[i]);
ItemConstIterator it(itemMap);
@@ -675,7 +675,7 @@
// if item is a spawn get its level
if (item->type() == tSpawn)
- level = ((Spawn*)item)->level();
+ //level = ((Spawn*)item)->level();
// if this item doesn't fit the filter
Modified: showeq/branches/cn187_devel/src/spawnlistcommon.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spawnlistcommon.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/spawnlistcommon.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -357,7 +357,7 @@
{
QColor fg = qApp->palette().color(QPalette::WindowText);
- QColor bg = qApp->palette().color(QPalette::Base);
+ /* not currently used */ //QColor bg = qApp->palette().color(QPalette::Base);
//Black is the parameter default, so if it's black, we should use the
//foreground color instead. That way we won't wind up with black text by
Modified: showeq/branches/cn187_devel/src/spawnpointlist.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spawnpointlist.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/spawnpointlist.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -29,6 +29,7 @@
#include <QFontDialog>
#include <QPainter>
#include <QLayout>
+#include <QLocale>
#include <QMenu>
#include <QHeaderView>
@@ -97,8 +98,8 @@
tmpStr = "";
// spawn time
if ( createDate != QDate::currentDate() )
- tmpStr = createDate.shortDayName( createDate.dayOfWeek() ) + " ";
-
+ tmpStr = QLocale().dayName(createDate.dayOfWeek(), QLocale::ShortFormat ) + " ";
+
tmpStr += dateTime.time().toString();
// set when it spawned and the count
Modified: showeq/branches/cn187_devel/src/spawnshell.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spawnshell.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/spawnshell.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -48,7 +48,6 @@
#include <cmath>
-#pragma message("Once our minimum supported Qt version is greater than 5.14, this check can be removed and ENDL replaced with Qt::endl")
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
#define ENDL Qt::endl
#else
@@ -759,7 +758,7 @@
name = netStream.readText();
- if(name.length() > 0 && name.length() < sizeof(spawn->lastName))
+ if(name.length() > 0 && (unsigned int)name.length() < sizeof(spawn->lastName))
{
strcpy(spawn->lastName, name.toLatin1().data());
}
@@ -807,7 +806,7 @@
spawn->equipment[8].equip0 = netStream.readUInt32NC();
}
- for (int i = 0; i < (sizeof(spawn->posData)/sizeof(spawn->posData[0])); ++i) {
+ for (size_t i = 0; i < (sizeof(spawn->posData)/sizeof(spawn->posData[0])); ++i) {
spawn->posData[i] = netStream.readUInt32NC();
}
@@ -1116,12 +1115,13 @@
int16_t deltaZ = 0;
int8_t deltaHeading = 0;
int16_t velocity = 0;
- int16_t pitch = 0;
+ //int16_t pitch = 0;
if (fieldSpecifier & MASK_PITCH)
{
// Pull off pitch. Seq doesn't pay attention to this.
- pitch = stream.readInt(12);
+ //pitch = stream.readInt(12);
+ stream.readInt(12); //not used, so ignore/skip
}
if (fieldSpecifier & MASK_DELTA_HEADING)
{
Modified: showeq/branches/cn187_devel/src/spells.cpp
===================================================================
--- showeq/branches/cn187_devel/src/spells.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/spells.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -281,7 +281,11 @@
text = QString::fromUtf16((uint16_t*)textData.data());
// split the file into at the line termination
+#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
+ QStringList lines = text.split(lineTerm, Qt::SkipEmptyParts);
+#else
QStringList lines = text.split(lineTerm, QString::SkipEmptyParts);
+#endif
Spell* newSpell;
Modified: showeq/branches/cn187_devel/src/vpacket.cpp
===================================================================
--- showeq/branches/cn187_devel/src/vpacket.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/vpacket.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -164,7 +164,6 @@
int
VPacket::Record(const char *buff, int packetsize, time_t time, long version)
{
- int size;
int bufsize;
int headersize = sizeof(struct packet_struct);
struct packet_struct *packet;
@@ -215,19 +214,17 @@
m_nBufIndex += packetsize;
m_nSequence++;
- size = packetsize;
-
#ifdef DEBUG_VPACKET
printf("Record: %06d:%06d: %04d bytes: 0x %02x%02x%02x%02x ... %02x%02x%02x%02x\n",
- packet->sequence, packet->ms, size,
+ packet->sequence, packet->ms, packetsize,
(unsigned char) packet->buffer[0],
(unsigned char) packet->buffer[1],
(unsigned char) packet->buffer[2],
(unsigned char) packet->buffer[3],
- (unsigned char) packet->buffer[size - 4],
- (unsigned char) packet->buffer[size - 3],
- (unsigned char) packet->buffer[size - 2],
- (unsigned char) packet->buffer[size - 1]);
+ (unsigned char) packet->buffer[packetsize - 4],
+ (unsigned char) packet->buffer[packetsize - 3],
+ (unsigned char) packet->buffer[packetsize - 2],
+ (unsigned char) packet->buffer[packetsize - 1]);
#endif
// flushes every packet
Modified: showeq/branches/cn187_devel/src/xmlconv.cpp
===================================================================
--- showeq/branches/cn187_devel/src/xmlconv.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/xmlconv.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -44,11 +44,13 @@
#include <QDomElement>
// borrowed with mods from Qt 3.2
+/* not used
static bool ok_in_hex( QChar c)
{
return c.isDigit() || (c >= 'a' && c < char('a'+6))
|| (c >= 'A' && c < char('A'+6));
}
+*/
DomConvenience::DomConvenience(QDomDocument& doc)
: m_doc(doc)
@@ -266,7 +268,7 @@
QStringList stringList;
QDomElement stringElement;
- for (uint i = 0; i < stringNodeList.length(); i++)
+ for (int i = 0; i < stringNodeList.length(); i++)
{
stringElement = stringNodeList.item(i).toElement();
if (!stringElement.hasAttribute("value"))
@@ -333,30 +335,28 @@
e.setTagName("uint");
e.setAttribute("value", v.toUInt());
break;
- case QMetaType::Long:
case QMetaType::LongLong:
{
e.setTagName("int64");
QString val;
#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
- val = QString::asprintf("%0.16llx", v.toLongLong());
+ val = QString::asprintf("%016llx", v.toLongLong());
#else
val = v.toLongLong();
- val.sprintf("%0.16llx", v.toLongLong());
+ val.sprintf("%016llx", v.toLongLong());
#endif
e.setAttribute("value", val);
break;
}
- case QMetaType::ULong:
case QMetaType::ULongLong:
{
e.setTagName("uint64");
QString val;
#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
- val = QString::asprintf("%0.16llx", v.toULongLong());
+ val = QString::asprintf("%016llx", v.toULongLong());
#else
val = v.toULongLong();
- val.sprintf("%0.16llx", v.toULongLong());
+ val.sprintf("%016llx", v.toULongLong());
#endif
e.setAttribute("value", val);
break;
@@ -456,7 +456,7 @@
case QMetaType::QStringList:
{
e.setTagName("stringlist");
- uint j;
+ int j;
QDomNode n;
QDomNodeList stringNodeList = e.elementsByTagName("string");
Modified: showeq/branches/cn187_devel/src/xmlpreferences.cpp
===================================================================
--- showeq/branches/cn187_devel/src/xmlpreferences.cpp 2023-05-23 22:28:06 UTC (rev 1381)
+++ showeq/branches/cn187_devel/src/xmlpreferences.cpp 2023-05-24 22:21:10 UTC (rev 1382)
@@ -156,10 +156,10 @@
QString propertyName;
QDomNode n;
QDomElement valueElement;
- bool foundValue;
+ /* not used*/ //bool foundValue;
sectionList = doc.elementsByTagName("section");
- for (uint i = 0; i < sectionList.length(); i++)
+ for (int i = 0; i < sectionList.length(); i++)
{
section = sectionList.item(i).toElement();
if (!section.hasAttribute("name"))
@@ -198,7 +198,7 @@
propertyList = section.elementsByTagName("property");
- for (uint j = 0; j < propertyList.length(); j++)
+ for (int j = 0; j < propertyList.length(); j++)
{
property = propertyList.item(j).toElement();
if (!property.hasAttribute("name"))
@@ -210,7 +210,7 @@
propertyName = property.attribute("name");
- foundValue = false;
+ //foundValue = false;
QVariant value;
// iterate over the nodes under the property
@@ -252,7 +252,7 @@
}
// found the value
- foundValue = true;
+ //foundValue = true;
// insert value into the section dictionary
sectionDict->insert(propertyName, new QVariant(value));
@@ -347,7 +347,7 @@
sectionDict = sdit.value();
// iterate over all the sections in the document
- for (uint i = 0; i < sectionList.length(); i++)
+ for (int i = 0; i < sectionList.length(); i++)
{
e = sectionList.item(i).toElement();
if (!e.hasAttribute("name"))
@@ -394,7 +394,7 @@
propertyList = section.elementsByTagName("property");
// iterate over all the property elements until a match is found
- for (uint j = 0; j < propertyList.length(); j++)
+ for (int j = 0; j < propertyList.length(); j++)
{
e = propertyList.item(j).toElement();
if (!e.hasAttribute("name"))
@@ -748,7 +748,7 @@
{
int64_t value = def;
- switch(preference->type())
+ switch((QMetaType::Type)preference->type())
{
case QMetaType::QString:
// convert it to a uint64_t (in base 16)
@@ -757,8 +757,8 @@
break;
case QMetaType::UInt:
case QMetaType::Int:
+ case QMetaType::ULong:
case QMetaType::Long:
- case QMetaType::ULong:
case QMetaType::ULongLong:
case QMetaType::LongLong:
@@ -800,7 +800,7 @@
{
uint64_t value = def;
- switch(preference->type())
+ switch((QMetaType::Type)preference->type())
{
case QMetaType::QString:
// convert it to a uint64_t (in base 16)
@@ -809,8 +809,8 @@
break;
case QMetaType::UInt:
case QMetaType::Int:
+ case QMetaType::ULong:
case QMetaType::Long:
- case QMetaType::ULong:
case QMetaType::ULongLong:
case QMetaType::LongLong:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|