|
From: <cn...@us...> - 2020-11-02 01:42:15
|
Revision: 1092
http://sourceforge.net/p/seq/svn/1092
Author: cn187
Date: 2020-11-02 01:42:12 +0000 (Mon, 02 Nov 2020)
Log Message:
-----------
Replace compatibility/deprecated functions with Qt4 equivalents
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/mapicondialog.ui.h
showeq/branches/pre_6_0_beta/src/netdiag.cpp
showeq/branches/pre_6_0_beta/src/packet.cpp
showeq/branches/pre_6_0_beta/src/packetinfo.cpp
showeq/branches/pre_6_0_beta/src/packetlog.cpp
showeq/branches/pre_6_0_beta/src/packetstream.cpp
showeq/branches/pre_6_0_beta/src/player.cpp
showeq/branches/pre_6_0_beta/src/seqlistview.cpp
showeq/branches/pre_6_0_beta/src/seqwindow.cpp
showeq/branches/pre_6_0_beta/src/spawn.cpp
showeq/branches/pre_6_0_beta/src/spawnlist.cpp
showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
showeq/branches/pre_6_0_beta/src/spawnlist2.h
showeq/branches/pre_6_0_beta/src/spawnlistcommon.cpp
showeq/branches/pre_6_0_beta/src/spawnlistcommon.h
showeq/branches/pre_6_0_beta/src/spawnlog.cpp
showeq/branches/pre_6_0_beta/src/spawnmonitor.cpp
showeq/branches/pre_6_0_beta/src/spawnpointlist.cpp
showeq/branches/pre_6_0_beta/src/spawnpointlist.h
showeq/branches/pre_6_0_beta/src/spawnshell.cpp
showeq/branches/pre_6_0_beta/src/spelllist.cpp
showeq/branches/pre_6_0_beta/src/spelllist.h
showeq/branches/pre_6_0_beta/src/spells.cpp
showeq/branches/pre_6_0_beta/src/spellshell.cpp
showeq/branches/pre_6_0_beta/src/terminal.cpp
showeq/branches/pre_6_0_beta/src/util.cpp
showeq/branches/pre_6_0_beta/src/xmlconv.cpp
showeq/branches/pre_6_0_beta/src/xmlpreferences.cpp
showeq/branches/pre_6_0_beta/src/zonemgr.cpp
Modified: showeq/branches/pre_6_0_beta/src/mapicondialog.ui.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/mapicondialog.ui.h 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/mapicondialog.ui.h 2020-11-02 01:42:12 UTC (rev 1092)
@@ -40,48 +40,48 @@
// get image settings
m_currentMapIcon.setImage(m_useImage->isChecked());
- m_currentMapIcon.setImageStyle(MapIconStyle(m_imageImage->currentItem()));
- m_currentMapIcon.setImageSize(MapIconSize(m_imageSize->currentItem()));
+ m_currentMapIcon.setImageStyle(MapIconStyle(m_imageImage->currentIndex()));
+ m_currentMapIcon.setImageSize(MapIconSize(m_imageSize->currentIndex()));
m_currentMapIcon.setImageFlash(m_imageFlash->isChecked());
m_currentMapIcon.setImageUseSpawnColorPen(m_imageUseSpawnColorPen->isChecked());
pen = m_currentMapIcon.imagePen();
- pen.setStyle(Qt::PenStyle(m_imagePenStyle->currentItem()));
+ pen.setStyle(Qt::PenStyle(m_imagePenStyle->currentIndex()));
pen.setWidth(m_imagePenWidth->value());
m_currentMapIcon.setImagePen(pen);
m_currentMapIcon.setImageUseSpawnColorBrush(m_imageUseSpawnColorBrush->isChecked());
brush = m_currentMapIcon.imageBrush();
- brush.setStyle(Qt::BrushStyle(m_imageBrushStyle->currentItem()));
+ brush.setStyle(Qt::BrushStyle(m_imageBrushStyle->currentIndex()));
m_currentMapIcon.setImageBrush(brush);
// get highlight settings
m_currentMapIcon.setHighlight(m_useHighlight->isChecked());
- m_currentMapIcon.setHighlightStyle(MapIconStyle(m_highlightImage->currentItem()));
- m_currentMapIcon.setHighlightSize(MapIconSize(m_highlightSize->currentItem()));
+ m_currentMapIcon.setHighlightStyle(MapIconStyle(m_highlightImage->currentIndex()));
+ m_currentMapIcon.setHighlightSize(MapIconSize(m_highlightSize->currentIndex()));
m_currentMapIcon.setHighlightFlash(m_highlightFlash->isChecked());
m_currentMapIcon.setHighlightUseSpawnColorPen(m_highlightUseSpawnColorPen->isChecked());
pen = m_currentMapIcon.highlightPen();
- pen.setStyle(Qt::PenStyle(m_highlightPenStyle->currentItem()));
+ pen.setStyle(Qt::PenStyle(m_highlightPenStyle->currentIndex()));
pen.setWidth(m_highlightPenWidth->value());
m_currentMapIcon.setHighlightPen(pen);
m_currentMapIcon.setHighlightUseSpawnColorBrush(m_highlightUseSpawnColorBrush->isChecked());
brush = m_currentMapIcon.highlightBrush();
- brush.setStyle(Qt::BrushStyle(m_highlightBrushStyle->currentItem()));
+ brush.setStyle(Qt::BrushStyle(m_highlightBrushStyle->currentIndex()));
m_currentMapIcon.setHighlightBrush(brush);
// get line settings
m_currentMapIcon.setShowLine0(m_showLine0->isChecked());
pen = m_currentMapIcon.line0Pen();
- pen.setStyle(Qt::PenStyle(m_line0PenStyle->currentItem()));
+ pen.setStyle(Qt::PenStyle(m_line0PenStyle->currentIndex()));
pen.setWidth(m_line0PenWidth->value());
m_currentMapIcon.setLine0Pen(pen);
m_currentMapIcon.setLine1Distance(m_line1Distance->value());
pen = m_currentMapIcon.line1Pen();
- pen.setStyle(Qt::PenStyle(m_line1PenStyle->currentItem()));
+ pen.setStyle(Qt::PenStyle(m_line1PenStyle->currentIndex()));
pen.setWidth(m_line1PenWidth->value());
m_currentMapIcon.setLine1Pen(pen);
m_currentMapIcon.setLine2Distance(m_line2Distance->value());
pen = m_currentMapIcon.line2Pen();
- pen.setStyle(Qt::PenStyle(m_line2PenStyle->currentItem()));
+ pen.setStyle(Qt::PenStyle(m_line2PenStyle->currentIndex()));
pen.setWidth(m_line2PenWidth->value());
m_currentMapIcon.setLine2Pen(pen);
@@ -90,7 +90,7 @@
m_currentMapIcon.setShowWalkPath(m_showWalkPath->isChecked());
m_currentMapIcon.setUseWalkPathPen(m_useWalkPathPen->isChecked());
pen = m_currentMapIcon.walkPathPen();
- pen.setStyle(Qt::PenStyle(m_walkPathPenStyle->currentItem()));
+ pen.setStyle(Qt::PenStyle(m_walkPathPenStyle->currentIndex()));
pen.setWidth(m_walkPathPenWidth->value());
m_currentMapIcon.setWalkPathPen(pen);
@@ -124,8 +124,8 @@
QString temp;
// setup the map icons combo box
for (int i = tIconTypeDrop; i <= tIconTypeMax; i++)
- m_mapIconCombo->insertItem(MapIcons::iconTypeName((MapIconType)i), i-1);
-
+ m_mapIconCombo->insertItem(i-1, MapIcons::iconTypeName((MapIconType)i));
+
int sizeWH = m_mapIconCombo->height() - 8;
int size = sizeWH >> 1;
QPoint point(size, size);
@@ -134,57 +134,57 @@
QPen pen(Qt::black, 0, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin);
for (int i = tIconStyleNone; i <= tIconStyleMax; i++)
{
- pix.fill(Qt::white);
- QPainter p(&pix);
- p.setPen(pen);
- p.setBrush(QBrush(Qt::gray));
- MapIcon::paintIconImage(MapIconStyle(i), p, point, size, sizeWH);
- p.end();
-
- temp = MapIcon::iconStyleName((MapIconStyle)i);
- m_imageImage->insertItem(pix, temp, i);
- m_highlightImage->insertItem(pix, temp, i);
+ pix.fill(Qt::white);
+ QPainter p(&pix);
+ p.setPen(pen);
+ p.setBrush(QBrush(Qt::gray));
+ MapIcon::paintIconImage(MapIconStyle(i), p, point, size, sizeWH);
+ p.end();
+
+ temp = MapIcon::iconStyleName((MapIconStyle)i);
+ m_imageImage->insertItem(i, pix, temp);
+ m_highlightImage->insertItem(i, pix, temp);
}
-
+
// setup the image sizes
for (int i = tIconSizeNone; i <= tIconSizeMax; i++)
{
- temp = MapIcon::iconSizeName((MapIconSize)i);
- m_imageSize->insertItem(temp, i);
- m_highlightSize->insertItem(temp, i);
+ temp = MapIcon::iconSizeName((MapIconSize)i);
+ m_imageSize->insertItem(i, temp);
+ m_highlightSize->insertItem(i, temp);
}
-
+
const QString penStyleNames[] =
{
- "None",
- "Solid",
- "Dash",
- "Dot",
- "Dash Dot",
- "Dash Dot Dot"
+ "None",
+ "Solid",
+ "Dash",
+ "Dot",
+ "Dash Dot",
+ "Dash Dot Dot"
};
-
+
// setup pen style names
pen = QPen(Qt::black, 0, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin);
for (int i = Qt::NoPen; i <= Qt::DashDotDotLine; i++)
{
- pix.fill(Qt::white);
- QPainter p(&pix);
- pen.setStyle(Qt::PenStyle(i));
- p.setPen(pen);
- p.setBrush(QBrush(Qt::gray));
- p.drawLine(point.x() - size, point.y() - size,
- point.x() + size, point.y() + size);
- p.end();
+ pix.fill(Qt::white);
+ QPainter p(&pix);
+ pen.setStyle(Qt::PenStyle(i));
+ p.setPen(pen);
+ p.setBrush(QBrush(Qt::gray));
+ p.drawLine(point.x() - size, point.y() - size,
+ point.x() + size, point.y() + size);
+ p.end();
- m_imagePenStyle->insertItem(pix, penStyleNames[i], i);
- m_highlightPenStyle->insertItem(pix, penStyleNames[i], i);
- m_line0PenStyle->insertItem(pix, penStyleNames[i], i);
- m_line1PenStyle->insertItem(pix, penStyleNames[i], i);
- m_line2PenStyle->insertItem(pix, penStyleNames[i], i);
- m_walkPathPenStyle->insertItem(pix, penStyleNames[i], i);
+ m_imagePenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_highlightPenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_line0PenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_line1PenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_line2PenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_walkPathPenStyle->insertItem(i, pix, penStyleNames[i]);
}
-
+
const QString brushStyleNames[] =
{
"None",
@@ -209,17 +209,17 @@
pen.setWidth(0);
for (int i = Qt::NoBrush; i <= Qt::DiagCrossPattern; i++)
{
- pix.fill(Qt::white);
- QPainter p(&pix);
- p.setPen(pen);
- p.setBrush(QBrush(Qt::BrushStyle(i)));
- p.drawRect(point.x() - size, point.y() - size, sizeWH, sizeWH);
- p.end();
+ pix.fill(Qt::white);
+ QPainter p(&pix);
+ p.setPen(pen);
+ p.setBrush(QBrush(Qt::BrushStyle(i)));
+ p.drawRect(point.x() - size, point.y() - size, sizeWH, sizeWH);
+ p.end();
- m_imageBrushStyle->insertItem(pix, brushStyleNames[i], i);
- m_highlightBrushStyle->insertItem(pix, brushStyleNames[i], i);
+ m_imageBrushStyle->insertItem(i, pix, brushStyleNames[i]);
+ m_highlightBrushStyle->insertItem(i, pix, brushStyleNames[i]);
}
-
+
// setup the display
setupMapIconDisplay();
}
@@ -235,7 +235,7 @@
m_mapIcons = mapIcons;
// set the current map icon type
- m_currentMapIconType = MapIconType(m_mapIconCombo->currentItem() + 1);
+ m_currentMapIconType = MapIconType(m_mapIconCombo->currentIndex() + 1);
m_currentMapIcon = m_mapIcons->icon(m_currentMapIconType);
m_currentMapIconBackup = m_currentMapIcon;
@@ -261,14 +261,16 @@
void MapIconDialog::imagePenColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.imagePen().color(),
- this, caption() + " Image Outline");
-
+ this, windowTitle() + " Image Outline");
+
if (color.isValid())
{
- QPen pen = m_currentMapIcon.imagePen();
- pen.setColor(color);
- m_currentMapIcon.setImagePen(pen);
- m_imagePenColorSample->setPaletteBackgroundColor(color);
+ QPen pen = m_currentMapIcon.imagePen();
+ pen.setColor(color);
+ m_currentMapIcon.setImagePen(pen);
+ QPalette p = m_imagePenColorSample->palette();
+ p.setColor(m_imagePenColorSample->backgroundRole(), color);
+ m_imagePenColorSample->setPalette(p);
}
}
@@ -275,14 +277,16 @@
void MapIconDialog::imageBrushColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.imageBrush().color(),
- this, caption() + " Image Fill");
-
+ this, windowTitle() + " Image Fill");
+
if (color.isValid())
{
- QBrush brush = m_currentMapIcon.imageBrush();
- brush.setColor(color);
- m_currentMapIcon.setImageBrush(brush );
- m_imageBrushColorSample->setPaletteBackgroundColor(color);
+ QBrush brush = m_currentMapIcon.imageBrush();
+ brush.setColor(color);
+ m_currentMapIcon.setImageBrush(brush );
+ QPalette p = m_imageBrushColorSample->palette();
+ p.setColor(m_imageBrushColorSample->backgroundRole(), color);
+ m_imageBrushColorSample->setPalette(p);
}
}
@@ -289,14 +293,16 @@
void MapIconDialog::highlightPenColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.highlightPen().color(),
- this, caption() + " Highlight Outline");
-
+ this, windowTitle() + " Highlight Outline");
+
if (color.isValid())
{
- QPen pen = m_currentMapIcon.highlightPen();
- pen.setColor(color);
- m_currentMapIcon.setHighlightPen(pen);
- m_highlightPenColorSample->setPaletteBackgroundColor(color);
+ QPen pen = m_currentMapIcon.highlightPen();
+ pen.setColor(color);
+ m_currentMapIcon.setHighlightPen(pen);
+ QPalette p = m_highlightPenColorSample->palette();
+ p.setColor(m_highlightPenColorSample->backgroundRole(), color);
+ m_highlightPenColorSample->setPalette(p);
}
}
@@ -303,14 +309,16 @@
void MapIconDialog::highlightBrushColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.highlightBrush().color(),
- this, caption() + " Highlight Fill");
-
+ this, windowTitle() + " Highlight Fill");
+
if (color.isValid())
{
- QBrush brush = m_currentMapIcon.highlightBrush();
- brush.setColor(color);
- m_currentMapIcon.setHighlightBrush(brush );
- m_highlightBrushColorSample->setPaletteBackgroundColor(color);
+ QBrush brush = m_currentMapIcon.highlightBrush();
+ brush.setColor(color);
+ m_currentMapIcon.setHighlightBrush(brush );
+ QPalette p = m_highlightBrushColorSample->palette();
+ p.setColor(m_highlightBrushColorSample->backgroundRole(), color);
+ m_highlightBrushColorSample->setPalette(p);
}
}
@@ -317,14 +325,16 @@
void MapIconDialog::line0PenColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.line0Pen().color(),
- this, caption() + " Line 0");
-
+ this, windowTitle() + " Line 0");
+
if (color.isValid())
{
- QPen pen = m_currentMapIcon.line0Pen();
- pen.setColor(color);
- m_currentMapIcon.setLine0Pen(pen);
- m_line0PenColorSample->setPaletteBackgroundColor(color);
+ QPen pen = m_currentMapIcon.line0Pen();
+ pen.setColor(color);
+ m_currentMapIcon.setLine0Pen(pen);
+ QPalette p = m_line0PenColorSample->palette();
+ p.setColor(m_line0PenColorSample->backgroundRole(), color);
+ m_line0PenColorSample->setPalette(p);
}
}
@@ -331,14 +341,16 @@
void MapIconDialog::line1PenColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.line1Pen().color(),
- this, caption() + " Line 1");
-
+ this, windowTitle() + " Line 1");
+
if (color.isValid())
{
- QPen pen = m_currentMapIcon.line1Pen();
- pen.setColor(color);
- m_currentMapIcon.setLine1Pen(pen);
- m_line1PenColorSample->setPaletteBackgroundColor(color);
+ QPen pen = m_currentMapIcon.line1Pen();
+ pen.setColor(color);
+ m_currentMapIcon.setLine1Pen(pen);
+ QPalette p = m_line1PenColorSample->palette();
+ p.setColor(m_line1PenColorSample->backgroundRole(), color);
+ m_line1PenColorSample->setPalette(p);
}
}
@@ -345,14 +357,16 @@
void MapIconDialog::line2PenColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.line2Pen().color(),
- this, caption() + " Line 2");
-
+ this, windowTitle() + " Line 2");
+
if (color.isValid())
{
- QPen pen = m_currentMapIcon.line2Pen();
- pen.setColor(color);
- m_currentMapIcon.setLine2Pen(pen);
- m_line2PenColorSample->setPaletteBackgroundColor(color);
+ QPen pen = m_currentMapIcon.line2Pen();
+ pen.setColor(color);
+ m_currentMapIcon.setLine2Pen(pen);
+ QPalette p = m_line2PenColorSample->palette();
+ p.setColor(m_line2PenColorSample->backgroundRole(), color);
+ m_line2PenColorSample->setPalette(p);
}
}
@@ -359,14 +373,16 @@
void MapIconDialog::walkPathPenColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.walkPathPen().color(),
- this, caption() + " Walk Path Line");
-
+ this, windowTitle() + " Walk Path Line");
+
if (color.isValid())
{
- QPen pen = m_currentMapIcon.walkPathPen();
- pen.setColor(color);
- m_currentMapIcon.setWalkPathPen(pen);
- m_walkPathPenColorSample->setPaletteBackgroundColor(color);
+ QPen pen = m_currentMapIcon.walkPathPen();
+ pen.setColor(color);
+ m_currentMapIcon.setWalkPathPen(pen);
+ QPalette p = m_walkPathPenColorSample->palette();
+ p.setColor(m_walkPathPenColorSample->backgroundRole(), color);
+ m_walkPathPenColorSample->setPalette(p);
}
}
@@ -374,49 +390,66 @@
{
// setup image fields
m_useImage->setChecked(m_currentMapIcon.image());
- m_imageImage->setCurrentItem(m_currentMapIcon.imageStyle());
- m_imageSize->setCurrentItem(m_currentMapIcon.imageSize());
+ m_imageImage->setCurrentIndex(m_currentMapIcon.imageStyle());
+ m_imageSize->setCurrentIndex(m_currentMapIcon.imageSize());
m_imageFlash->setChecked(m_currentMapIcon.imageFlash());
m_imageUseSpawnColorPen->setChecked(m_currentMapIcon.imageUseSpawnColorPen());
- m_imagePenColorSample->setPaletteBackgroundColor(m_currentMapIcon.imagePen().color());
- m_imagePenStyle->setCurrentItem(m_currentMapIcon.imagePen().style());
+ QPalette p_ip = m_imagePenColorSample->palette();
+ p_ip.setColor(m_imagePenColorSample->backgroundRole(), m_currentMapIcon.imagePen().color());
+ m_imagePenColorSample->setPalette(p_ip);
+ m_imagePenStyle->setCurrentIndex(m_currentMapIcon.imagePen().style());
m_imagePenWidth->setValue(m_currentMapIcon.imagePen().width());
m_imageUseSpawnColorBrush->setChecked(m_currentMapIcon.imageUseSpawnColorBrush());
- m_imageBrushColorSample->setPaletteBackgroundColor(m_currentMapIcon.imageBrush().color());
- m_imageBrushStyle->setCurrentItem(m_currentMapIcon.imageBrush().style());
-
+ QPalette p_ib = m_imageBrushColorSample->palette();
+ p_ib.setColor(m_imageBrushColorSample->backgroundRole(), m_currentMapIcon.imageBrush().color());
+ m_imageBrushColorSample->setPalette(p_ib);
+
+ m_imageBrushStyle->setCurrentIndex(m_currentMapIcon.imageBrush().style());
+
// setup highlight fields
m_useHighlight->setChecked(m_currentMapIcon.highlight());
- m_highlightImage->setCurrentItem(m_currentMapIcon.highlightStyle());
- m_highlightSize->setCurrentItem(m_currentMapIcon.highlightSize());
+ m_highlightImage->setCurrentIndex(m_currentMapIcon.highlightStyle());
+ m_highlightSize->setCurrentIndex(m_currentMapIcon.highlightSize());
m_highlightFlash->setChecked(m_currentMapIcon.highlightFlash());
m_highlightUseSpawnColorPen->setChecked(m_currentMapIcon.highlightUseSpawnColorPen());
- m_highlightPenColorSample->setPaletteBackgroundColor(m_currentMapIcon.highlightPen().color());
- m_highlightPenStyle->setCurrentItem(m_currentMapIcon.highlightPen().style());
+ QPalette p_hp = m_highlightPenColorSample->palette();
+ p_ib.setColor(m_highlightPenColorSample->backgroundRole(), m_currentMapIcon.highlightPen().color());
+ m_highlightPenColorSample->setPalette(p_ib);
+ m_highlightPenStyle->setCurrentIndex(m_currentMapIcon.highlightPen().style());
m_highlightPenWidth->setValue(m_currentMapIcon.highlightPen().width());
m_highlightUseSpawnColorBrush->setChecked(m_currentMapIcon.highlightUseSpawnColorBrush());
- m_highlightBrushColorSample->setPaletteBackgroundColor(m_currentMapIcon.highlightBrush().color());
- m_highlightBrushStyle->setCurrentItem(m_currentMapIcon.highlightBrush().style());
-
+ QPalette p_hb = m_highlightBrushColorSample->palette();
+ p_hb.setColor(m_highlightBrushColorSample->backgroundRole(), m_currentMapIcon.highlightBrush().color());
+ m_highlightBrushColorSample->setPalette(p_hb);
+ m_highlightBrushStyle->setCurrentIndex(m_currentMapIcon.highlightBrush().style());
+
// setup lines
m_showLine0->setChecked(m_currentMapIcon.showLine0());
- m_line0PenColorSample->setPaletteBackgroundColor(m_currentMapIcon.line0Pen().color());
- m_line0PenStyle->setCurrentItem(m_currentMapIcon.line0Pen().style());
+ QPalette p_l0 = m_line0PenColorSample->palette();
+ p_l0.setColor(m_line0PenColorSample->backgroundRole(), m_currentMapIcon.line0Pen().color());
+ m_line0PenColorSample->setPalette(p_l0);
+ m_line0PenStyle->setCurrentIndex(m_currentMapIcon.line0Pen().style());
m_line0PenWidth->setValue(m_currentMapIcon.line0Pen().width());
m_line1Distance->setValue(m_currentMapIcon.line1Distance());
- m_line1PenColorSample->setPaletteBackgroundColor(m_currentMapIcon.line1Pen().color());
- m_line1PenStyle->setCurrentItem(m_currentMapIcon.line1Pen().style());
+ QPalette p_l1 = m_line1PenColorSample->palette();
+ p_l1.setColor(m_line1PenColorSample->backgroundRole(), m_currentMapIcon.line1Pen().color());
+ m_line1PenColorSample->setPalette(p_l1);
+ m_line1PenStyle->setCurrentIndex(m_currentMapIcon.line1Pen().style());
m_line1PenWidth->setValue(m_currentMapIcon.line1Pen().width());
m_line2Distance->setValue(m_currentMapIcon.line2Distance());
- m_line2PenColorSample->setPaletteBackgroundColor(m_currentMapIcon.line2Pen().color());
- m_line2PenStyle->setCurrentItem(m_currentMapIcon.line2Pen().style());
+ QPalette p_l2 = m_line2PenColorSample->palette();
+ p_l2.setColor(m_line2PenColorSample->backgroundRole(), m_currentMapIcon.line2Pen().color());
+ m_line2PenColorSample->setPalette(p_l2);
+ m_line2PenStyle->setCurrentIndex(m_currentMapIcon.line2Pen().style());
m_line2PenWidth->setValue(m_currentMapIcon.line2Pen().width());
-
+
// setup other
m_showName->setChecked(m_currentMapIcon.showName());
m_showWalkPath->setChecked(m_currentMapIcon.showWalkPath());
m_useWalkPathPen->setChecked(m_currentMapIcon.useWalkPathPen());
- m_walkPathPenColorSample->setPaletteBackgroundColor(m_currentMapIcon.walkPathPen().color());
- m_walkPathPenStyle->setCurrentItem(m_currentMapIcon.walkPathPen().style());
+ QPalette p_wp = m_walkPathPenColorSample->palette();
+ p_wp.setColor(m_walkPathPenColorSample->backgroundRole(), m_currentMapIcon.walkPathPen().color());
+ m_walkPathPenColorSample->setPalette(p_wp);
+ m_walkPathPenStyle->setCurrentIndex(m_currentMapIcon.walkPathPen().style());
m_walkPathPenWidth->setValue(m_currentMapIcon.walkPathPen().width());
}
Modified: showeq/branches/pre_6_0_beta/src/netdiag.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/netdiag.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/netdiag.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -105,7 +105,7 @@
{
tmpGrid->addWidget(new QLabel(eqStreams[a], this), row, col++);
tmpGrid->addWidget(new QLabel("Max Length:", this), row, col++);
- m_maxLength[a] = new QLabel(this, "unknown");
+ m_maxLength[a] = new QLabel("unknown", this);
m_maxLength[a]->setNum((int)m_packet->currentMaxLength(a));
tmpGrid->addWidget(m_maxLength[a], row, col++);
col++;
@@ -115,15 +115,15 @@
// packet throughput
tmpGrid->addWidget(new QLabel("Packets ", this), row, col++);
tmpGrid->addWidget(new QLabel("Total: ", this), row, col++);
- m_packetTotal[a] = new QLabel(this, "count");
+ m_packetTotal[a] = new QLabel("count", this);
tmpGrid->addWidget(m_packetTotal[a], row, col++);
col++;
tmpGrid->addWidget(new QLabel("Recent: ", this), row, col++);
- m_packetRecent[a] = new QLabel(this, "recent");
+ m_packetRecent[a] = new QLabel("recent", this);
tmpGrid->addWidget(m_packetRecent[a], row, col++);
col++;
tmpGrid->addWidget(new QLabel("Rate: ", this), row, col++);
- m_packetAvg[a] = new QLabel(this, "avg");
+ m_packetAvg[a] = new QLabel("avg", this);
tmpGrid->addWidget(m_packetAvg[a], row, col++);
resetPacket(m_packet->packetCount(a), a);
@@ -132,19 +132,19 @@
// network status
tmpGrid->addWidget(new QLabel("Status ", this), row, col++);
tmpGrid->addWidget(new QLabel("Cached: ", this), row, col++);
- m_cache[a] = new QLabel(this, "cached");
+ m_cache[a] = new QLabel("cached", this);
m_cache[a]->setNum((int)m_packet->currentCacheSize(a));
tmpGrid->addWidget(m_cache[a], row, col++);
col++;
tmpGrid->addWidget(new QLabel("SeqExp: ", this), row, col++);
- m_seqExp[a] = new QLabel(this, "seqexp");
+ m_seqExp[a] = new QLabel("seqexp", this);
tmpGrid->addWidget(m_seqExp[a], row, col++);
col++;
tmpGrid->addWidget(new QLabel("SeqCur: ", this), row, col++);
- m_seqCur[a] = new QLabel(this, "seqcur");
+ m_seqCur[a] = new QLabel("seqcur", this);
tmpGrid->addWidget(m_seqCur[a], row, col++);
row++; row++; col = 0;
- seqExpect(m_packet->serverSeqExp(a), a);
+ seqExpect(m_packet->serverSeqExp(a), a);
m_seqCur[a]->setText("????");
}
@@ -152,7 +152,11 @@
{
tmpGrid->addWidget(new QLabel("Playback ", this), row, col++);
tmpGrid->addWidget(new QLabel("Rate: ", this), row, col++);
- m_playbackSpeed = new QSpinBox(-1, 9, 1, this, "speed");
+ m_playbackSpeed = new QSpinBox(this);
+ m_playbackSpeed->setObjectName("speed");
+ m_playbackSpeed->setMinimum(-1);
+ m_playbackSpeed->setMaximum(9);
+ m_playbackSpeed->setSingleStep(1);
m_playbackSpeed->setSuffix("x");
m_playbackSpeed->setSpecialValueText("Pause");
m_playbackSpeed->setWrapping(true);
@@ -170,7 +174,7 @@
QShortcut *decPlayback_shortcut = new QShortcut(key, this);
connect (decPlayback_shortcut, SIGNAL(activated()), m_packet, SLOT(decPlayback()));
}
-
+
// supply the LCD's with signals
connect (m_packet, SIGNAL(cacheSize(int, int)),
this, SLOT(cacheSize(int, int)));
Modified: showeq/branches/pre_6_0_beta/src/packet.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packet.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/packet.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -104,7 +104,7 @@
int playbackPackets,
int8_t playbackSpeed,
QObject * parent, const char *name)
- : QObject (parent, name),
+ : QObject (parent),
m_packetCapture(NULL),
m_vPacket(NULL),
m_timer(NULL),
@@ -119,6 +119,7 @@
m_playbackPackets(playbackPackets),
m_playbackSpeed(playbackSpeed)
{
+ setObjectName(name);
// create the packet type db
m_packetTypeDB = new EQPacketTypeDB();
@@ -131,8 +132,8 @@
// load the world opcode db
if (!m_worldOPCodeDB->load(*m_packetTypeDB, worldopcodesxml))
- seqFatal("Error loading '%s'!", (const char*)worldopcodesxml);
-
+ seqFatal("Error loading '%s'!", worldopcodesxml.toAscii().data());
+
#ifdef PACKET_OPCODEDB_DIAG
m_worldOPCodeDB->list();
#endif
@@ -144,7 +145,7 @@
// load the zone opcode db
if (!m_zoneOPCodeDB->load(*m_packetTypeDB, zoneopcodesxml))
- seqFatal("Error loading '%s'!", (const char*)zoneopcodesxml);
+ seqFatal("Error loading '%s'!", zoneopcodesxml.toAscii().data());
#ifdef PACKET_OPCODEDB_DIAG
m_zoneOPCodeDB->list();
@@ -200,11 +201,11 @@
if (m_ip == "auto")
inet_aton (AUTOMATIC_CLIENT_IP, &ia);
- else if (inet_aton (m_ip, &ia) == 0)
+ else if (inet_aton (m_ip.toAscii().data(), &ia) == 0)
{
- he = gethostbyname(m_ip);
+ he = gethostbyname(m_ip.toAscii().data());
if (!he)
- seqFatal("Invalid address; %s", (const char*)m_ip);
+ seqFatal("Invalid address; %s", m_ip.toAscii().data());
memcpy (&ia, he->h_addr_list[0], he->h_length);
}
@@ -219,23 +220,22 @@
else
{
m_detectingClient = false;
- seqInfo("Listening for client: %s",
- (const char*)m_ip);
+ seqInfo("Listening for client: %s", m_ip.toAscii().data());
}
}
-
+
if (m_playbackPackets == PLAYBACK_OFF)
{
// create the pcap object and initialize, either with MAC or IP
m_packetCapture = new PacketCaptureThread();
if (m_mac.length() == 17)
- m_packetCapture->start(m_device,
- m_mac,
- m_realtime, MAC_ADDRESS_TYPE );
+ m_packetCapture->start(m_device.toAscii().data(),
+ m_mac.toAscii().data(),
+ m_realtime, MAC_ADDRESS_TYPE );
else
- m_packetCapture->start(m_device,
- m_ip,
- m_realtime, IP_ADDRESS_TYPE );
+ m_packetCapture->start(m_device.toAscii().data(),
+ m_ip.toAscii().data(),
+ m_realtime, IP_ADDRESS_TYPE );
emit filterChanged();
}
else if (m_playbackPackets == PLAYBACK_FORMAT_TCPDUMP)
@@ -243,12 +243,11 @@
// Create the pcap object and initialize with the file input given
m_packetCapture = new PacketCaptureThread();
- const char* filename =
- pSEQPrefs->getPrefString("Filename", "VPacket");
+ QString filename = pSEQPrefs->getPrefString("Filename", "VPacket");
- m_packetCapture->startOffline(filename, m_playbackSpeed);
- seqInfo("Playing back packets from '%s' at speed '%d'",
- filename, m_playbackSpeed);
+ m_packetCapture->startOffline(filename.toAscii().data(), m_playbackSpeed);
+ seqInfo("Playing back packets from '%s' at speed '%d'",
+ filename.toAscii().data(), m_playbackSpeed);
}
// Flag session tracking properly on streams
@@ -282,26 +281,26 @@
// Second param is playback speed: 0 = fast as poss, 1 = 1X, 2 = 2X etc
if (pSEQPrefs->isPreference("Filename", section))
{
- const char *filename = pSEQPrefs->getPrefString("Filename", section);
-
+ QString filename = pSEQPrefs->getPrefString("Filename", section);
+
if (m_recordPackets)
{
- m_vPacket = new VPacket(filename, 1, true);
+ m_vPacket = new VPacket(filename.toAscii().data(), 1, true);
// Must appear befire next call to getPrefString, which uses a static string
- seqInfo("Recording packets to '%s' for future playback", filename);
-
+ seqInfo("Recording packets to '%s' for future playback", filename.toAscii().data());
+
if (!pSEQPrefs->getPrefString("FlushPackets", section).isNull())
- m_vPacket->setFlushPacket(true);
+ m_vPacket->setFlushPacket(true);
}
else if (m_playbackPackets == PLAYBACK_FORMAT_SEQ)
{
- m_vPacket = new VPacket(filename, 1, false);
+ m_vPacket = new VPacket(filename.toAscii().data(), 1, false);
m_vPacket->setCompressTime(pSEQPrefs->getPrefInt("CompressTime", section, 0));
m_vPacket->setPlaybackSpeed(m_playbackSpeed);
-
- seqInfo("Playing back packets from '%s' at speed '%d'", filename,
-
- m_playbackSpeed);
+
+ seqInfo("Playing back packets from '%s' at speed '%d'", filename.toAscii().data(),
+
+ m_playbackSpeed);
}
}
else
@@ -371,7 +370,7 @@
#ifdef DEBUG_PACKET
qDebug ("start()");
#endif /* DEBUG_PACKET */
- m_timer->start (delay, false);
+ m_timer->start (delay);
}
/* Stop the timer to process packets */
@@ -612,7 +611,7 @@
m_client_addr = packet.getIPv4DestN();
m_detectingClient = false;
emit clientChanged(m_client_addr);
- seqInfo("Client Detected: %s", (const char*)m_ip);
+ seqInfo("Client Detected: %s", m_ip.toAscii().data());
}
else if (m_detectingClient &&
(packet.getDestPort() >= WorldServerGeneralMinPort
@@ -622,7 +621,7 @@
m_client_addr = packet.getIPv4SourceN();
m_detectingClient = false;
emit clientChanged(m_client_addr);
- seqInfo("Client Detected: %s", (const char*)m_ip);
+ seqInfo("Client Detected: %s", m_ip.toAscii().data());
}
// Dispatch based on known streams
@@ -691,8 +690,8 @@
(m_playbackPackets == PLAYBACK_OFF ||
m_playbackPackets == PLAYBACK_FORMAT_TCPDUMP))
{
- m_packetCapture->setFilter(m_device, m_ip,
- m_realtime, IP_ADDRESS_TYPE, 0, 0);
+ m_packetCapture->setFilter(m_device.toAscii().data(), m_ip.toAscii().data(),
+ m_realtime, IP_ADDRESS_TYPE, 0, 0);
emit filterChanged();
}
@@ -711,7 +710,7 @@
emit clientPortLatched(m_clientPort);
seqInfo("EQPacket: SessionDisconnect detected, awaiting next zone session, pcap filter: EQ Client %s",
- (const char*)m_ip);
+ m_ip.toAscii().data());
}
}
@@ -722,25 +721,25 @@
m_serverPort = serverPort;
m_clientPort = clientPort;
- if (m_playbackPackets == PLAYBACK_OFF ||
+ if (m_playbackPackets == PLAYBACK_OFF ||
m_playbackPackets == PLAYBACK_FORMAT_TCPDUMP)
{
if (m_mac.length() == 17)
{
- m_packetCapture->setFilter(m_device,
- m_mac,
- m_realtime,
- MAC_ADDRESS_TYPE, 0,
- m_clientPort);
+ m_packetCapture->setFilter(m_device.toAscii().data(),
+ m_mac.toAscii().data(),
+ m_realtime,
+ MAC_ADDRESS_TYPE, 0,
+ m_clientPort);
emit filterChanged();
}
else
{
- m_packetCapture->setFilter(m_device,
- m_ip,
- m_realtime,
- IP_ADDRESS_TYPE, 0,
- m_clientPort);
+ m_packetCapture->setFilter(m_device.toAscii().data(),
+ m_ip.toAscii().data(),
+ m_realtime,
+ IP_ADDRESS_TYPE, 0,
+ m_clientPort);
emit filterChanged();
}
}
@@ -749,14 +748,14 @@
if (m_mac.length() == 17)
{
seqInfo("EQPacket: SessionRequest detected, pcap filter: EQ Client %s, Client port %d. Server port %d",
- (const char*)m_mac, m_clientPort, m_serverPort);
+ m_mac.toAscii().data(), m_clientPort, m_serverPort);
}
else
{
seqInfo("EQPacket: SessionRequest detected, pcap filter: EQ Client %s, Client port %d. Server port %d",
- (const char*)m_ip, m_clientPort, m_serverPort);
+ m_ip.toAscii().data(), m_clientPort, m_serverPort);
}
-
+
emit clientPortLatched(m_clientPort);
}
@@ -918,19 +917,20 @@
{
m_ip = ip;
struct in_addr ia;
- inet_aton (m_ip, &ia);
+ inet_aton (m_ip.toAscii().data(), &ia);
m_client_addr = ia.s_addr;
emit clientChanged(m_client_addr);
-
+
resetEQPacket();
-
- seqInfo("Listening for IP client: %s", (const char*)m_ip);
- if (m_playbackPackets == PLAYBACK_OFF ||
+
+ seqInfo("Listening for IP client: %s", m_ip.toAscii().data());
+ if (m_playbackPackets == PLAYBACK_OFF ||
m_playbackPackets == PLAYBACK_FORMAT_TCPDUMP)
{
- m_packetCapture->setFilter(m_device, m_ip,
- m_realtime,
- IP_ADDRESS_TYPE, 0, 0);
+ m_packetCapture->setFilter(m_device.toAscii().data(),
+ m_ip.toAscii().data(),
+ m_realtime,
+ IP_ADDRESS_TYPE, 0, 0);
emit filterChanged();
}
}
@@ -948,15 +948,15 @@
resetEQPacket();
- seqInfo("Listening for MAC client: %s",
- (const char*)m_mac);
+ seqInfo("Listening for MAC client: %s", m_mac.toAscii().data());
if (m_playbackPackets == PLAYBACK_OFF ||
m_playbackPackets == PLAYBACK_FORMAT_TCPDUMP)
{
- m_packetCapture->setFilter(m_device, m_ip,
- m_realtime,
- IP_ADDRESS_TYPE, 0, 0);
+ m_packetCapture->setFilter(m_device.toAscii().data(),
+ m_ip.toAscii().data(),
+ m_realtime,
+ IP_ADDRESS_TYPE, 0, 0);
emit filterChanged();
}
}
@@ -968,7 +968,7 @@
m_detectingClient = true;
m_ip = AUTOMATIC_CLIENT_IP;
struct in_addr ia;
- inet_aton (m_ip, &ia);
+ inet_aton (m_ip.toAscii().data(), &ia);
m_client_addr = ia.s_addr;
emit clientChanged(m_client_addr);
@@ -979,9 +979,9 @@
if (m_playbackPackets == PLAYBACK_OFF ||
m_playbackPackets == PLAYBACK_FORMAT_TCPDUMP)
{
- m_packetCapture->setFilter(m_device, NULL,
- m_realtime,
- DEFAULT_ADDRESS_TYPE, 0, 0);
+ m_packetCapture->setFilter(m_device.toAscii().data(), NULL,
+ m_realtime,
+ DEFAULT_ADDRESS_TYPE, 0, 0);
emit filterChanged();
}
}
@@ -1008,20 +1008,20 @@
/* Substitute "special" IP which is interpreted
to set up a different filter for picking up new sessions */
-
+
if (m_ip == "auto")
inet_aton (AUTOMATIC_CLIENT_IP, &ia);
- else if (inet_aton (m_ip, &ia) == 0)
+ else if (inet_aton (m_ip.toAscii().data(), &ia) == 0)
{
- he = gethostbyname(m_ip);
+ he = gethostbyname(m_ip.toAscii().data());
if (!he)
- seqFatal("Invalid address; %s", (const char*)m_ip);
+ seqFatal("Invalid address; %s", m_ip.toAscii().data());
memcpy (&ia, he->h_addr_list[0], he->h_length);
}
m_client_addr = ia.s_addr;
m_ip = inet_ntoa(ia);
-
+
if (m_ip == AUTOMATIC_CLIENT_IP)
{
m_detectingClient = true;
@@ -1030,21 +1030,20 @@
else
{
m_detectingClient = false;
- seqInfo("Listening for client: %s",
- (const char*)m_ip);
+ seqInfo("Listening for client: %s", m_ip.toAscii().data());
}
}
-
+
resetEQPacket();
// restart packet capture
if (m_mac.length() == 17)
- m_packetCapture->start(m_device,
- m_mac,
- m_realtime, MAC_ADDRESS_TYPE );
+ m_packetCapture->start(m_device.toAscii().data(),
+ m_mac.toAscii().data(),
+ m_realtime, MAC_ADDRESS_TYPE );
else
- m_packetCapture->start(m_device, m_ip,
- m_realtime, IP_ADDRESS_TYPE );
+ m_packetCapture->start(m_device.toAscii().data(), m_ip.toAscii().data(),
+ m_realtime, IP_ADDRESS_TYPE );
emit filterChanged();
}
Modified: showeq/branches/pre_6_0_beta/src/packetinfo.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetinfo.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/packetinfo.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -137,8 +137,9 @@
//----------------------------------------------------------------------
// EQPacketDispatch
EQPacketDispatch::EQPacketDispatch(QObject* parent, const char* name)
- : QObject(parent, name)
+ : QObject(parent)
{
+ setObjectName(name);
}
EQPacketDispatch::~EQPacketDispatch()
@@ -319,12 +320,13 @@
// create a QTextStream object on the QFile object
QTextStream out(&file);
-
+
// set the output encoding to be UTF8
- out.setEncoding(QTextStream::UnicodeUTF8);
+ out.setCodec("UTF-8");
// set the number output to be left justified decimal
- out.setf(QTextStream::dec | QTextStream::left);
+ out.setIntegerBase(10);
+ out.setFieldAlignment(QTextStream::AlignLeft);
// print document header
out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl
@@ -446,29 +448,29 @@
if (!it.value())
break;
current = it.value();
- fprintf(stderr, "\tkey=%04lx opcode=%04x",
+ fprintf(stderr, "\tkey=%04x opcode=%04x",
it.key(), current->opcode());
if (!current->name().isNull())
- fprintf(stderr, " name='%s'", current->name().latin1());
+ fprintf(stderr, " name='%s'", current->name().toLatin1().data());
if (current->implicitLen())
fprintf(stderr, " implicitlen='%d'", current->implicitLen());
-
+
if (!current->updated().isNull())
- fprintf(stderr, " updated='%s'", current->updated().latin1());
+ fprintf(stderr, " updated='%s'", current->updated().toLatin1().data());
fputc('\n', stderr);
QStringList comments = current->comments();
-
+
fprintf(stderr, "\t\t%d comment(s)\n", comments.count());
- for (QStringList::Iterator cit = comments.begin();
- cit != comments.end(); ++cit)
- fprintf(stderr, "\t\t\t'%s'\n", (*cit).latin1());
-
+ for (QStringList::Iterator cit = comments.begin();
+ cit != comments.end(); ++cit)
+ fprintf(stderr, "\t\t\t'%s'\n", (*cit).toLatin1().data());
+
fprintf(stderr, "\t\t%d payload(s)\n", current->count());
-
+
QListIterator<EQPacketPayload*> pit(*current);
while (pit.hasNext())
{
@@ -477,7 +479,7 @@
break;
seqInfo("\t\t\tdir=%d typename=%s size=%d sizechecktype=%d",
- currentPayload->dir(), (const char*)currentPayload->typeName(),
+ currentPayload->dir(), currentPayload->typeName().toAscii().data(),
currentPayload->typeSize(), currentPayload->sizeCheckType());
}
}
@@ -602,7 +604,7 @@
if (!ok)
{
seqWarn("OPCodeXmlContentHandler::startElement(): opcode '%s' failed to convert to uint16_t (result: %#04x)",
- attr.value(index).latin1(), opcode);
+ attr.value(index).toLatin1().data(), opcode);
return false; // this is an error
}
@@ -689,9 +691,9 @@
if (!value.isEmpty())
{
- if (!m_currentPayload->setType(m_typeDB, value))
- seqWarn("Unknown payload typename '%s' for opcode '%04x'",
- value.latin1(), m_currentOPCode->opcode());
+ if (!m_currentPayload->setType(m_typeDB, value.toAscii().data()))
+ seqWarn("Unknown payload typename '%s' for opcode '%04x'",
+ value.toLatin1().data(), m_currentOPCode->opcode());
}
}
Modified: showeq/branches/pre_6_0_beta/src/packetlog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetlog.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/packetlog.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -94,9 +94,9 @@
{
if (!open())
return;
-
- outputf ("%s\n", (const char*)message);
+ outputf ("%s\n", message.toAscii().data());
+
flush();
}
@@ -109,11 +109,11 @@
return;
if (!prefix.isEmpty())
- outputf("%s ", (const char*)prefix.utf8());
+ outputf("%s ", prefix.toUtf8().data());
- outputf("[Size: %d] %s\n",
- len,
- (const char*)QDateTime::currentDateTime().toString(m_timeDateFormat).utf8());
+ outputf("[Size: %d] %s\n",
+ len,
+ QDateTime::currentDateTime().toString(m_timeDateFormat).toUtf8().data());
// make sure there is a len before attempting to print it
if (len)
@@ -300,14 +300,14 @@
uint16_t opcode, const QString& origPrefix)
{
if (!origPrefix.isEmpty())
- ::printf("%s ", (const char*)origPrefix);
+ ::printf("%s ", origPrefix.toAscii().data());
else
::putchar('\n');
-
- ::printf("%s [Size: %u]%s\n",
- ((dir == DIR_Server) ? "[Server->Client]" : "[Client->Server]"),
- len, (const char*)opCodeToString(opcode));
+ ::printf("%s [Size: %lu]%s\n",
+ ((dir == DIR_Server) ? "[Server->Client]" : "[Client->Server]"),
+ len, opCodeToString(opcode).toAscii().data());
+
if (len)
{
for (size_t a = 0; a < len; a ++)
@@ -415,8 +415,7 @@
}
seqInfo("OpCode monitoring ENABLED...");
- seqInfo("Using list:\t%s",
- (const char*)monitoredOPCodes);
+ seqInfo("Using list:\t%s", monitoredOPCodes.toAscii().data());
QString qsCommaBuffer (""); /* Construct these outside the loop so we don't have to construct
@@ -434,59 +433,59 @@
MonitoredOpCodeList [uiIndex] [1] = 3; /* Direction, DEFAULT: Client <--> Server */
MonitoredOpCodeList [uiIndex] [2] = 1; /* Show raw data if packet is marked as known */
MonitoredOpCodeAliasList [uiIndex] = "Monitored OpCode"; /* Name used when displaying the raw data */
-
- iCommaPos = monitoredOPCodes.find (",");
-
+
+ iCommaPos = monitoredOPCodes.indexOf(",");
+
if (iCommaPos == -1)
iCommaPos = monitoredOPCodes.length ();
-
+
qsCommaBuffer = monitoredOPCodes.left (iCommaPos);
monitoredOPCodes.remove (0, iCommaPos + 1);
-
+
uiIterationID = 0;
-
+
uint8_t uiColonCount = qsCommaBuffer.count(":");
- iColonPos = qsCommaBuffer.find (":");
-
+ iColonPos = qsCommaBuffer.indexOf(":");
+
if (iColonPos == -1)
qsColonBuffer = qsCommaBuffer;
-
+
else
qsColonBuffer = qsCommaBuffer.left (iColonPos);
-
+
while (uiIterationID <= uiColonCount)
{
if (uiIterationID == 0)
- MonitoredOpCodeList [uiIndex] [0] = qsColonBuffer.toUInt (NULL, 16);
-
+ MonitoredOpCodeList [uiIndex] [0] = qsColonBuffer.toUInt (NULL, 16);
+
else if (uiIterationID == 1)
- MonitoredOpCodeAliasList [uiIndex] = qsColonBuffer;
-
+ MonitoredOpCodeAliasList [uiIndex] = qsColonBuffer;
+
else if (uiIterationID == 2)
- MonitoredOpCodeList [uiIndex] [1] = qsColonBuffer.toUInt (NULL, 10);
-
+ MonitoredOpCodeList [uiIndex] [1] = qsColonBuffer.toUInt (NULL, 10);
+
else if (uiIterationID == 3)
- MonitoredOpCodeList [uiIndex] [2] = qsColonBuffer.toUInt (NULL, 10);
-
+ MonitoredOpCodeList [uiIndex] [2] = qsColonBuffer.toUInt (NULL, 10);
+
qsCommaBuffer.remove (0, iColonPos + 1);
-
- iColonPos = qsCommaBuffer.find (":");
-
+
+ iColonPos = qsCommaBuffer.indexOf(":");
+
if (iColonPos == -1)
- qsColonBuffer = qsCommaBuffer;
-
+ qsColonBuffer = qsCommaBuffer;
+
else
- qsColonBuffer = qsCommaBuffer.left (iColonPos);
-
+ qsColonBuffer = qsCommaBuffer.left (iColonPos);
+
uiIterationID ++;
}
-
+
#if 1 // ZBTEMP
seqDebug("opcode=%04x name='%s' dir=%d known=%d",
- MonitoredOpCodeList [uiIndex] [0],
- (const char*)MonitoredOpCodeAliasList [uiIndex],
- MonitoredOpCodeList [uiIndex] [1],
- MonitoredOpCodeList [uiIndex] [2]);
+ MonitoredOpCodeList [uiIndex] [0],
+ MonitoredOpCodeAliasList [uiIndex].toAscii().data(),
+ MonitoredOpCodeList [uiIndex] [1],
+ MonitoredOpCodeList [uiIndex] [2]);
#endif
}
}
@@ -512,14 +511,14 @@
}
}
}
-
+
if (uiOpCodeIndex > 0)
{
- QString opCodeName = MonitoredOpCodeAliasList[uiOpCodeIndex - 1].latin1();
-
+ QString opCodeName = MonitoredOpCodeAliasList[uiOpCodeIndex - 1].toLatin1().data();
+
if (m_view)
printData(data, len, dir, opcode, opCodeName);
-
+
if (m_log)
logData(data, len, dir, opcode, opcodeEntry,opCodeName);
}
Modified: showeq/branches/pre_6_0_beta/src/packetstream.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetstream.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/packetstream.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -77,7 +77,7 @@
uint16_t arqSeqGiveUp,
EQPacketOPCodeDB& opcodeDB,
QObject* parent, const char* name)
- : QObject(parent, name),
+ : QObject(parent),
m_opcodeDB(opcodeDB),
m_dispatchers(),
m_streamid(streamid),
@@ -96,6 +96,7 @@
m_decodeKey(0),
m_validKey(true)
{
+ setObjectName(name);
}
////////////////////////////////////////////////////
@@ -117,9 +118,9 @@
if (!opcode)
{
seqDebug("connect2: Unknown opcode '%s' with payload type '%s'",
- (const char*)opcodeName, payloadType);
+ opcodeName.toAscii().data(), payloadType);
seqDebug("\tfor receiver '%s' of type '%s' to member '%s'",
- receiver->name(), receiver->className(), member);
+ receiver->objectName(), receiver->metaObject()->className(), member);
return false;
}
@@ -143,11 +144,11 @@
if (!payload)
{
seqDebug("connect2: Warning! opcode '%s' has no matching payload.",
- (const char*)opcodeName);
+ opcodeName.toAscii().data());
seqDebug("\tdir '%d' payload '%s' szt '%d'",
- m_dir, payloadType, szt);
+ m_dir, payloadType, szt);
seqDebug("\tfor receiver '%s' of type '%s' to member '%s'",
- receiver->name(), receiver->className(), member);
+ receiver->objectName(), receiver->metaObject()->className(), member);
return false;
}
@@ -161,12 +162,12 @@
// construct a name for the dispatch
QString dispatchName(256, '\0');
dispatchName.sprintf("PacketDispatch:%s:%s:%d:%s:%d",
- (const char*)name(), (const char*)opcodeName,
- payload->dir(), (const char*)payload->typeName(),
- payload->sizeCheckType());
+ objectName().toAscii().data(), opcodeName.toAscii().data(),
+ payload->dir(), payload->typeName().toAscii().data(),
+ payload->sizeCheckType());
// create new dispatch object
- dispatch = new EQPacketDispatch(this, dispatchName);
+ dispatch = new EQPacketDispatch(this, dispatchName.toAscii().data());
// insert dispatcher into dispatcher dictionary
m_dispatchers.insert((void*)payload, dispatch);
@@ -461,8 +462,8 @@
{
QString tempStr;
tempStr.sprintf("%s (%#04x) (dataLen: %lu) doesn't match:",
- (const char*)opcodeEntry->name(), opcodeEntry->opcode(),
- len);
+ opcodeEntry->name().toAscii().data(),
+ opcodeEntry->opcode(), len);
pit.toFront();
while (pit.hasNext())
@@ -480,9 +481,9 @@
tempStr += QString(" modulus of sizeof(%1):%2")
.arg(payload->typeName()).arg(payload->typeSize());
}
- }
+ }
- seqWarn(tempStr);
+ seqWarn(tempStr.toAscii().data());
}
#endif // PACKET_PAYLOAD_SIZE_DIAG
}
Modified: showeq/branches/pre_6_0_beta/src/player.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/player.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/player.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -60,11 +60,12 @@
ZoneMgr* zoneMgr,
GuildMgr* guildMgr,
const char* name)
- : QObject(parent, name),
+ : QObject(parent),
Spawn(),
m_zoneMgr(zoneMgr),
m_guildMgr(guildMgr)
{
+ setObjectName(name);
#ifdef DEBUG_PLAYER
qDebug ("Player()");
#endif
@@ -1296,7 +1297,7 @@
d << MAX_KNOWN_SKILLS;
d << MAX_KNOWN_LANGS;
- d << m_zoneMgr->shortZoneName().lower();
+ d << m_zoneMgr->shortZoneName().toLower();
// write out the rest
d << m_name;
@@ -1378,7 +1379,7 @@
if (magicTest != *magic)
{
seqWarn("Failure loading %s: Bad magic string!",
- (const char*)fileName);
+ fileName.toAscii().data());
reset();
clear();
return;
@@ -1388,8 +1389,8 @@
d >> testVal;
if (testVal != sizeof(charProfileStruct))
{
- seqWarn("Failure loading %s: Bad player size!",
- (const char*)fileName);
+ seqWarn("Failure loading %s: Bad player size!",
+ fileName.toAscii().data());
reset();
clear();
return;
@@ -1398,8 +1399,8 @@
d >> testVal;
if (testVal != MAX_KNOWN_SKILLS)
{
- seqWarn("Failure loading %s: Bad known skills!",
- (const char*)fileName);
+ seqWarn("Failure loading %s: Bad known skills!",
+ fileName.toAscii().data());
reset();
clear();
return;
@@ -1408,21 +1409,21 @@
d >> testVal;
if (testVal != MAX_KNOWN_LANGS)
{
- seqWarn("Failure loading %s: Bad known langs!",
- (const char*)fileName);
+ seqWarn("Failure loading %s: Bad known langs!",
+ fileName.toAscii().data());
reset();
clear();
return;
}
-
+
// attempt to validate that the info is from the current zone
QString zoneShortName;
d >> zoneShortName;
- if (zoneShortName != m_zoneMgr->shortZoneName().lower())
+ if (zoneShortName != m_zoneMgr->shortZoneName().toLower())
{
seqWarn("\aWARNING: Restoring player state for potentially incorrect zone (%s != %s)!",
- (const char*)zoneShortName,
- (const char*)m_zoneMgr->shortZoneName().lower());
+ zoneShortName.toAscii().data(),
+ m_zoneMgr->shortZoneName().toLower().toAscii().data());
}
// read in the rest
@@ -1492,13 +1493,13 @@
fillConTable();
seqInfo("Restored PLAYER: %s (%s)!",
- (const char*)m_name,
- (const char*)m_lastName);
+ m_name.toAscii().data(),
+ m_lastName.toAscii().data());
}
else
{
- seqWarn("Failure loading %s: Unable to open!",
- (const char*)fileName);
+ seqWarn("Failure loading %s: Unable to open!",
+ fileName.toAscii().data());
reset();
clear();
}
Modified: showeq/branches/pre_6_0_beta/src/seqlistview.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/seqlistview.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/seqlistview.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -85,9 +85,9 @@
{
// remove the column from the listview
Q3ListView::removeColumn(column);
-
+
// remove the preference from the list
- m_columns.remove(m_columns.at(column));
+ m_columns.removeAt(column);
}
void SEQListView::setSorting(int column, bool increasing)
@@ -183,12 +183,12 @@
while (!tStr.isEmpty())
{
int toIndex;
- if (tStr.find(':') != -1)
+ if (tStr.indexOf(':') != -1)
{
- toIndex = tStr.left(tStr.find(':')).toInt();
- tStr = tStr.right(tStr.length() - tStr.find(':') - 1);
- }
- else
+ toIndex = tStr.left(tStr.indexOf(':')).toInt();
+ tStr = tStr.right(tStr.length() - tStr.indexOf(':') - 1);
+ }
+ else
{
toIndex = tStr.toInt();
tStr = "";
Modified: showeq/branches/pre_6_0_beta/src/seqwindow.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/seqwindow.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/seqwindow.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -38,7 +38,7 @@
m_preferenceName(prefName)
{
// set the windows caption
- Q3DockWindow::setCaption(pSEQPrefs->getPrefString("Caption", preferenceName(),
+ Q3DockWindow::setWindowTitle(pSEQPrefs->getPrefString("Caption", preferenceName(),
caption));
// windows default to resizable
@@ -69,11 +69,11 @@
void SEQWindow::setCaption(const QString& text)
{
// set the caption
- Q3DockWindow::setCaption(text);
- setName((const char*)caption());
+ Q3DockWindow::setWindowTitle(text);
+ setObjectName(windowTitle());
// set the preference
- pSEQPrefs->setPrefString("Caption", preferenceName(), caption());
+ pSEQPrefs->setPrefString("Caption", preferenceName(), windowTitle());
}
void SEQWindow::setWindowFont(const QFont& font)
Modified: showeq/branches/pre_6_0_beta/src/spawn.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawn.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/spawn.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -249,10 +249,10 @@
{
QString buff;
buff.sprintf("Name:%s:Race:%s:Class:%s:NPC:%d:X:%d:Y:%d:Z:%d",
- (const char*)transformedName().utf8(),
- (const char*)raceString(),
- (const char*)classString(),
- NPC(), x(), y(), z());
+ transformedName().toUtf8().data(),
+ raceString().toUtf8().data(),
+ classString().toUtf8().data(),
+ NPC(), x(), y(), z());
return buff;
}
@@ -365,10 +365,10 @@
: Item(tSpawn, id)
{
// restore Spawn info
- d.readRawBytes((char*)this, sizeof(EQPoint));
- d.readRawBytes((char*)&m_lastUpdate,
+ d.readRawData((char*)this, sizeof(EQPoint));
+ d.readRawData((char*)&m_lastUpdate,
((char*)this + sizeof(Item)) - (char*)&m_lastUpdate);
- d.readRawBytes((char*)&m_petOwnerID,
+ d.readRawData((char*)&m_petOwnerID,
((char*)this + sizeof(Spawn)) - (char*)&m_petOwnerID);
d >> m_name;
d >> m_lastName;
@@ -894,20 +894,20 @@
QString buff;
buff.sprintf("Name:%s:Level:%d:Race:%s:Class:%s:NPC:%d:X:%d:Y:%d:Z:%d:"
- "Light:%s:Deity:%s:RTeam:%d:DTeam:%d:Type:%s:LastName:%s:Guild:%s:",
- (const char*)name.utf8(),
- level(),
- (const char*)raceString(),
- (const char*)classString(),
- ((NPC() == 10) ? 0 : NPC()),
- x(), y(), z(),
- (const char*)lightName(),
- (const char*)deityName(),
- raceTeam(),
- deityTeam(),
- (const char*)typeString(),
- (const char*)lastName().utf8(),
- (const char*)guildTag().utf8());
+ "Light:%s:Deity:%s:RTeam:%d:DTeam:%d:Type:%s:LastName:%s:Guild:%s:",
+ name.toUtf8().data(),
+ level(),
+ raceString().toUtf8().data(),
+ classString().toUtf8().data(),
+ ((NPC() == 10) ? 0 : NPC()),
+ x(), y(), z(),
+ lightName().toUtf8().data(),
+ deityName().toUtf8().data(),
+ raceTeam(),
+ deityTeam(),
+ typeString().toUtf8().data(),
+ lastName().toUtf8().data(),
+ guildTag().toUtf8().data());
if (gm())
buff += QString("GM:") + QString::number(gm()) + ":";
@@ -977,11 +977,11 @@
// write out the raw spawn structure, skipping over the QStrings,
// and SpawnTrackList (which can't be persisted in this fashion),
// and the data we don't wan't copied over (heading/delta info).
- d.writeRawBytes((const char*)this, sizeof(EQPoint));
- d.writeRawBytes((const char*)&m_lastUpdate,
+ d.writeRawData((const char*)this, sizeof(EQPoint));
+ d.writeRawData((const char*)&m_lastUpdate,
((char*)this + sizeof(Item))
- (char*)&m_lastUpdate);
- d.writeRawBytes((const char*)&m_petOwnerID,
+ d.writeRawData((const char*)&m_petOwnerID,
((char*)this + sizeof(Spawn)) - (char*)&m_petOwnerID);
d << m_name;
d << m_lastName;
Modified: showeq/branches/pre_6_0_beta/src/spawnlist.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/spawnlist.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -1111,7 +1111,7 @@
const Item* item = ((SpawnListItem*)litem)->item();
if (item != NULL)
{
- seqInfo("%s",(const char*)item->filterString());
+ seqInfo("%s", item->filterString().toAscii().data());
}
}
Modified: showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -66,10 +66,13 @@
m_delay = 60000L / fpm;
QBoxLayout* vLayout = new QVBoxLayout(boxLayout());
- QHBoxLayout* hLayout= new QHBoxLayout(vLayout);
+ QHBoxLayout* hLayout= new QHBoxLayout();
+ vLayout->addLayout(hLayout);
// create the spawn list combo box
- m_categoryCombo = new QComboBox(false, this, "spawnlistcombo");
+ m_categoryCombo = new QComboBox(this);
+ m_categoryCombo->setObjectName("spawnlistcombo");
+ m_categoryCombo->setEditable(false);
m_categoryCombo->setDuplicatesEnabled(false);
hLayout->addWidget(m_categoryCombo, 0, Qt::AlignLeft);
connect(m_categoryCombo, SIGNAL(activated(int)),
@@ -84,7 +87,11 @@
hLayout->addWidget(m_totalSpawns, 0, Qt::AlignCenter);
// setup spinbox to control frame rate (FPM)
- m_fpmSpinBox = new QSpinBox(5, 60, 1, this, "fpmSpinBox");
+ m_fpmSpinBox = new QSpinBox(this);
+ m_fpmSpinBox->setObjectName("fpmSpinBox");
+ m_fpmSpinBox->setMinimum(5);
+ m_fpmSpinBox->setMaximum(60);
+ m_fpmSpinBox->setSingleStep(1);
m_fpmSpinBox->setValue(fpm);
m_fpmSpinBox->setSuffix("FPM");
hLayout->addWidget(m_fpmSpinBox, 0, Qt::AlignRight);
@@ -128,7 +135,8 @@
m_spawnList->restoreColumns();
// setup timer for refreshing the spawn list
- m_timer = new QTimer(this, "spawnlist2timer");
+ m_timer = new QTimer(this);
+ m_timer->setObjectName("spawnlist2timer");
// connect a QListView signal to ourselves
connect(m_spawnList, SIGNAL(selectionChanged(Q3ListViewItem*)),
@@ -230,19 +238,26 @@
}
m_menu = new SpawnListMenu(m_spawnList, this, m_spawnShell->filterMgr(),
- m_categoryMgr, this, "spawnlist menu");
- m_menu->insertSeparator(-1);
- int x;
- x = m_menu->insertItem("Immediate Update",
- this, SLOT(toggle_immediateUpdate(int)));
- m_menu->setItemChecked(x, m_immediateUpdate);
- x = m_menu->insertItem("Keep Sorted",
- this, SLOT(toggle_keepSorted(int)));
- m_menu->setItemChecked(x, m_keepSorted);
- x = m_menu->insertItem("Keep Selected Visible",
- this, SLOT(toggle_keepSelectedVisible(i...
[truncated message content] |