|
From: <cn...@us...> - 2020-11-02 01:41:48
|
Revision: 1090
http://sourceforge.net/p/seq/svn/1090
Author: cn187
Date: 2020-11-02 01:41:45 +0000 (Mon, 02 Nov 2020)
Log Message:
-----------
Replace compatibility/deprecated functions with Qt4 equivalents
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/bazaarlog.cpp
showeq/branches/pre_6_0_beta/src/category.cpp
showeq/branches/pre_6_0_beta/src/cgiconv.cpp
showeq/branches/pre_6_0_beta/src/combatlog.cpp
showeq/branches/pre_6_0_beta/src/compass.cpp
showeq/branches/pre_6_0_beta/src/datalocationmgr.cpp
showeq/branches/pre_6_0_beta/src/datetimemgr.cpp
showeq/branches/pre_6_0_beta/src/db3conv.cpp
showeq/branches/pre_6_0_beta/src/drawmap.cpp
showeq/branches/pre_6_0_beta/src/editor.cpp
showeq/branches/pre_6_0_beta/src/eqstr.cpp
showeq/branches/pre_6_0_beta/src/experiencelog.cpp
showeq/branches/pre_6_0_beta/src/experiencelog.h
showeq/branches/pre_6_0_beta/src/filter.cpp
showeq/branches/pre_6_0_beta/src/filteredspawnlog.cpp
showeq/branches/pre_6_0_beta/src/filtermgr.cpp
showeq/branches/pre_6_0_beta/src/filternotifications.cpp
showeq/branches/pre_6_0_beta/src/map.h
showeq/branches/pre_6_0_beta/src/messagefilter.h
Modified: showeq/branches/pre_6_0_beta/src/bazaarlog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/bazaarlog.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/bazaarlog.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -58,9 +58,9 @@
const struct bazaarSearchResponseStruct& resp = r[i];
// First copy and remove count from item name
- char name[256];
+ char name[256] = { 0 };
// assert(255>sizeof(resp.item_name));
- strncpy(name,resp.item_name,sizeof(resp.item_name));
+ strncpy(name,resp.item_name,qMin(sizeof(resp.item_name), 255UL));
char *p;
if ((p = rindex(name,'(')) != NULL && isdigit(*(p+1)))
*p=0;
@@ -67,7 +67,7 @@
Item *merchant = m_shell.spawns().value(resp.player_id, nullptr);
const char *merchant_name = "unknown";
if (merchant)
- merchant_name = merchant->name();
+ merchant_name = merchant->name().toAscii().data();
QString csv;
csv.sprintf("1^%d^%d^%d^%s^%s",
int(time(NULL)),resp.price,resp.count,
Modified: showeq/branches/pre_6_0_beta/src/category.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/category.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/category.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -56,12 +56,12 @@
if (!filterout.isEmpty())
m_filterout = filterout;
m_color = color;
-
+
int cFlags = REG_EXTENDED | REG_ICASE;
// allocate the filter item
m_filterItem = new FilterItem(filter, cFlags);
- m_filteredFilter = (filter.find(":Filtered:", 0, false) != -1);
+ m_filteredFilter = (filter.indexOf(":Filtered:", 0, Qt::CaseInsensitive) != -1);
// allocate the filter out item
if (m_filterout.isEmpty())
@@ -94,17 +94,26 @@
// ------------------------------------------------------
// CategoryDlg
CategoryDlg::CategoryDlg(QWidget *parent, QString name)
- : QDialog(parent, name, TRUE)
+ : QDialog(parent, Qt::Dialog)
{
+ setObjectName(name);
+ setModal(true);
+ setWindowTitle("Add Category");
+
QFont labelFont;
labelFont.setBold(true);
QBoxLayout* topLayout = new QVBoxLayout(this);
- QBoxLayout* row4Layout = new QHBoxLayout(topLayout);
- QBoxLayout* row3Layout = new QHBoxLayout(topLayout);
- QBoxLayout* row2Layout = new QHBoxLayout(topLayout);
- QBoxLayout* row1Layout = new QHBoxLayout(topLayout);
- QBoxLayout* row0Layout = new QHBoxLayout(topLayout);
+ QBoxLayout* row4Layout = new QHBoxLayout();
+ topLayout->addLayout(row4Layout);
+ QBoxLayout* row3Layout = new QHBoxLayout();
+ topLayout->addLayout(row3Layout);
+ QBoxLayout* row2Layout = new QHBoxLayout();
+ topLayout->addLayout(row2Layout);
+ QBoxLayout* row1Layout = new QHBoxLayout();
+ topLayout->addLayout(row1Layout);
+ QBoxLayout* row0Layout = new QHBoxLayout();
+ topLayout->addLayout(row0Layout);
QLabel *colorLabel = new QLabel ("Color", this);
colorLabel->setFont(labelFont);
@@ -111,7 +120,8 @@
colorLabel->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
row1Layout->addWidget(colorLabel, 0, Qt::AlignLeft);
- m_Color = new QPushButton(this, "color");
+ m_Color = new QPushButton(this);
+ m_Color->setObjectName("color");
m_Color->setText("...");
m_Color->setFont(labelFont);
connect(m_Color, SIGNAL(clicked()),
@@ -123,7 +133,8 @@
nameLabel->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
row4Layout->addWidget(nameLabel);
- m_Name = new QLineEdit(this, "Name");
+ m_Name = new QLineEdit(this);
+ m_Name->setObjectName("Name");
m_Name->setFont(labelFont);
row4Layout->addWidget(m_Name);
@@ -132,7 +143,8 @@
filterLabel->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
row3Layout->addWidget(filterLabel);
- m_Filter = new QLineEdit(this, "Filter");
+ m_Filter = new QLineEdit(this);
+ m_Filter->setObjectName("Filter");
m_Filter->setFont(labelFont);
row3Layout->addWidget(m_Filter);
@@ -141,7 +153,8 @@
filteroutLabel->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
row2Layout->addWidget(filteroutLabel);
- m_FilterOut = new QLineEdit(this, "FilterOut");
+ m_FilterOut = new QLineEdit(this);
+ m_FilterOut->setObjectName("FilterOut");
m_FilterOut->setFont(labelFont);
row2Layout->addWidget(m_FilterOut);
@@ -162,8 +175,8 @@
void CategoryDlg::select_color(void)
{
- QColor newColor =
- QColorDialog::getColor(m_Color->backgroundColor(), this, QString("Category Color"));
+ QColor newColor =
+ QColorDialog::getColor(palette().color(backgroundRole()), this);
if (newColor.isValid())
m_Color->setPalette(QPalette(QColor(newColor)));
@@ -172,8 +185,9 @@
// ------------------------------------------------------
// CategoryMgr
CategoryMgr::CategoryMgr(QObject* parent, const char* name)
- : QObject(parent, name)
+ : QObject(parent)
{
+ setObjectName(name);
reloadCategories();
}
@@ -304,11 +318,11 @@
// name?name:"", color?color:"", filter?filter:"", filterout?filterout:"");
if (!name.isEmpty() && !filter.isEmpty())
- addCategory(name,
- filter,
- dlg->m_FilterOut->text(),
- dlg->m_Color->backgroundColor());
-
+ addCategory(name,
+ filter,
+ dlg->m_FilterOut->text(),
+ dlg->m_Color->palette().color(dlg->m_Color->backgroundRole()));
+
delete dlg;
}
Modified: showeq/branches/pre_6_0_beta/src/cgiconv.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/cgiconv.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/cgiconv.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -28,7 +28,7 @@
#include <cstdlib>
#include <QRegExp>
-#include <QFilh>
+#include <QFile>
#include <QTextStream>
#include "cgiconv.h"
@@ -52,26 +52,15 @@
QString content_length_str = getenv("CONTENT_LENGTH");
int content_length = content_length_str.toInt();
- // allocate a buffer to hold the query
- char* query_str = new char[content_length + 1];
-
// open the data stream
QTextStream postStream(stdin, QIODevice::ReadOnly);
// set the encoding (required for readRawBytes to work)
- postStream.setEncoding(QTextStream::Latin1);
-
+ postStream.setCodec("latin1");
+
// read the data into the allocated buffer
- postStream.readRawBytes(query_str, content_length);
+ query_string = postStream.read(content_length);
- // make sure to NULL terminate the string
- query_str[content_length] = '\0';
-
- // store the data
- query_string = query_str;
-
- // delete the temporary buffer
- delete query_str;
}
else if (request_method == "GET")
{
@@ -96,7 +85,7 @@
do
{
// find the end of the parameter name (ends at '=')
- index = query_string.find('=', oldindex);
+ index = query_string.indexOf('=', oldindex);
if (index == -1)
break;
@@ -113,8 +102,8 @@
oldindex = index + 1;
// find the end of the parameter pair (ends at '&')
- index = query_string.find(paramEndExp, oldindex);
-
+ index = query_string.indexOf(paramEndExp, oldindex);
+
// extract the value from the query_string
if (index != -1)
value = query_string.mid(oldindex, (index - oldindex));
@@ -188,15 +177,14 @@
QString CGI::getParamName(int paramNum)
{
int count = 0;
-
+
// iterate over the list of parameters
- for (CGIParam* param = cgiParams.first();
- param != 0;
- param = cgiParams.next(), ++count)
+ foreach (CGIParam* param, cgiParams)
{
// if the count matches the parameter number requested, then return it.
if (count == paramNum)
return param->getValue();
+ ++count;
}
return "";
@@ -205,11 +193,9 @@
int CGI::getParamNameCount(const QString& paramName)
{
int count = 0;
-
+
// iterate over the list of parameters
- for (CGIParam* param = cgiParams.first();
- param != 0;
- param = cgiParams.next())
+ foreach (CGIParam* param, cgiParams)
{
// if this is the correct parameter, increment the count
if (param->getName() == paramName)
@@ -223,11 +209,9 @@
QString CGI::getParamValue(const QString& paramName, int instance)
{
int count = 0;
-
+
// iterate over the list of parameters
- for (CGIParam* param = cgiParams.first();
- param != 0;
- param = cgiParams.next())
+ foreach (CGIParam* param, cgiParams)
{
// is this the correct parameter
if (param->getName() == paramName)
@@ -234,13 +218,13 @@
{
// yes, is the count correct, if so return the value
if (count == instance)
- return param->getValue();
+ return param->getValue();
// otherwise, increment the count
count++;
- }
+ }
}
-
+
return "";
}
@@ -429,9 +413,9 @@
QString CGI::unescapeURL(QString url)
{
int index = 0;
-
+
// find first % in the string
- index = url.find('%', index);
+ index = url.indexOf('%', index);
// loop over string while %'s exist
while (index != -1)
@@ -440,7 +424,7 @@
url.replace(index, 3, QString(QChar((char)url.mid(index + 1, 2).toInt(NULL, 16))));
// find next occurrence of % in the URL
- index = url.find('%', index + 1);
+ index = url.indexOf('%', index + 1);
}
return url;
Modified: showeq/branches/pre_6_0_beta/src/combatlog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/combatlog.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/combatlog.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -286,11 +286,11 @@
m_widget_mob = initMobWidget();
m_tab->addTab(m_widget_mob, "&Mobs");
- m_clear_menu = new QMenu(this);
- m_clear_menu->insertItem("Clear Offense Stats", this, SLOT(clearOffense()));
- m_clear_menu->insertItem("Clear Mob Stats", this, SLOT(clearMob()));
+ m_clear_menu = new QMenu("&Clear");
+ m_clear_menu->addAction("Clear Offense Stats", this, SLOT(clearOffense()));
+ m_clear_menu->addAction("Clear Mob Stats", this, SLOT(clearMob()));
- m_menu_bar->insertItem("&Clear", m_clear_menu);
+ m_menu_bar->addMenu(m_clear_menu);
updateOffense();
updateDefense();
@@ -369,8 +369,8 @@
m_label_offense_avgnonmelee = new QLabel(summaryGBox);
summaryGridLayout->addWidget(m_label_offense_avgnonmelee, 2, 3);
- summaryGridLayout->setColStretch(1, 1);
- summaryGridLayout->setColStretch(3, 1);
+ summaryGridLayout->setColumnStretch(1, 1);
+ summaryGridLayout->setColumnStretch(3, 1);
summaryGridLayout->setSpacing(5);
return pWidget;
@@ -416,9 +416,9 @@
avoidanceGridLayout->addItem(new QSpacerItem(1,1), 2, 0, 1, 6);
- avoidanceGridLayout->setColStretch(1, 1);
- avoidanceGridLayout->setColStretch(3, 1);
- avoidanceGridLayout->setColStretch(5, 1);
+ avoidanceGridLayout->setColumnStretch(1, 1);
+ avoidanceGridLayout->setColumnStretch(3, 1);
+ avoidanceGridLayout->setColumnStretch(5, 1);
avoidanceGridLayout->setRowStretch(2, 1);
avoidanceGridLayout->setSpacing(5);
@@ -446,9 +446,9 @@
mitigationGridLayout->addItem(new QSpacerItem(1,1), 1, 0, 1, 6);
- mitigationGridLayout->setColStretch(1, 1);
- mitigationGridLayout->setColStretch(3, 1);
- mitigationGridLayout->setColStretch(5, 1);
+ mitigationGridLayout->setColumnStretch(1, 1);
+ mitigationGridLayout->setColumnStretch(3, 1);
+ mitigationGridLayout->setColumnStretch(5, 1);
mitigationGridLayout->setRowStretch(1, 1);
mitigationGridLayout->setSpacing(5);
@@ -477,9 +477,9 @@
summaryGridLayout->addItem(new QSpacerItem(1,1), 2, 0, 1, 6);
- summaryGridLayout->setColStretch(1, 1);
- summaryGridLayout->setColStretch(3, 1);
- summaryGridLayout->setColStretch(5, 1);
+ summaryGridLayout->setColumnStretch(1, 1);
+ summaryGridLayout->setColumnStretch(3, 1);
+ summaryGridLayout->setColumnStretch(5, 1);
summaryGridLayout->setRowStretch(1, 1);
summaryGridLayout->setSpacing(5);
@@ -545,8 +545,8 @@
m_label_mob_lastdps = new QLabel(summaryGBox);
summaryGridLayout->addWidget(m_label_mob_lastdps, 1, 3);
- summaryGridLayout->setColStretch(1, 1);
- summaryGridLayout->setColStretch(3, 1);
+ summaryGridLayout->setColumnStretch(1, 1);
+ summaryGridLayout->setColumnStretch(3, 1);
summaryGridLayout->setSpacing(5);
@@ -638,12 +638,12 @@
case 52: // Tiger Claw
{
// this is a normal skill
- s_type.sprintf("%s(%d)", (const char*)skill_name(iType), iType);
+ s_type.sprintf("%s(%d)", skill_name(iType).toAscii().data(), iType);
break;
}
case 231: // Non Melee Damage
{
- s_type.sprintf("Spell: %s(%d)", (const char*)spell_name(iSpell), iSpell);
+ s_type.sprintf("Spell: %s(%d)", spell_name(iSpell).toAscii().data(), iSpell);
break;
}
default: // Damage Shield?
Modified: showeq/branches/pre_6_0_beta/src/compass.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/compass.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/compass.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -36,10 +36,11 @@
#include <cstdio>
Compass::Compass (QWidget *parent, const char *name)
- : QWidget ( parent, name )
+ : QWidget ( parent )
{
m_ang = 0;
m_dSpawnAngle = -1;
+ setObjectName(name);
}
const QRect compass_rect(-3, 0, 40, 6);
@@ -75,7 +76,7 @@
m_dSpawnAngle = quadDegs;
- repaint ( compassRect(), FALSE);
+ repaint (compassRect());
}
QRect Compass::compassRect() const
@@ -90,7 +91,7 @@
if (m_ang == ((360-degrees)+90))
return;
m_ang = (360-degrees)+90;
- repaint ( compassRect(), FALSE);
+ repaint (compassRect());
emit angleChanged(m_ang);
}
@@ -160,7 +161,7 @@
if (m_dSpawnAngle > 0)
{
- tmp.resetXForm();
+ tmp.resetMatrix();
tmp.translate(pwd2, phd2);
tmp.rotate(-m_dSpawnAngle);
tmp.setPen(Qt::green);
Modified: showeq/branches/pre_6_0_beta/src/datalocationmgr.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/datalocationmgr.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/datalocationmgr.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -36,7 +36,7 @@
m_pkgData = PKGDATADIR;
// create the user directory object
- m_userData = QDir::homeDirPath() + "/" + homeSubDir;
+ m_userData = QDir::homePath() + "/" + homeSubDir;
}
DataLocationMgr::~DataLocationMgr()
@@ -53,10 +53,9 @@
QDir userDataDir(m_userData);
// no, then attempt to create it.
- if (!userDataDir.mkdir(m_userData, true))
+ if (!userDataDir.mkdir(m_userData))
{
- seqWarn("Failed to create '%s'\n",
- (const char*)userDataDir.absPath());
+ seqWarn("Failed to create '%s'\n", userDataDir.absolutePath().toAscii().data());
return false;
}
}
@@ -139,7 +138,7 @@
if (!caseSensitive)
{
// create a case insensitive regex
- QRegExp regex(filename, false, false);
+ QRegExp regex(filename, Qt::CaseInsensitive);
// construct the filterspec to choose only the files with matching access
QDir::Filters filterSpec;
@@ -195,7 +194,7 @@
// ok, try to make it
dir = findOrMakeSubDir(dir1, subdir);
- QFileInfo dirInfo(dir.absPath());
+ QFileInfo dirInfo(dir.absolutePath());
// see if we found or made the subdir and it is writable...
if (dirInfo.exists() && dirInfo.isDir() && dirInfo.isWritable())
@@ -216,9 +215,9 @@
// ok, try to make it
dir = findOrMakeSubDir(dir2, subdir);
-
- dirInfo.setFile(dir.absPath());
+ dirInfo.setFile(dir.absolutePath());
+
// see if we found or made the subdir and it is writable...
if (dirInfo.exists() && dirInfo.isDir() && dirInfo.isWritable())
return QFileInfo(dir, filename);
@@ -230,11 +229,11 @@
if (!dir.cd("tmp"))
if (!dir.cd("temp"))
if (!dir.cd("/var/tmp"))
- return QFileInfo(dir, filename); // can't catch a break
-
+ return QFileInfo(dir, filename); // can't catch a break
+
// ok, try to make the subdirectory
- dir = findOrMakeSubDir(dir.absPath(), subdir);
- dirInfo.setFile(dir.absPath());
+ dir = findOrMakeSubDir(dir.absolutePath(), subdir);
+ dirInfo.setFile(dir.absolutePath());
// see if we found or made the subdir and it is writable...
if (dirInfo.exists() && dirInfo.isDir() && dirInfo.isWritable())
@@ -259,11 +258,11 @@
// if the parent directory doesn't exist, attempt to create it.
if (!dirDir.exists())
- dirDir.mkdir(".", false);
+ dirDir.mkdir(".");
// attempt to create the directory;
if (!dirDir.exists(subdir))
- dirDir.mkdir(subdir, false);
+ dirDir.mkdir("./" + subdir);
// attempt to cd into the directory that was theoretically just created.
if (dirDir.cd(subdir))
@@ -271,5 +270,5 @@
// return a QFileInfo, the caller can use its methods to determine the
// directories status
- return QDir(QFileInfo(dirDir, subdir).dirPath(true));
+ return QDir(QFileInfo(dirDir, subdir).absolutePath());
}
Modified: showeq/branches/pre_6_0_beta/src/datetimemgr.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/datetimemgr.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/datetimemgr.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -31,10 +31,11 @@
#include <QTimer>
DateTimeMgr::DateTimeMgr(QObject* parent, const char* name)
- : QObject(parent, name),
+ : QObject(parent),
m_updateFrequency(60 * 1000),
m_timer(0)
{
+ setObjectName(name);
}
void DateTimeMgr::setUpdateFrequency(int seconds)
@@ -48,7 +49,7 @@
update();
// set the timer to the new interval
- m_timer->changeInterval(m_updateFrequency);
+ m_timer->setInterval(m_updateFrequency);
}
}
@@ -56,7 +57,7 @@
{
const timeOfDayStruct* tday = (const timeOfDayStruct*)data;
- m_refDateTime = QDateTime::currentDateTime(Qt::UTC);
+ m_refDateTime = QDateTime::currentDateTime().toTimeSpec(Qt::UTC);
m_eqDateTime.setDate(QDate(tday->year, tday->month, tday->day));
m_eqDateTime.setTime(QTime(tday->hour - 1, tday->minute, 0));
if (!m_timer)
@@ -63,7 +64,7 @@
{
m_timer = new QTimer(this);
connect(m_timer, SIGNAL(timeout()), SLOT(update()));
- m_timer->start(m_updateFrequency, false);
+ m_timer->start(m_updateFrequency);
}
emit syncDateTime(m_eqDateTime);
@@ -74,7 +75,7 @@
if (!m_eqDateTime.isValid())
return;
- const QDateTime& current = QDateTime::currentDateTime(Qt::UTC);
+ const QDateTime& current = QDateTime::currentDateTime().toTimeSpec(Qt::UTC);
int secs = m_refDateTime.secsTo(current);
if (secs)
Modified: showeq/branches/pre_6_0_beta/src/db3conv.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/db3conv.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/db3conv.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -87,7 +87,7 @@
QFileInfo fileInfo(dbName);
// Get information about the directory the file should be in
- QFileInfo dirInfo(fileInfo.dirPath());
+ QFileInfo dirInfo(fileInfo.absoluteFilePath());
// if the directory that the db will be opened in doesn't exist, just
// warn and fail now
@@ -94,7 +94,7 @@
if (!dirInfo.exists())
{
fprintf(stderr, "DB3Convenience: Data Directory '%s' doesn't exist.\n",
- (const char*)dirInfo.absFilePath());
+ dirInfo.absoluteFilePath().toAscii().data());
// nothing more to do, just return NULL
return (Db*)NULL;
@@ -104,7 +104,7 @@
if (!dirInfo.isDir())
{
fprintf(stderr, "DB3Convenience: Data Directory '%s isn't a directory.\n",
- (const char*)dirInfo.absFilePath());
+ dirInfo.absoluteFilePath().toAscii().data());
// nothing more to do, just return NULL
return (Db*)NULL;
@@ -119,8 +119,8 @@
{
// if the file isn't readable, no point in going on is there...
fprintf(stderr, "DB3Convenience: Data File '%s isn't readable.\n",
- (const char*)dirInfo.absFilePath());
-
+ dirInfo.absoluteFilePath().toAscii().data());
+
// nothing more to do, just return NULL
return (Db*)NULL;
}
@@ -156,9 +156,9 @@
// setup the common database environment for all databases opened
// using this object
- ret = m_dbEnv->open((const char*)dirInfo.absFilePath(), dbEnvFlags,
- 0664);
-
+ ret = m_dbEnv->open(dirInfo.absoluteFilePath().toAscii().data(), dbEnvFlags,
+ 0664);
+
if (ret != 0)
{
// display a human readable error
@@ -187,16 +187,16 @@
#if 1 // can't do verify with transactions, logging, or locking
// verify the database before we go any further
- ret = retdbp->verify((const char*)dbName, NULL, NULL, 0);
+ ret = retdbp->verify(dbName.toAscii().data(), NULL, NULL, 0);
if (ret != 0)
{
// display a human readable error
fprintf(stderr, "DB3Convenience: Db::verify() failed on file '%s': %s\n",
- (const char*)dbName, DbEnv::strerror(ret));
+ dbName.toAscii().data(), DbEnv::strerror(ret));
if (ret == DB_RUNRECOVERY)
- fprintf(stderr, "DB3Convenience: Please run db_recover on file '%s'\n",
- (const char*)dbName);
+ fprintf(stderr, "DB3Convenience: Please run db_recover on file '%s'\n",
+ dbName.toAscii().data());
// check if it's a file access problem
if (openForReadOnly)
@@ -220,8 +220,8 @@
{
// display a human readable error
fprintf(stderr,
- "DB3Convenience: Db::set_flags(0) failed on file '%s': %s\n",
- (const char*)dbName, DbEnv::strerror(ret));
+ "DB3Convenience: Db::set_flags(0) failed on file '%s': %s\n",
+ dbName.toAscii().data(), DbEnv::strerror(ret));
// delete the database handle since it's not usable
delete retdbp;
@@ -233,13 +233,13 @@
// open the database
// ret = retdbp->open((const char*)dbName, NULL, DB_HASH, dbOpenFlags, 0664);
- ret = retdbp->open((const char*)dbName, NULL, DB_BTREE, dbOpenFlags, 0664);
-
+ ret = retdbp->open(NULL, dbName.toAscii().data(), NULL, DB_BTREE, dbOpenFlags, 0664);
+
if (ret != 0)
{
// display a human readable error
- fprintf(stderr, "DB3Convenience: Db::open() failed on file '%s': %s\n",
- (const char*)dbName, DbEnv::strerror(ret));
+ fprintf(stderr, "DB3Convenience: Db::open() failed on file '%s': %s\n",
+ dbName.toAscii().data(), DbEnv::strerror(ret));
// check if it's a file access problem
if (openForReadOnly)
@@ -283,7 +283,7 @@
success = true;
break;
default:
- displayDB3Error(ret, "Insert: put", (const char*)dbName);
+ displayDB3Error(ret, "Insert: put", dbName.toAscii().data());
}
}
@@ -307,7 +307,7 @@
success = true;
break;
default:
- displayDB3Error(ret, "Delete: del", (const char*)dbName);
+ displayDB3Error(ret, "Delete: del", dbName.toAscii().data());
}
}
@@ -335,7 +335,7 @@
success = false;
break;
default:
- displayDB3Error(ret, "IsEntryExist: get", (const char*)dbName);
+ displayDB3Error(ret, "IsEntryExist: get", dbName.toAscii().data());
}
}
@@ -368,7 +368,7 @@
success = false;
break;
default:
- displayDB3Error(ret, "GetEntry: get", (const char*)dbName);
+ displayDB3Error(ret, "GetEntry: get", dbName.toAscii().data());
}
}
@@ -404,7 +404,7 @@
int ret = db->close(0);
if (ret != 0)
- displayDB3Error(ret, "Close: close", (const char*)dbName);
+ displayDB3Error(ret, "Close: close", dbName.toAscii().data());
// remove the db from the dictionary
m_dbDict.remove(dbName);
@@ -440,11 +440,8 @@
ret = db->close(0);
if (ret != 0)
- displayDB3Error(ret, "Shutdown: close", (const char*)dbName);
+ displayDB3Error(ret, "Shutdown: close", dbName.toAscii().data());
- // increment to next database
- ++it;
-
// remove the db from the dictionary
m_dbDict.remove(dbName);
@@ -513,7 +510,7 @@
if (ret != 0)
{
- displayDB3Error(ret, "GetFirstKey: cursor", (const char*)dbName);
+ displayDB3Error(ret, "GetFirstKey: cursor", dbName.toAscii().data());
return false;
}
@@ -531,7 +528,7 @@
// display an error on any other error returns
if (ret != 0)
{
- displayDB3Error(ret, "GetFirstKey: get", (const char*)m_dbName);
+ displayDB3Error(ret, "GetFirstKey: get", m_dbName.toAscii().data());
return false;
}
@@ -582,7 +579,7 @@
// display an error on any other error returns
if (ret != 0)
{
- displayDB3Error(ret, "GetNextKey: get", (const char*)m_dbName);
+ displayDB3Error(ret, "GetNextKey: get", m_dbName.toAscii().data());
return false;
}
@@ -645,7 +642,7 @@
int ret = m_db->close(0);
if (ret != 0)
- displayDB3Error(ret, "Done: close", (const char*)m_dbName);
+ displayDB3Error(ret, "Done: close", m_dbName.toAscii().data());
}
// if there is any data left over that the user didn't get, then free it
Modified: showeq/branches/pre_6_0_beta/src/drawmap.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/drawmap.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/drawmap.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -205,9 +205,9 @@
"yellow",
"gray"
};
-
- QString lcolorname = colorname.lower();
+ QString lcolorname = colorname.toLower();
+
for (uint32_t i = 0; i < sizeof(colornames)/sizeof(const char*); i++)
{
if (lcolorname == colornames[i])
@@ -396,11 +396,11 @@
break;
}
}
-
+
fclose (fh);
- char message[128];
+ char message[258];
sprintf (message, "%s [%s]", zoneLong, zoneShort);
-
+
reAdjust ();
}
#ifdef ZBTEMP
@@ -524,10 +524,10 @@
tmpcolor = mapcolors[locationColor[n]];
}
- gdImageString (im, gdFontSmall,
- calcXOffset (locationX[n]) - 2,
- calcYOffset (locationY[n]) - 2,
- (unsigned char*)(const char *)locationName[n], tmpcolor);
+ gdImageString (im, gdFontSmall,
+ calcXOffset (locationX[n]) - 2,
+ calcYOffset (locationY[n]) - 2,
+ (unsigned char*)locationName[n].toAscii().data(), tmpcolor);
}
/* Print the http header */
@@ -583,7 +583,7 @@
mapName.replace(slashExp, "_");
mapName.prepend(PKGDATADIR "maps/");
- loadFileMap ((const char*)mapName);
+ loadFileMap (mapName.toAscii().data());
paintMap();
}
else
@@ -590,9 +590,10 @@
{
// open the output data stream
QTextStream out(stdout, QIODevice::WriteOnly);
- out.setEncoding(QTextStream::Latin1);
- out.flags(QTextStream::showbase | QTextStream::dec);
-
+ out.setCodec("latin1");
+ out.setIntegerBase(10);
+ out.setNumberFlags(QTextStream::ShowBase);
+
const char* header =
"Content-type: text/html; charset=iso-8859-1\n\n"
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n"
@@ -647,23 +648,21 @@
out << "<TD><SELECT name=\"map\" size=\"1\">\n";
// create a file info list
- const QFileInfoList *list = mapDir.entryInfoList();
+ const QFileInfoList list = mapDir.entryInfoList();
// create an iterator over the list
- QFileInfoListIterator it( *list );
-
+ QListIterator<QFileInfo> it( list );
+
// pointer to the file info for the current file
- QFileInfo *fi;
+ QFileInfo fi;
- while ( (fi=it.current()) )
+ while (it.hasNext())
{
- out << "<OPTION value=\"" << fi->fileName() << "\"";
- if (mapName == fi->fileName())
- out << " selected";
- out << ">" << fi->baseName() << "</OPTION>\n";
-
- // goto next element from list
- ++it;
+ fi = it.next();
+ out << "<OPTION value=\"" << fi.fileName() << "\"";
+ if (mapName == fi.fileName())
+ out << " selected";
+ out << ">" << fi.baseName() << "</OPTION>\n";
}
out << "</SELECT></TD>\n";
Modified: showeq/branches/pre_6_0_beta/src/editor.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/editor.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/editor.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -27,7 +27,6 @@
#include <cstring>
#include <cerrno>
-#include <QApplication>
#include <QToolBar>
#include <QStatusBar>
#include <QMenu>
@@ -94,20 +93,21 @@
};
EditorWindow::EditorWindow(const char *fileName)
- : QMainWindow( 0, "ShowEQ - Editor", Qt::WDestructiveClose )
+ : QMainWindow( 0, Qt::WDestructiveClose )
{
+ setObjectName("ShowEQ - Editor");
QPixmap openIcon, saveIcon;
openIcon = QPixmap( fileopen );
saveIcon = QPixmap( filesave );
fileTools = new QToolBar(this);
- fileTools->setLabel( tr( "File Operations" ) );
+ fileTools->setWindowTitle( tr( "File Operations" ) );
fileTools->addAction(openIcon, "Open File", this, SLOT(load()));
fileTools->addAction(saveIcon, "Save File", this, SLOT(save()));
addToolBar(fileTools);
- QMenu * file = new QMenu( this );
- menuBar()->insertItem( "&File", file );
+ QMenu * file = new QMenu("&File", this);
+ menuBar()->addMenu(file);
file->addAction( openIcon, "&Open", this, SLOT(load()), Qt::CTRL+Qt::Key_O );
@@ -115,11 +115,12 @@
file->addSeparator();
file->addAction( "&Close Editor", this, SLOT(close()), Qt::CTRL+Qt::Key_W );
- e = new QTextEdit( this, "editor" );
+ e = new QTextEdit(this);
+ e->setObjectName("editor");
e->setFocus();
setCentralWidget( e );
- statusBar()->message( "Ready", 2000 );
+ statusBar()->showMessage( "Ready", 2000 );
resize( 600, 450 );
filename = (QString)fileName;
@@ -134,9 +135,9 @@
{
QString fn = QFileDialog::getOpenFileName(this);
if ( !fn.isEmpty() )
- load( fn );
+ load(fn.toAscii().data());
else
- statusBar()->message( "File Open Cancelled", 2000 );
+ statusBar()->showMessage( "File Open Cancelled", 2000 );
}
void EditorWindow::load( const char *fileName )
@@ -155,11 +156,11 @@
f.close();
e->repaint();
- e->setModified( FALSE );
- setCaption( fileName );
+ e->document()->setModified( FALSE );
+ setWindowTitle( fileName );
QString s;
s.sprintf( "Opened %s", fileName );
- statusBar()->message( s, 2000 );
+ statusBar()->showMessage( s, 2000 );
}
void EditorWindow::save()
@@ -169,10 +170,10 @@
return;
}
- QString text = e->text();
+ QString text = e->toPlainText();
QFile f( filename );
if ( !f.open( QIODevice::WriteOnly ) ) {
- statusBar()->message( QString("Could not write to %1").arg(filename),
+ statusBar()->showMessage( QString("Could not write to %1").arg(filename),
2000 );
return;
}
@@ -181,11 +182,11 @@
t << text;
f.close();
- e->setModified( FALSE );
+ e->document()->setModified( FALSE );
- setCaption( filename );
+ setWindowTitle( filename );
- statusBar()->message( QString( "Saved %1" ).arg( filename ), 2000 );
+ statusBar()->showMessage( QString( "Saved %1" ).arg( filename ), 2000 );
}
void EditorWindow::saveAs()
@@ -195,13 +196,13 @@
filename = fn;
save();
} else {
- statusBar()->message( "Saving cancelled", 2000 );
+ statusBar()->showMessage( "Saving cancelled", 2000 );
}
}
void EditorWindow::closeEvent( QCloseEvent* ce )
{
- if ( !e->isModified() ) {
+ if ( !e->document()->isModified() ) {
ce->accept();
return;
}
Modified: showeq/branches/pre_6_0_beta/src/eqstr.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/eqstr.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/eqstr.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -56,8 +56,7 @@
// open the file read only
if (!formatFile.open(QIODevice::ReadOnly))
{
- seqWarn("EQStr: Failed to open '%s'",
- fileName.latin1());
+ seqWarn("EQStr: Failed to open '%s'", fileName.toLatin1().data());
return false;
}
@@ -69,11 +68,10 @@
// construct a regex to deal with either style line termination
QRegExp lineTerm("[\r\n]{1,2}");
-
+
// split the data into lines at the line termination
- QStringList lines = QStringList::split(lineTerm,
- QString::fromUtf8(textData), false);
-
+ QStringList lines = QString::fromUtf8(textData).split(lineTerm, QString::SkipEmptyParts);
+
// start iterating over the lines
QStringList::Iterator it = lines.begin();
@@ -91,8 +89,8 @@
for (; it != lines.end(); ++it)
{
// find the beginning space
- spc = (*it).find(' ');
-
+ spc = (*it).indexOf(' ');
+
// convert the beginnign of the string to a ULong
formatId = (*it).left(spc).toULong();
@@ -107,9 +105,9 @@
m_loaded = true;
seqInfo("Loaded %d message strings from '%s' maxFormat=%d",
- m_messageStrings.count(), fileName.latin1(),
- maxFormatId);
-
+ m_messageStrings.count(), fileName.toLatin1().data(),
+ maxFormatId);
+
return true;
}
@@ -183,7 +181,7 @@
bool ok;
int curPos;
- size_t substArg;
+ int substArg;
int substArgValue;
QString substFormatStringRes;
QString substFormatString;
@@ -191,10 +189,10 @@
////////////////////////////
// replace template (%T) arguments in formatted string
QString formatString = formatStringRes;
- QRegExp rxt("%T(\\d{1,3})", true, false);
+ QRegExp rxt("%T(\\d{1,3})");
// find first template substitution
- curPos = rxt.search(formatString, 0);
+ curPos = rxt.indexIn(formatString, 0);
while (curPos != -1)
{
@@ -215,7 +213,7 @@
curPos += rxt.matchedLength(); // if no replacement string, skip over
// find next substitution
- curPos = rxt.search(formatString, curPos);
+ curPos = rxt.indexIn(formatString, curPos);
}
////////////////////////////
@@ -222,10 +220,10 @@
// now replace substitution arguments in formatted string
// NOTE: not using QString::arg() because not all arguments are always used
// and it will do screwy stuff in this situation
- QRegExp rx("%(\\d{1,3})", true, false);
+ QRegExp rx("%(\\d{1,3})");
// find first template substitution
- curPos = rx.search(formatString, 0);
+ curPos = rx.indexIn(formatString, 0);
while (curPos != -1)
{
@@ -238,7 +236,7 @@
curPos += rx.matchedLength(); // if no such argument, skip over
// find next substitution
- curPos = rx.search(formatString, curPos);
+ curPos = rx.indexIn(formatString, curPos);
}
return formatString;
Modified: showeq/branches/pre_6_0_beta/src/experiencelog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/experiencelog.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/experiencelog.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -176,36 +176,68 @@
m_calcZEM=0;
m_ZEMviewtype = 0;
- m_view_menu = new QMenu( this );
- m_view_menu->insertItem( "&All Mobs", this, SLOT(viewAll()) );
- m_view_menu->insertItem( "Previous &15 Minutes", this, SLOT(view15Minutes()) );
- m_view_menu->insertItem( "Previous &30 Minutes", this, SLOT(view30Minutes()) );
- m_view_menu->insertItem( "Previous &60 Minutes", this, SLOT(view60Minutes()) );
- m_view_menu->setItemChecked( m_view_menu->idAt(0), true );
+ QAction* tmpAction;
- m_view_menu->insertSeparator();
- m_exp_rate_menu = new QMenu( this );
- m_exp_rate_menu->insertItem( "per &minute", this, SLOT(viewRatePerMinute()) );
- m_exp_rate_menu->insertItem( "per &hour", this, SLOT(viewRatePerHour()) );
- m_exp_rate_menu->setItemChecked( m_exp_rate_menu->idAt(0), true );
- m_view_menu->insertItem( "Experience &Rate", m_exp_rate_menu );
+ m_view_menu = new QMenu("&View");
+ QActionGroup* view_time_action_group = new QActionGroup(m_view_menu);
- m_view_menu->insertSeparator();
- m_view_menu->insertItem( "Clear Kills", this, SLOT(viewClear()) );
+ tmpAction = m_view_menu->addAction( "&All Mobs", this, SLOT(viewAll()) );
+ tmpAction->setCheckable(true);
+ tmpAction->setChecked(true);
+ view_time_action_group->addAction(tmpAction);
+ tmpAction = m_view_menu->addAction( "Previous &15 Minutes", this, SLOT(view15Minutes()) );
+ tmpAction->setCheckable(true);
+ view_time_action_group->addAction(tmpAction);
+ tmpAction = m_view_menu->addAction( "Previous &30 Minutes", this, SLOT(view30Minutes()) );
+ tmpAction->setCheckable(true);
+ view_time_action_group->addAction(tmpAction);
+ tmpAction = m_view_menu->addAction( "Previous &60 Minutes", this, SLOT(view60Minutes()) );
+ tmpAction->setCheckable(true);
+ view_time_action_group->addAction(tmpAction);
+ view_time_action_group->setExclusive(true);
- m_view_menu->insertSeparator();
- m_ZEM_menu = new QMenu( this );
- m_ZEM_menu->insertItem( "Calculated Value", this, SLOT(viewZEMcalculated()) );
- m_ZEM_menu->insertItem( "Raw Value", this, SLOT(viewZEMraw()) );
- m_ZEM_menu->insertItem( "Percent Bonus", this, SLOT(viewZEMpercent()) );
- m_ZEM_menu->setItemChecked( m_ZEM_menu->idAt(0), true );
- m_view_menu->insertItem( "ZEM View Options", m_ZEM_menu );
- m_view_menu->insertItem( "Calculate ZEM on next kill", this, SLOT(calcZEMNextKill()) );
+ m_view_menu->addSeparator();
+ QActionGroup* exp_rate_action_group = new QActionGroup(m_view_menu);
+ m_exp_rate_menu = new QMenu("Experience &Rate");
+ tmpAction = m_exp_rate_menu->addAction( "per &minute", this, SLOT(viewRatePerMinute()) );
+ tmpAction->setCheckable(true);
+ tmpAction->setChecked(true);
+ exp_rate_action_group->addAction(tmpAction);
+ tmpAction = m_exp_rate_menu->addAction( "per &hour", this, SLOT(viewRatePerHour()) );
+ exp_rate_action_group->addAction(tmpAction);
+ tmpAction->setCheckable(true);
+ exp_rate_action_group->setExclusive(true);
+ m_view_menu->addMenu(m_exp_rate_menu);
+
+ m_view_menu->addSeparator();
+ m_view_menu->addAction( "Clear Kills", this, SLOT(viewClear()) );
+
+ m_view_menu->addSeparator();
+ m_ZEM_menu = new QMenu("ZEM View Options");
+ QActionGroup* zem_options_action_group = new QActionGroup(m_view_menu);
+ tmpAction = m_ZEM_menu->addAction( "Calculated Value", this, SLOT(viewZEMcalculated()) );
+ tmpAction->setCheckable(true);
+ tmpAction->setChecked(true);
+ zem_options_action_group->addAction(tmpAction);
+ tmpAction = m_ZEM_menu->addAction( "Raw Value", this, SLOT(viewZEMraw()) );
+ tmpAction->setCheckable(true);
+ zem_options_action_group->addAction(tmpAction);
+ tmpAction = m_ZEM_menu->addAction( "Percent Bonus", this, SLOT(viewZEMpercent()) );
+ tmpAction->setCheckable(true);
+ zem_options_action_group->addAction(tmpAction);
+ zem_options_action_group->setExclusive(true);
+
+ m_view_menu->addMenu(m_ZEM_menu);
+
+ m_action_calc_zem = m_view_menu->addAction( "Calculate ZEM on next kill",
+ this, SLOT(calcZEMNextKill()) );
+ m_action_calc_zem->setCheckable(true);
+
m_layout = new QVBoxLayout(boxLayout());
m_menu_bar = new QMenuBar( this );
- m_menu_bar->insertItem( "&View", m_view_menu );
+ m_menu_bar->addMenu(m_view_menu );
//m_layout->addSpacing( m_menu_bar->height() + 5 );
m_layout->addWidget(m_menu_bar);
@@ -221,7 +253,7 @@
m_exp_listview->addColumn("Class total");
m_exp_listview->addColumn("Group total");
m_exp_listview->addColumn("Experience Gained");
-
+
m_exp_listview->restoreColumns();
m_exp_listview->setMinimumSize( m_exp_listview->sizeHint().width(),
@@ -272,8 +304,8 @@
m_time_to_level = new QLabel(statsGBox);
statsGridLayout->addWidget(m_time_to_level, 3, 3);
- statsGridLayout->setColStretch( 1, 1 );
- statsGridLayout->setColStretch( 3, 1 );
+ statsGridLayout->setColumnStretch( 1, 1 );
+ statsGridLayout->setColumnStretch( 3, 1 );
statsGridLayout->setSpacing( 5 );
updateAverage( );
@@ -285,7 +317,7 @@
QFileInfo fileInfo = m_dataLocMgr->findWriteFile("logs", "exp.log");
- m_log = fopen(fileInfo.absFilePath(), "a");
+ m_log = fopen(fileInfo.absoluteFilePath().toAscii().data(), "a");
if (m_log == 0)
{
m_log_exp = 0;
@@ -298,7 +330,7 @@
fileInfo = m_dataLocMgr->findWriteFile("logs", "newexp.log");
- m_newExpLogFile = fileInfo.absFilePath();
+ m_newExpLogFile = fileInfo.absoluteFilePath();
}
void ExperienceWindow::savePrefs()
@@ -324,7 +356,7 @@
#ifdef DEBUGEXP
resize( sizeHint() );
qDebug("ExperienceWindow::addExpRecord() '%s', lvl %d, exp %d",
- mob_name.ascii(), mob_level, xp_gained);
+ mob_name.toAscii().data(), mob_level, xp_gained);
#endif
if (m_log_exp)
@@ -344,8 +376,8 @@
{
calculateZEM(xp_gained, mob_level);
m_calcZEM = 0;
- m_view_menu->setItemChecked(m_view_menu->idAt(10), false);
- }
+ m_action_calc_zem->setChecked(false);
+ }
s_xp_value.setNum(xp->getExpValue());
QString s_xp_valueZEM;
switch (m_ZEMviewtype) {
@@ -377,21 +409,19 @@
FILE* newlogfp = NULL;
// open the file for append
- newlogfp = fopen(m_newExpLogFile, "a");
+ newlogfp = fopen(m_newExpLogFile.toAscii().data(), "a");
if (newlogfp != NULL)
{
// append a new record entry
- fprintf(newlogfp,
- "0\t%s\t%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%d\t%d\t%lu",
- s_time, (const char*)s_mob_name, mob_level,
- (const char*)s_xp_value, (const char*)s_xp_valueZEM,
- (const char*)s_xp_valuep, (const char*)s_xp_valueg,
- (const char*)s_xp_gained,
- (const char*)m_player->name(),
- (const char*)m_player->lastName(),
- m_player->level(),
+ fprintf(newlogfp,
+ "0\t%s\t%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%d\t%d\t%lu",
+ s_time, s_mob_name.toAscii().data(), mob_level,
+ s_xp_value.toAscii().data(), s_xp_valueZEM.toAscii().data(),
+ s_xp_valuep.toAscii().data(), s_xp_valueg.toAscii().data(),
+ s_xp_gained.toAscii().data(), m_player->name().toAscii().data(),
+ m_player->lastName().toAscii().data(), m_player->level(),
m_player->classVal(), m_group->groupSize());
const Spawn* spawn;
@@ -564,99 +594,60 @@
}
-void ExperienceWindow::viewAll()
+void ExperienceWindow::viewAll()
{
m_timeframe = 0;
updateAverage();
- m_view_menu->setItemChecked(m_view_menu->idAt(0), true);
- m_view_menu->setItemChecked(m_view_menu->idAt(1), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(2), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(3), false);
-
}
-void ExperienceWindow::view15Minutes()
+void ExperienceWindow::view15Minutes()
{
m_timeframe = 15;
updateAverage();
- m_view_menu->setItemChecked(m_view_menu->idAt(0), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(1), true);
- m_view_menu->setItemChecked(m_view_menu->idAt(2), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(3), false);
-
}
-void ExperienceWindow::view30Minutes()
+void ExperienceWindow::view30Minutes()
{
m_timeframe = 30;
updateAverage();
- m_view_menu->setItemChecked(m_view_menu->idAt(0), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(1), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(2), true);
- m_view_menu->setItemChecked(m_view_menu->idAt(3), false);
-
}
-void ExperienceWindow::view60Minutes()
+void ExperienceWindow::view60Minutes()
{
m_timeframe = 60;
updateAverage();
- m_view_menu->setItemChecked(m_view_menu->idAt(0), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(1), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(2), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(3), true);
-
}
-void ExperienceWindow::viewRatePerHour()
+void ExperienceWindow::viewRatePerHour()
{
m_ratio = 60;
updateAverage();
- m_exp_rate_menu->setItemChecked(m_exp_rate_menu->idAt(0), false);
- m_exp_rate_menu->setItemChecked(m_exp_rate_menu->idAt(1), true);
-
}
-void ExperienceWindow::viewRatePerMinute()
+void ExperienceWindow::viewRatePerMinute()
{
m_ratio = 1;
updateAverage();
- m_exp_rate_menu->setItemChecked(m_exp_rate_menu->idAt(0), true);
- m_exp_rate_menu->setItemChecked(m_exp_rate_menu->idAt(1), false);
-
}
-void ExperienceWindow::calcZEMNextKill()
+void ExperienceWindow::calcZEMNextKill()
{
m_calcZEM = 1;
- m_view_menu->setItemChecked(m_view_menu->idAt(10), true);
}
-void ExperienceWindow::viewZEMcalculated()
+void ExperienceWindow::viewZEMcalculated()
{
m_ZEMviewtype = 0;
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(0), true);
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(1), false);
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(2), false);
-
}
-void ExperienceWindow::viewZEMraw()
+void ExperienceWindow::viewZEMraw()
{
m_ZEMviewtype = 1;
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(0), false);
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(1), true);
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(2), false);
-
}
-void ExperienceWindow::viewZEMpercent()
+void ExperienceWindow::viewZEMpercent()
{
m_ZEMviewtype = 2;
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(0), false);
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(1), false);
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(2), true);
-
}
void ExperienceWindow::viewClear()
Modified: showeq/branches/pre_6_0_beta/src/experiencelog.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/experiencelog.h 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/experiencelog.h 2020-11-02 01:41:45 UTC (rev 1090)
@@ -150,6 +150,7 @@
int m_timeframe;
int m_ratio;
int m_calcZEM;
+ QAction* m_action_calc_zem;
int m_ZEMviewtype;
int m_log_exp;
FILE* m_log;
Modified: showeq/branches/pre_6_0_beta/src/filter.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/filter.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/filter.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -79,7 +79,7 @@
QString regexString = workString;
// find the semi-colon that seperates the regex from the level info
- int breakPoint = workString.find(';');
+ int breakPoint = workString.indexOf(';');
// if no semi-colon, then it's all a regex
if (breakPoint == -1)
@@ -99,7 +99,7 @@
#endif
// see if the level string is a range
- breakPoint = levelString.find('-');
+ breakPoint = levelString.indexOf('-');
bool ok;
int level;
@@ -175,23 +175,23 @@
(const char*)regexString, minLevel, maxLevel);
#endif
- m_regexp.setWildcard(false);
- m_regexp.setCaseSensitive(caseSensitive);
+ m_regexp.setPatternSyntax(QRegExp::RegExp);
+ m_regexp.setCaseSensitivity(caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
// For the pattern, save off the original. This is what will be saved
// during save operations. But the actual regexp we filter with will
// mark the # in spawn names as optional to aid in filter writing.
- m_regexpOriginalPattern = QString(regexString.ascii());
+ m_regexpOriginalPattern = QString(regexString.toAscii().data());
QString fixedFilterPattern = regexString;
- fixedFilterPattern.replace("Name:", "Name:#?", false);
+ fixedFilterPattern.replace("Name:", "Name:#?", Qt::CaseInsensitive);
m_regexp.setPattern(fixedFilterPattern);
if (!m_regexp.isValid())
{
seqWarn("Filter Error: '%s' - %s",
- (const char*)m_regexp.pattern(),
- (const char*)m_regexp.errorString());
+ m_regexp.pattern().toAscii().data(),
+ m_regexp.errorString().toAscii().data());
}
}
@@ -203,8 +203,8 @@
if (!m_regexp.isValid())
{
seqWarn("Filter Error: '%s' - %s",
- (const char*)m_regexp.pattern(),
- (const char*)m_regexp.errorString());
+ m_regexp.pattern().toAscii().data(),
+ m_regexp.errorString().toAscii().data());
}
}
@@ -237,7 +237,7 @@
bool FilterItem::isFiltered(const QString& filterString, uint8_t level) const
{
// check the main filter string
- if (m_regexp.search(filterString) != -1)
+ if (m_regexp.indexIn(filterString) != -1)
{
// is there is a level range component to this filter
if ((m_minLevel > 0) || (m_maxLevel > 0))
@@ -355,7 +355,7 @@
if (re->name() == filterPattern) // if match
{
// remove the filter
- m_filterItems.remove(re);
+ delete m_filterItems.takeAt(m_filterItems.indexOf(re));
#ifdef DEBUG_FILTER
seqDebug("Removed '%s' from List", (const char*)filterPattern);
@@ -455,10 +455,10 @@
break;
if (re->minLevel() || re->maxLevel())
- seqInfo("\t'%s' (%d, %d)",
- (const char*)re->name().utf8(), re->minLevel(), re->maxLevel());
+ seqInfo("\t'%s' (%d, %d)",
+ re->name().toUtf8().data(), re->minLevel(), re->maxLevel());
else
- seqInfo("\t'%s'", (const char*)re->name().utf8());
+ seqInfo("\t'%s'", re->name().toUtf8().data());
}
}
@@ -556,9 +556,9 @@
// 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.setIntegerBase(10);
@@ -604,13 +604,13 @@
FilterMap::const_iterator it;
seqInfo("Filters from file '%s':",
- (const char*)m_file);
+ m_file.toAscii().data());
// iterate over the filters
for (it = m_filters.begin(); it != m_filters.end(); it++)
{
// print the header
- seqInfo("Filter Type '%s':",
- (const char*)m_types.name(it->first));
+ seqInfo("Filter Type '%s':",
+ m_types.name(it->first).toAscii().data());
// list off the actual filters
it->second->listFilters();
Modified: showeq/branches/pre_6_0_beta/src/filteredspawnlog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/filteredspawnlog.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/filteredspawnlog.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -92,12 +92,12 @@
// log the information
outputf("%s %s %s LOC %dy, %dx, %dz at %s (%s)\n",
- (const char*)m_filterMgr->filterString(flag),
- action,
- (const char*)item->name(),
- item->y(), item->x(), item->z(),
- eqDate.isValid() ? (const char*)eqDate.toString() : "",
- (const char*)item->spawnTimeStr());
+ m_filterMgr->filterString(flag).toAscii().data(),
+ action,
+ item->name().toAscii().data(),
+ item->y(), item->x(), item->z(),
+ eqDate.isValid() ? eqDate.toString().toAscii().data() : "",
+ item->spawnTimeStr().toAscii().data());
flush();
}
Modified: showeq/branches/pre_6_0_beta/src/filtermgr.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/filtermgr.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/filtermgr.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -44,12 +44,13 @@
//----------------------------------------------------------------------
// FilterMgr
-FilterMgr::FilterMgr(const DataLocationMgr* dataLocMgr,
+FilterMgr::FilterMgr(const DataLocationMgr* dataLocMgr,
const QString filterFile, bool spawnfilter_case)
- : QObject(NULL, "filtermgr"),
+ : QObject(NULL),
m_dataLocMgr(dataLocMgr),
m_caseSensitive(spawnfilter_case)
{
+ setObjectName("filtermgr");
// Initialize filters
// allocate general filter types object
@@ -135,9 +136,9 @@
fileInfo =
m_dataLocMgr->findExistingFile("filters", fileInfo.fileName(), false);
- m_filterFile = fileInfo.absFilePath();
+ m_filterFile = fileInfo.absoluteFilePath();
- seqInfo("Loading Filters from '%s'", (const char*)m_filterFile);
+ seqInfo("Loading Filters from '%s'", m_filterFile.toAscii().data());
m_filters->load(m_filterFile);
@@ -149,9 +150,9 @@
QFileInfo fileInfo =
m_dataLocMgr->findExistingFile("filters", fileName, false);
- m_filterFile = fileInfo.absFilePath();
+ m_filterFile = fileInfo.absoluteFilePath();
- seqInfo("Loading Filters from '%s'", (const char*)m_filterFile);
+ seqInfo("Loading Filters from '%s'", m_filterFile.toAscii().data());
m_filters->load(m_filterFile);
@@ -165,9 +166,9 @@
fileInfo = m_dataLocMgr->findWriteFile("filters", fileInfo.fileName(), true);
- m_filterFile = fileInfo.absFilePath();
+ m_filterFile = fileInfo.absoluteFilePath();
- seqInfo("Saving filters to %s", (const char*)m_filterFile);
+ seqInfo("Saving filters to %s", m_filterFile.toAscii().data());
m_filters->save(m_filterFile);
}
@@ -240,9 +241,9 @@
QFileInfo fileInfo =
m_dataLocMgr->findExistingFile("filters", fileName, false);
- m_zoneFilterFile = fileInfo.absFilePath();
+ m_zoneFilterFile = fileInfo.absoluteFilePath();
- seqInfo("Loading Zone Filter File: %s", (const char*)m_zoneFilterFile);
+ seqInfo("Loading Zone Filter File: %s", m_zoneFilterFile.toAscii().data());
m_zoneFilters->load(m_zoneFilterFile);
@@ -256,9 +257,9 @@
fileInfo = m_dataLocMgr->findExistingFile("filters", fileInfo.fileName(),
false);
- m_zoneFilterFile = fileInfo.absFilePath();
+ m_zoneFilterFile = fileInfo.absoluteFilePath();
- seqInfo("Loading Zone Filter File: %s", (const char*)m_zoneFilterFile);
+ seqInfo("Loading Zone Filter File: %s", m_zoneFilterFile.toAscii().data());
m_zoneFilters->load(m_zoneFilterFile);
@@ -278,9 +279,9 @@
fileInfo = m_dataLocMgr->findWriteFile("filters", fileInfo.fileName(), true);
- m_zoneFilterFile = fileInfo.absFilePath();
+ m_zoneFilterFile = fileInfo.absoluteFilePath();
- seqInfo("Saving filters to %s", (const char*)m_zoneFilterFile);
+ seqInfo("Saving filters to %s", m_zoneFilterFile.toAscii().data());
if (! m_zoneFilters->save(m_zoneFilterFile))
{
Modified: showeq/branches/pre_6_0_beta/src/filternotifications.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/filternotifications.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/filternotifications.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -33,15 +33,17 @@
#include <QApplication>
FilterNotifications::FilterNotifications(QObject* parent, const char* name)
- : QObject(parent, name),
+ : QObject(parent),
m_useSystemBeep(false),
m_useCommands(false)
{
- m_useSystemBeep =
+ setObjectName(name);
+
+ m_useSystemBeep =
pSEQPrefs->getPrefBool("SystemBeep", "Filters", m_useSystemBeep);
- m_useCommands =
- pSEQPrefs->getPrefBool("EnableCommands", "Filters",
- m_useCommands);
+ m_useCommands =
+ pSEQPrefs->getPrefBool("EnableCommands", "Filters",
+ m_useCommands);
}
FilterNotifications::~FilterNotifications()
@@ -137,9 +139,9 @@
// now, replace all occurrances of %c with the audio cue
command.replace(cueExp, audioCue);
-
+
// fire off the command
- system ((const char*)command);
+ system (command.toAscii().data());
}
#ifndef QMAKEBUILD
Modified: showeq/branches/pre_6_0_beta/src/map.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/map.h 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/map.h 2020-11-02 01:41:45 UTC (rev 1090)
@@ -677,7 +677,7 @@
{
public:
MapFilterLineEdit(QWidget* parent = 0, const char* name = 0)
- : QLineEdit(parent, name) {}
+ : QLineEdit(parent) {}
~MapFilterLineEdit() {} ;
protected:
Modified: showeq/branches/pre_6_0_beta/src/messagefilter.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/messagefilter.h 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/messagefilter.h 2020-11-02 01:41:45 UTC (rev 1090)
@@ -82,7 +82,7 @@
const QString& message) const
{
return (((m_types & messageTypeMask) != 0) &&
- (m_regexp.search(message) != -1));
+ (m_regexp.indexIn(message) != -1));
}
inline bool MessageFilter::operator==(const MessageFilter& filter) const
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|