|
From: <cn...@us...> - 2020-10-25 22:16:13
|
Revision: 1068
http://sourceforge.net/p/seq/svn/1068
Author: cn187
Date: 2020-10-25 22:16:10 +0000 (Sun, 25 Oct 2020)
Log Message:
-----------
Replace Q3PtrList with QList
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/category.cpp
showeq/branches/pre_6_0_beta/src/category.h
showeq/branches/pre_6_0_beta/src/cgiconv.h
showeq/branches/pre_6_0_beta/src/combatlog.cpp
showeq/branches/pre_6_0_beta/src/combatlog.h
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/filter.h
showeq/branches/pre_6_0_beta/src/interface.cpp
showeq/branches/pre_6_0_beta/src/interface.h
showeq/branches/pre_6_0_beta/src/map.h
showeq/branches/pre_6_0_beta/src/mapcore.cpp
showeq/branches/pre_6_0_beta/src/mapcore.h
showeq/branches/pre_6_0_beta/src/mapicon.cpp
showeq/branches/pre_6_0_beta/src/packetinfo.cpp
showeq/branches/pre_6_0_beta/src/packetinfo.h
showeq/branches/pre_6_0_beta/src/packetstream.cpp
showeq/branches/pre_6_0_beta/src/spawn.cpp
showeq/branches/pre_6_0_beta/src/spawn.h
showeq/branches/pre_6_0_beta/src/spawnlist.cpp
showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
Modified: showeq/branches/pre_6_0_beta/src/category.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/category.cpp 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/category.cpp 2020-10-25 22:16:10 UTC (rev 1068)
@@ -174,24 +174,13 @@
CategoryMgr::CategoryMgr(QObject* parent, const char* name)
: QObject(parent, name)
{
- m_categories.setAutoDelete(false);
reloadCategories();
}
CategoryMgr::~CategoryMgr()
{
- // Clear the categories list. Since AutoDelete is off. This is manual.
- if (m_categories.first())
- {
- Category* deleteMe;
-
- while ((deleteMe = m_categories.current()))
- {
- m_categories.remove();
-
- delete deleteMe;
- }
- }
+ qDeleteAll(m_categories);
+ m_categories.clear();
}
const CategoryList CategoryMgr::findCategories(const QString& filterString,
@@ -201,10 +190,13 @@
// iterate over all the categories looking for a match
CategoryListIterator it(m_categories);
- for (Category* curCategory = it.toFirst();
- curCategory != NULL;
- curCategory = ++it)
+ Category* curCategory;
+ while (it.hasNext())
{
+ curCategory = it.next();
+ if (!curCategory)
+ break;
+
// if it matches the category add it to the dictionary
if (curCategory->isFiltered(filterString, level))
tmpList.append(curCategory);
@@ -248,10 +240,11 @@
emit delCategory(cat);
// remove the category from the list
- m_categories.remove(cat);
-
- // delete the category
- delete cat;
+ // note: indexOf shouldn't modify the input string, but gcc is giving
+ // const errors anyway. So we'll work around it.
+ int i = m_categories.indexOf(const_cast<Category*>(cat));
+ if (i != -1)
+ delete m_categories.takeAt(i);
}
}
@@ -372,10 +365,13 @@
QString prefBaseName;
CategoryListIterator it(m_categories);
- for (Category* curCategory = it.toFirst();
- curCategory != NULL;
- curCategory = ++it)
+ Category* curCategory;
+ while(it.hasNext())
{
+ curCategory = it.next();
+ if (!curCategory)
+ break;
+
prefBaseName.sprintf("Category%d_", count++);
pSEQPrefs->setPrefString(prefBaseName + "Name", section,
curCategory->name());
Modified: showeq/branches/pre_6_0_beta/src/category.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/category.h 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/category.h 2020-10-25 22:16:10 UTC (rev 1068)
@@ -37,7 +37,7 @@
#include <QString>
#include <QColor>
-#include <Q3PtrList>
+#include <QList>
// stuff needed for CategoryDlg
#include <QDialog>
@@ -104,9 +104,9 @@
Q3Button* m_Color;
};
-typedef Q3PtrList<Category> CategoryList;
-typedef Q3PtrListIterator<Category> CategoryListIterator;
-typedef Q3PtrListIterator<const Category> CategoryListConstIterator;
+typedef QList<Category*> CategoryList;
+typedef QListIterator<Category*> CategoryListIterator;
+typedef QListIterator<const Category*> CategoryListConstIterator;
// ------------------------------------------------------
// CategoryMgr
Modified: showeq/branches/pre_6_0_beta/src/cgiconv.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/cgiconv.h 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/cgiconv.h 2020-10-25 22:16:10 UTC (rev 1068)
@@ -29,7 +29,7 @@
#define CGICONV_H
#include <QString>
-#include <Q3PtrList>
+#include <QList>
// class for handling POST action CGI forms
class CGI
@@ -104,7 +104,7 @@
QString value;
};
- typedef Q3PtrList<CGIParam> CGIParamList;
+ typedef QList<CGIParam*> CGIParamList;
// unescape the URL (decodes x-www-form-urlencoded)
QString unescapeURL(QString url);
Modified: showeq/branches/pre_6_0_beta/src/combatlog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/combatlog.cpp 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/combatlog.cpp 2020-10-25 22:16:10 UTC (rev 1068)
@@ -239,6 +239,12 @@
delete m_combat_defense_record;
m_combat_defense_record = 0;
}
+
+ qDeleteAll(m_combat_offense_list);
+ m_combat_offense_list.clear();
+
+ qDeleteAll(m_combat_mob_list);
+ m_combat_mob_list.clear();
}
CombatWindow::CombatWindow(Player* player,
@@ -255,9 +261,7 @@
so this is a good place to initialize some things which
otherwise won't be. */
- m_combat_offense_list.setAutoDelete(true);
m_combat_defense_record = new CombatDefenseRecord(player);
- m_combat_mob_list.setAutoDelete(true);
initUI();
}
@@ -535,9 +539,14 @@
CombatOffenseRecord *pRecord;
- for(pRecord = m_combat_offense_list.first(); pRecord != 0; pRecord = m_combat_offense_list.next())
- {
- int iType = pRecord->getType();
+ QList<CombatOffenseRecord*>::iterator it;
+ for(it = m_combat_offense_list.begin(); it != m_combat_offense_list.end(); ++it)
+ {
+ pRecord = *it;
+ if (!pRecord)
+ break;
+
+ int iType = pRecord->getType();
int iSpell = pRecord->getSpell();
int iHits = pRecord->getHits();
int iMisses = pRecord->getMisses();
@@ -722,9 +731,13 @@
CombatMobRecord *pRecord;
- for(pRecord = m_combat_mob_list.first(); pRecord != 0; pRecord = m_combat_mob_list.next())
- {
- int iID = pRecord->getID();
+ QList<CombatMobRecord*>::iterator it;
+ for(it = m_combat_mob_list.begin(); it != m_combat_mob_list.end(); ++it)
+ {
+ pRecord = *it;
+ if (!pRecord)
+ break;
+ int iID = pRecord->getID();
int iDuration = pRecord->getDuration() / 1000;
int iDamageGiven = pRecord->getDamageGiven();
double dDPS = pRecord->getDPS();
@@ -815,10 +828,15 @@
CombatOffenseRecord *pRecord;
- for(pRecord = m_combat_offense_list.first(); pRecord != 0; pRecord = m_combat_offense_list.next())
- {
- // Belith -- Lets match spells up as well
- if(pRecord->getType() == iType && pRecord->getType() != 231)
+ QList<CombatOffenseRecord*>::iterator it;
+
+ for(it = m_combat_offense_list.begin(); it != m_combat_offense_list.end(); ++it)
+ {
+ pRecord = *it;
+ if (!pRecord)
+ break;
+ // Belith -- Lets match spells up as well
+ if(pRecord->getType() == iType && pRecord->getType() != 231)
{
bFoundRecord = true;
break;
@@ -896,9 +914,14 @@
CombatMobRecord *pRecord;
- for(pRecord = m_combat_mob_list.first(); pRecord != 0; pRecord = m_combat_mob_list.next())
- {
- if(pRecord->getID() == iMobID)
+ QList<CombatMobRecord*>::iterator it;
+ for(it = m_combat_mob_list.begin(); it != m_combat_mob_list.end(); ++it)
+ {
+ pRecord = *it;
+ if (!pRecord)
+ break;
+
+ if(pRecord->getID() == iMobID)
{
bFoundRecord = true;
break;
@@ -971,6 +994,7 @@
"&OK", "&Cancel", QString::null, 1, 1 ) )
{
case 0:
+ qDeleteAll(m_combat_mob_list);
m_combat_mob_list.clear();
updateMob();
break;
@@ -987,6 +1011,7 @@
"&OK", "&Cancel", QString::null, 1, 1 ) )
{
case 0:
+ qDeleteAll(m_combat_offense_list);
m_combat_offense_list.clear();
updateOffense();
break;
Modified: showeq/branches/pre_6_0_beta/src/combatlog.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/combatlog.h 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/combatlog.h 2020-10-25 22:16:10 UTC (rev 1068)
@@ -26,7 +26,7 @@
# include <QObject>
# include <QWidget>
# include <QTabWidget>
-# include <Q3PtrList>
+# include <QList>
# include <Q3ListView>
# include <QComboBox>
# include <QLabel>
@@ -244,9 +244,9 @@
QLabel* m_label_mob_currentdps;
QLabel* m_label_mob_lastdps;
- Q3PtrList<CombatOffenseRecord> m_combat_offense_list;
+ QList<CombatOffenseRecord*> m_combat_offense_list;
CombatDefenseRecord *m_combat_defense_record;
- Q3PtrList<CombatMobRecord> m_combat_mob_list;
+ QList<CombatMobRecord*> m_combat_mob_list;
QMenuBar *m_menu_bar;
QMenu *m_clear_menu;
Modified: showeq/branches/pre_6_0_beta/src/experiencelog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/experiencelog.cpp 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/experiencelog.cpp 2020-10-25 22:16:10 UTC (rev 1068)
@@ -154,6 +154,9 @@
{
if (m_log)
::fclose(m_log);
+
+ qDeleteAll(m_exp_list);
+ m_exp_list.clear();
}
ExperienceWindow::ExperienceWindow(const DataLocationMgr* dataLocMgr,
@@ -288,9 +291,6 @@
fileInfo = m_dataLocMgr->findWriteFile("logs", "newexp.log");
m_newExpLogFile = fileInfo.absFilePath();
-
- // Clear the exp list on removes and deletes.
- m_exp_list.setAutoDelete(true);
}
void ExperienceWindow::savePrefs()
@@ -428,22 +428,25 @@
// start at the end, add up the xp & mob count until we hit the
// beginning of list
// or the time cutoff
- Q3PtrListIterator<ExperienceRecord> it(m_exp_list);
+ QListIterator<ExperienceRecord*> it(m_exp_list);
int mob_count = 0;
time_t first_kill_time = 0;
- it.toLast();
- while ( it.current() && it.current()->getTime() >= time_cutoff )
+ ExperienceRecord* rec;
+
+ it.toBack();
+ while (it.hasPrevious())
{
+ rec = it.previous();
+ if (rec->getTime() < time_cutoff)
+ break;
- total_exp+=it.current()->getExpGained();
+ total_exp+=rec->getExpGained();
mob_count++;
- if ( it.current()->getTime() < first_kill_time || !first_kill_time )
- first_kill_time = it.current()->getTime();
-
- --it;
+ if ( rec->getTime() < first_kill_time || !first_kill_time )
+ first_kill_time = rec->getTime();
}
// calculate the number of minutes that have passed
Modified: showeq/branches/pre_6_0_beta/src/experiencelog.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/experiencelog.h 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/experiencelog.h 2020-10-25 22:16:10 UTC (rev 1068)
@@ -37,7 +37,6 @@
#include <QResizeEvent>
#include <Q3VBoxLayout>
#include <QMenu>
-#include <Q3PtrList>
#include <cstdint>
#include <cstdio>
@@ -143,7 +142,7 @@
*m_experience_remaining, *m_play_time,
*m_experience_rate, *m_kills_to_level, *m_time_to_level;
- Q3PtrList<ExperienceRecord> m_exp_list;
+ QList<ExperienceRecord*> m_exp_list;
QMenuBar *m_menu_bar;
QMenu *m_view_menu, *m_exp_rate_menu, *m_ZEM_menu;
Modified: showeq/branches/pre_6_0_beta/src/filter.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/filter.cpp 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/filter.cpp 2020-10-25 22:16:10 UTC (rev 1068)
@@ -290,8 +290,12 @@
// iterate over the filters checking for a match
FilterListIterator it(m_filterItems);
- for (re = it.toFirst(); re != NULL; re = ++it)
+ while(it.hasNext())
{
+ re = it.next();
+ if (!re)
+ break;
+
if (re->isFiltered(filterString, level))
return true;
}
@@ -315,9 +319,15 @@
FilterListIterator it(m_filterItems);
// iterate over the filter items, saving them as we go along.
- for (re = it.toFirst(); re != NULL; re = ++it)
- re->save(indent, out);
+ while(it.hasNext())
+ {
+ re = it.next();
+ if (!re)
+ break;
+ re->save(indent, out);
+ }
+
// decrease indent
indent.remove(0, 4);
@@ -336,8 +346,12 @@
// Find a match in the list and the one previous to it
//while(re)
FilterListIterator it(m_filterItems);
- for (re = it.toFirst(); re != NULL; re = ++it)
+ while (it.hasNext())
{
+ re = it.next();
+ if (!re)
+ break;
+
if (re->name() == filterPattern) // if match
{
// remove the filter
@@ -411,9 +425,15 @@
FilterItem* re;
FilterListIterator it(m_filterItems);
- for (re = it.toFirst(); re != NULL; re = ++it)
+ while(it.hasNext())
+ {
+ re = it.next();
+ if (!re)
+ break;
+
if (re->name() == filterPattern)
return re;
+ }
return NULL;
}
@@ -428,8 +448,12 @@
#endif
FilterListIterator it(m_filterItems);
- for (re = it.toFirst(); re != NULL; re = ++it)
+ while(it.hasNext())
{
+ re = it.next();
+ if (!re)
+ break;
+
if (re->minLevel() || re->maxLevel())
seqInfo("\t'%s' (%d, %d)",
(const char*)re->name().utf8(), re->minLevel(), re->maxLevel());
Modified: showeq/branches/pre_6_0_beta/src/filter.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/filter.h 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/filter.h 2020-10-25 22:16:10 UTC (rev 1068)
@@ -32,7 +32,7 @@
#include <sys/types.h>
#include <QString>
-#include <Q3PtrList>
+#include <QList>
#include <QRegExp>
#include <QXmlAttributes>
#include <Q3TextStream>
@@ -48,8 +48,8 @@
//--------------------------------------------------
// typedefs
-typedef Q3PtrList<FilterItem> FilterList;
-typedef Q3PtrListIterator<FilterItem> FilterListIterator;
+typedef QList<FilterItem*> FilterList;
+typedef QListIterator<FilterItem*> FilterListIterator;
typedef std::map<uint32_t, QString> FilterTypeMap;
typedef std::map<uint32_t, Filter*> FilterMap;
Modified: showeq/branches/pre_6_0_beta/src/interface.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/interface.cpp 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/interface.cpp 2020-10-25 22:16:10 UTC (rev 1068)
@@ -97,7 +97,6 @@
#include <QCleanlooksStyle>
#include <QMenu>
#include <QWidgetAction>
-#include <Q3PtrList>
// this define is used to diagnose the order with which zone packets are rcvd
#define ZONE_ORDER_DIAG
@@ -5030,14 +5029,16 @@
out << "M," << spawn->realName() << ",blue," << trackList.count();
//iterate over the track, writing out the points
- for (trackPoint = trackIt.current();
- trackPoint;
- trackPoint = ++trackIt)
- {
- out << "," << trackPoint->x()
- << "," << trackPoint->y()
- << "," << trackPoint->z();
- }
+ while (trackIt.hasNext())
+ {
+ trackPoint = trackIt.next();
+ if (!trackPoint)
+ break;
+
+ out << "," << trackPoint->x()
+ << "," << trackPoint->y()
+ << "," << trackPoint->z();
+ }
out << endl;
}
Modified: showeq/branches/pre_6_0_beta/src/interface.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/interface.h 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/interface.h 2020-10-25 22:16:10 UTC (rev 1068)
@@ -37,7 +37,6 @@
#include <QSplitter>
#include <QList>
#include <QTimer>
-#include <Q3PtrList>
#include <QMessageBox>
#include <Q3TabDialog>
#include <QSpinBox>
Modified: showeq/branches/pre_6_0_beta/src/map.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/map.h 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/map.h 2020-10-25 22:16:10 UTC (rev 1068)
@@ -53,7 +53,7 @@
#include <Q3VBox>
#include <Q3HBox>
#include <QSpinBox>
-#include <Q3PtrList>
+#include <QList>
#include <QResizeEvent>
#include <QMouseEvent>
@@ -768,8 +768,8 @@
Q3HBox* m_depthControlBox;
QSpinBox* m_head;
QSpinBox* m_floor;
- Q3PtrList<QWidget> m_statusWidgets;
-
+ QList<QWidget*> m_statusWidgets;
+
QAction* m_action_topControl;
QAction* m_action_bottomControl;
QAction* m_action_zoom;
Modified: showeq/branches/pre_6_0_beta/src/mapcore.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/mapcore.cpp 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/mapcore.cpp 2020-10-25 22:16:10 UTC (rev 1068)
@@ -431,12 +431,6 @@
// MapData
MapData::MapData()
{
- // make all lists auto delete
- m_lLines.setAutoDelete(true);
- m_mLines.setAutoDelete(true);
- m_locations.setAutoDelete(true);
- m_aggros.setAutoDelete(true);
-
// clear the structure
clear();
}
@@ -443,6 +437,17 @@
MapData::~MapData()
{
+ qDeleteAll(m_lLines);
+ m_lLines.clear();
+
+ qDeleteAll(m_mLines);
+ m_mLines.clear();
+
+ qDeleteAll(m_locations);
+ m_locations.clear();
+
+ qDeleteAll(m_aggros);
+ m_aggros.clear();
}
void MapData::clear()
@@ -1176,11 +1181,12 @@
bool heightSet = false;
int16_t lastHeightSet = 0;
MapLineL* currentLineL;
- Q3PtrListIterator<MapLineL> mlit(m_lLines);
- for (currentLineL = mlit.toFirst();
- currentLineL != NULL;
- currentLineL = ++mlit)
+ QList<MapLineL*>::const_iterator mlit = m_lLines.begin();
+ for (mlit = m_lLines.begin();
+ mlit != m_lLines.end() && *mlit != NULL;
+ ++mlit)
{
+ currentLineL = *mlit;
// was the global height set?
if (currentLineL->heightSet())
{
@@ -1216,11 +1222,12 @@
// write out the M (3D) lines
MapLineM* currentLineM;
- Q3PtrListIterator<MapLineM> mmit(m_mLines);
- for (currentLineM = mmit.toFirst();
- currentLineM;
- currentLineM = ++mmit)
+ QList<MapLineM*>::const_iterator mmit = m_mLines.begin();
+ for (mmit = m_mLines.begin();
+ mmit != m_mLines.end() && *mmit != NULL;
+ ++mmit)
{
+ currentLineM = *mmit;
// write out the start of the line info
fprintf (fh, "M,%s,%s,%d",
(const char*)currentLineM->name(),
@@ -1240,10 +1247,10 @@
}
// write out location information
- Q3PtrListIterator<MapLocation> lit(m_locations);
- for(; lit.current(); ++lit)
+ QList<MapLocation*>::const_iterator lit = m_locations.begin();
+ for(; lit != m_locations.end() && *lit != NULL; ++lit)
{
- MapLocation* currentLoc = lit.current();
+ MapLocation* currentLoc = *lit;
if (!currentLoc->heightSet())
fprintf (fh, "P,%s,%s,%d,%d\n",
@@ -1261,11 +1268,11 @@
}
// write out aggro information
- Q3PtrListIterator<MapAggro> ait(m_aggros);
- for (; ait.current(); ++ait)
+ QList<MapAggro*>::const_iterator ait = m_aggros.begin();
+ for (; ait != m_aggros.end() && *ait != NULL; ++ait)
{
- MapAggro* currentAggro = ait.current();
-
+ MapAggro* currentAggro = *ait;
+
fprintf (fh, "A,%s,%d\n",
(const char*)currentAggro->name(), currentAggro->range());
}
@@ -1305,11 +1312,10 @@
float z1;
QString name;
MapLineL* currentLineL;
- Q3PtrListIterator<MapLineL> mlit(m_lLines);
- for (currentLineL = mlit.toFirst();
- currentLineL != NULL;
- currentLineL = ++mlit)
+ QList<MapLineL*>::const_iterator mlit = m_lLines.begin();
+ for (; mlit != m_lLines.end() && *mlit != NULL; ++mlit)
{
+ currentLineL = *mlit;
z1 = float(currentLineL->z());
const QColor& color = currentLineL->color();
@@ -1339,11 +1345,10 @@
// write out the M (3D) lines
MapLineM* currentLineM;
- Q3PtrListIterator<MapLineM> mmit(m_mLines);
- for (currentLineM = mmit.toFirst();
- currentLineM;
- currentLineM = ++mmit)
+ QList<MapLineM*>::const_iterator mmit = m_mLines.begin();
+ for (; mmit != m_mLines.end() && *mmit != NULL; ++mmit)
{
+ currentLineM = *mmit;
const QColor& color = currentLineM->color();
r = color.red();
g = color.green();
@@ -1367,12 +1372,11 @@
}
// write out location information
- Q3PtrListIterator<MapLocation> lit(m_locations);
+ QList<MapLocation*>::const_iterator lit = m_locations.begin();
MapLocation* currentLoc;
- for(currentLoc = lit.toFirst();
- currentLoc;
- currentLoc = ++lit)
+ for (; lit != m_locations.end() && *lit != NULL; ++lit)
{
+ currentLoc = *lit;
const QColor& color = currentLoc->color();
// convert spaces to underscores
@@ -1398,11 +1402,10 @@
bool MapData::isAggro(const QString& name, uint16_t* range) const
{
MapAggro* aggro;
- Q3PtrListIterator<MapAggro> ait(m_aggros);
- for (aggro = ait.toFirst();
- aggro != NULL;
- aggro = ++ait)
+ QList<MapAggro*>::const_iterator ait = m_aggros.begin();
+ for (; ait != m_aggros.end() && *ait != NULL; ++ait)
{
+ aggro = *ait;
// does the name match this aggro?
if (name.find(aggro->name(), 0, false) != -1)
{
@@ -1528,11 +1531,12 @@
{
// first scale down the L lines
MapLineL* currentLineL;
- Q3PtrListIterator<MapLineL> mlit(m_lLines);
- for (currentLineL = mlit.toFirst();
- currentLineL != NULL;
- currentLineL = ++mlit)
+ QList<MapLineL*>::const_iterator mlit = m_lLines.begin();
+ for (; mlit != m_lLines.end() && *mlit != NULL; ++mlit)
+ {
+ currentLineL = *mlit;
currentLineL->setZPos(currentLineL->z() / factor);
+ }
// finish off by scaling down the M lines
MapLineM* currentLineM;
@@ -1539,11 +1543,10 @@
MapPoint* mData;
size_t numPoints;
size_t i;
- Q3PtrListIterator<MapLineM> mmit(m_mLines);
- for (currentLineM = mmit.toFirst();
- currentLineM;
- currentLineM = ++mmit)
+ QList<MapLineM*>::const_iterator mmit = m_mLines.begin();
+ for (; mmit != m_mLines.end() && *mmit != NULL; ++mmit)
{
+ currentLineM = *mmit;
// get the number of points in the line
numPoints = currentLineM->size();
@@ -1559,11 +1562,12 @@
{
// first scale down the L lines
MapLineL* currentLineL;
- Q3PtrListIterator<MapLineL> mlit(m_lLines);
- for (currentLineL = mlit.toFirst();
- currentLineL != NULL;
- currentLineL = ++mlit)
+ QList<MapLineL*>::const_iterator mlit = m_lLines.begin();
+ for (; mlit != m_lLines.end() && *mlit != NULL; ++mlit)
+ {
+ currentLineL = *mlit;
currentLineL->setZPos(currentLineL->z() * factor);
+ }
// finish off by scaling down the M lines
MapLineM* currentLineM;
@@ -1570,11 +1574,10 @@
MapPoint* mData;
size_t numPoints;
size_t i;
- Q3PtrListIterator<MapLineM> mmit(m_mLines);
- for (currentLineM = mmit.toFirst();
- currentLineM;
- currentLineM = ++mmit)
+ QList<MapLineM*>::const_iterator mmit = m_mLines.begin();
+ for (; mmit != m_mLines.end() && *mmit != NULL; ++mmit)
{
+ currentLineM = *mmit;
// get the number of points in the line
numPoints = currentLineM->size();
@@ -1710,11 +1713,10 @@
MapPoint* mData;
// first paint the L lines
- Q3PtrListIterator<MapLineL> mlit(m_lLines);
- for (currentLineL = mlit.toFirst();
- currentLineL != NULL;
- currentLineL = ++mlit)
+ QList<MapLineL*>::const_iterator mlit = m_lLines.begin();
+ for (; mlit != m_lLines.end() && *mlit != NULL; ++mlit)
{
+ currentLineL = *mlit;
// if line is outside the currently visible region, skip it.
if (!currentLineL->boundingRect().intersects(screenBounds))
continue;
@@ -1761,11 +1763,10 @@
}
// then paint the M lines
- Q3PtrListIterator<MapLineM> mmit(m_mLines);
- for (currentLineM = mmit.toFirst();
- currentLineM;
- currentLineM = ++mmit)
+ QList<MapLineM*>::const_iterator mmit = m_mLines.begin();
+ for (; mmit != m_mLines.end() && *mmit != NULL; ++mmit)
{
+ currentLineM = *mmit;
// if line is outside the currently visible region, skip it.
if (!currentLineM->boundingRect().intersects(screenBounds))
continue;
@@ -1846,11 +1847,10 @@
MapPoint playerPos = param.player();
// first paint the L lines
- Q3PtrListIterator<MapLineL> mlit(m_lLines);
- for (currentLineL = mlit.toFirst();
- currentLineL != NULL;
- currentLineL = ++mlit)
+ QList<MapLineL*>::const_iterator mlit = m_lLines.begin();
+ for (; mlit != m_lLines.end() && *mlit != NULL; ++mlit)
{
+ currentLineL = *mlit;
// if line is outside the currently visible region, skip it.
if (!currentLineL->boundingRect().intersects(screenBounds))
continue;
@@ -1904,11 +1904,10 @@
}
// then paint the M lines
- Q3PtrListIterator<MapLineM> mmit(m_mLines);
- for (currentLineM = mmit.toFirst();
- currentLineM;
- currentLineM = ++mmit)
+ QList<MapLineM*>::const_iterator mmit = m_mLines.begin();
+ for (; mmit != m_mLines.end() && *mmit != NULL; ++mmit)
{
+ currentLineM = *mmit;
// if line is outside the currently visible region, skip it.
if (!currentLineM->boundingRect().intersects(screenBounds))
continue;
@@ -2005,11 +2004,10 @@
double botb = 255 - (botm * playerPos.z());
// first paint the L lines
- Q3PtrListIterator<MapLineL> mlit(m_lLines);
- for (currentLineL = mlit.toFirst();
- currentLineL != NULL;
- currentLineL = ++mlit)
+ QList<MapLineL*>::const_iterator mlit = m_lLines.begin();
+ for (; mlit != m_lLines.end() && *mlit != NULL; ++mlit)
{
+ currentLineL = *mlit;
// if line is outside the currently visible region, skip it.
if (!currentLineL->boundingRect().intersects(screenBounds))
continue;
@@ -2080,11 +2078,10 @@
}
// then paint the M lines
- Q3PtrListIterator<MapLineM> mmit(m_mLines);
- for (currentLineM = mmit.toFirst();
- currentLineM;
- currentLineM = ++mmit)
+ QList<MapLineM*>::const_iterator mmit = m_mLines.begin();
+ for (; mmit != m_mLines.end() && *mmit != NULL; ++mmit)
{
+ currentLineM = *mmit;
// if line is outside the currently visible region, skip it.
if (!currentLineM->boundingRect().intersects(screenBounds))
continue;
@@ -2176,10 +2173,10 @@
p.setFont(param.font());
// iterate over all the map locations
- Q3PtrListIterator<MapLocation> lit(m_locations);
- for(; lit.current(); ++lit)
+ QList<MapLocation*>::const_iterator lit = m_locations.begin();
+ for (; lit != m_locations.end() && *lit != NULL; ++lit)
{
- MapLocation* currentLoc = lit.current();
+ MapLocation* currentLoc = *lit;
// set the color
QColor color(currentLoc->color());
Modified: showeq/branches/pre_6_0_beta/src/mapcore.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/mapcore.h 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/mapcore.h 2020-10-25 22:16:10 UTC (rev 1068)
@@ -45,7 +45,7 @@
#include <QColor>
#include <QFont>
#include <QPixmap>
-#include <Q3PtrList>
+#include <QList>
#include <Q3PointArray>
#include "point.h"
@@ -556,10 +556,10 @@
int16_t minY() const { return m_minY; }
int16_t maxX() const { return m_maxX; }
int16_t maxY() const { return m_maxY; }
- Q3PtrList<MapLineL>& lLines() { return m_lLines; }
- Q3PtrList<MapLineM>& mLines() { return m_mLines; }
- Q3PtrList<MapLocation>& locations() { return m_locations; }
- Q3PtrList<MapAggro>& aggros() { return m_aggros; }
+ QList<MapLineL*>& lLines() { return m_lLines; }
+ QList<MapLineM*>& mLines() { return m_mLines; }
+ QList<MapLocation*>& locations() { return m_locations; }
+ QList<MapAggro*>& aggros() { return m_aggros; }
const QPixmap& image() const { return m_image; }
bool imageLoaded() const { return m_imageLoaded; }
bool mapLoaded() const { return m_mapLoaded; }
@@ -604,12 +604,12 @@
QString m_fileName;
QString m_zoneLongName;
QString m_zoneShortName;
- Q3PtrList<MapLineL> m_lLines;
- Q3PtrList<MapLineM> m_mLines;
+ QList<MapLineL*> m_lLines;
+ QList<MapLineM*> m_mLines;
MapLineM* m_editLineM;
- Q3PtrList<MapLocation> m_locations;
+ QList<MapLocation*> m_locations;
MapLocation* m_editLocation;
- Q3PtrList<MapAggro> m_aggros;
+ QList<MapAggro*> m_aggros;
uint8_t m_zoneZEM;
QPixmap m_image;
bool m_imageLoaded;
Modified: showeq/branches/pre_6_0_beta/src/mapicon.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/mapicon.cpp 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/mapicon.cpp 2020-10-25 22:16:10 UTC (rev 1068)
@@ -1024,7 +1024,7 @@
{
SpawnTrackListIterator trackIt(spawn->trackList());
- const SpawnTrackPoint* trackPoint = trackIt.current();
+ const SpawnTrackPoint* trackPoint = trackIt.next();
if (trackPoint)
{
if (!mapIcon.useWalkPathPen())
@@ -1036,9 +1036,13 @@
x_1 = trackPoint->x();
y_1 = trackPoint->y();
-
- while ((trackPoint = ++trackIt) != NULL)
+
+ while (trackIt.hasNext())
{
+ trackPoint = trackIt.next();
+ if (!trackPoint)
+ break;
+
x_2 = trackPoint->x();
y_2 = trackPoint->y();
Modified: showeq/branches/pre_6_0_beta/src/packetinfo.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetinfo.cpp 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/packetinfo.cpp 2020-10-25 22:16:10 UTC (rev 1068)
@@ -226,7 +226,6 @@
: m_opcode(0),
m_implicitLen(0)
{
- setAutoDelete(true);
}
EQPacketOPCode::EQPacketOPCode(uint16_t opcode, const QString& name)
@@ -234,7 +233,6 @@
m_implicitLen(0),
m_name(name)
{
- setAutoDelete(true);
}
EQPacketOPCode::EQPacketOPCode(const EQPacketOPCode& opcode)
@@ -243,11 +241,12 @@
m_name(opcode.m_name),
m_updated(opcode.m_updated)
{
- setAutoDelete(true);
}
EQPacketOPCode::~EQPacketOPCode()
{
+ qDeleteAll(*this);
+ clear();
}
EQPacketPayload* EQPacketOPCode::find(const uint8_t* data, size_t size, uint8_t dir) const
@@ -256,14 +255,14 @@
// iterate over the payloads until a matching one is found
EQPayloadListIterator it(*this);
- while ((payload = it.current()) != 0)
+ while (it.hasNext())
{
+ payload = it.next();
+ if (!payload)
+ break;
// if a match is found, return it.
if (payload->match(data, size, dir))
return payload;
-
- // iterate to the next payload
- ++it;
}
// no matches, return 0
@@ -388,9 +387,13 @@
Q3CString sztStr;
// iterate over the payloads
- Q3PtrListIterator<EQPacketPayload> pit(*currentOPCode);
- while ((currentPayload = pit.current()) != 0)
+ QListIterator<EQPacketPayload*> pit(*currentOPCode);
+ while (pit.hasNext())
{
+ currentPayload = pit.next();
+ if (!currentPayload)
+ break;
+
// output the payload
out << indent << "<payload dir=\"" << dirStrs[currentPayload->dir()-1]
<< "\" typename=\"" << currentPayload->typeName()
@@ -397,8 +400,6 @@
<< "\" sizechecktype=\""
<< sztStrs[currentPayload->sizeCheckType()]
<< "\"/>" << endl;
-
- ++pit;
}
// decrease the indent
@@ -468,14 +469,16 @@
fprintf(stderr, "\t\t%d payload(s)\n", current->count());
- Q3PtrListIterator<EQPacketPayload> pit(*current);
- while ((currentPayload = pit.current()) != 0)
+ QListIterator<EQPacketPayload*> pit(*current);
+ while (pit.hasNext())
{
+ currentPayload = pit.next();
+ if (!currentPayload)
+ break;
+
seqInfo("\t\t\tdir=%d typename=%s size=%d sizechecktype=%d",
currentPayload->dir(), (const char*)currentPayload->typeName(),
currentPayload->typeSize(), currentPayload->sizeCheckType());
-
- ++pit;
}
}
}
Modified: showeq/branches/pre_6_0_beta/src/packetinfo.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetinfo.h 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/packetinfo.h 2020-10-25 22:16:10 UTC (rev 1068)
@@ -28,7 +28,7 @@
#include <cstdint>
#include <QObject>
-#include <Q3PtrList>
+#include <QList>
#include <QHash>
#include <QByteArray>
#include <Q3CString>
@@ -121,8 +121,8 @@
};
// Payload list typedef
-typedef Q3PtrList<EQPacketPayload> EQPayloadList;
-typedef Q3PtrListIterator<EQPacketPayload> EQPayloadListIterator;
+typedef QList<EQPacketPayload*> EQPayloadList;
+typedef QListIterator<EQPacketPayload*> EQPayloadListIterator;
inline const Q3CString& EQPacketPayload::typeName() const
{
Modified: showeq/branches/pre_6_0_beta/src/packetstream.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetstream.cpp 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/packetstream.cpp 2020-10-25 22:16:10 UTC (rev 1068)
@@ -127,15 +127,16 @@
// try to find a matching payload for this opcode
EQPayloadListIterator pit(*opcode);
- while ((payload = pit.current()) != 0)
+ while (pit.hasNext())
{
+ payload = pit.next();
+ if (!payload)
+ break;
// if all the parameters match, then use this payload
if ((payload->dir() & m_dir) &&
(payload->typeName() == payloadType) &&
(payload->sizeCheckType() == szt))
break;
-
- ++pit;
}
// if no payload found, create one and issue a warning
@@ -424,8 +425,11 @@
// iterate over the payloads in the opcode entry, and dispatch matches
EQPayloadListIterator pit(*opcodeEntry);
bool found = false;
- while ((payload = pit.current()) != 0)
+ while (pit.hasNext())
{
+ payload = pit.next();
+ if (!payload)
+ break;
// see if this packet matches
if (payload->match(data, len, m_dir))
{
@@ -450,9 +454,6 @@
dispatch->activate(data, len, m_dir);
}
}
-
- // go to next possible payload
- ++pit;
}
#ifdef PACKET_PAYLOAD_SIZE_DIAG
@@ -462,11 +463,14 @@
tempStr.sprintf("%s (%#04x) (dataLen: %lu) doesn't match:",
(const char*)opcodeEntry->name(), opcodeEntry->opcode(),
len);
-
- for (payload = pit.toFirst();
- payload != 0;
- payload = ++pit)
+
+ pit.toFront();
+ while (pit.hasNext())
{
+ payload = pit.next();
+ if (!payload)
+ break;
+
if (payload->dir() & m_dir)
{
if (payload->sizeCheckType() == SZC_Match)
Modified: showeq/branches/pre_6_0_beta/src/spawn.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawn.cpp 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/spawn.cpp 2020-10-25 22:16:10 UTC (rev 1068)
@@ -317,9 +317,6 @@
Spawn::Spawn(const spawnStruct* s)
: Item(tSpawn, s->spawnId)
{
- // turn on auto delete for the track list
- m_spawnTrackList.setAutoDelete(true);
-
// have update initialize everything
update(s);
}
@@ -360,9 +357,6 @@
setGM(0);
setConsidered(false);
- // turn on auto delete for the track list
- m_spawnTrackList.setAutoDelete(true);
-
// Finally, note when this update ocurred
updateLast();
}
@@ -416,17 +410,12 @@
setDeltas(s->deltaX(), s->deltaY(), s->deltaZ());
setHeading(s->heading(), s->deltaHeading());
setConsidered(s->considered());
-
- // the new copy will own the spawn track list
- m_spawnTrackList.setAutoDelete(false);
- m_spawnTrackList = s->m_spawnTrackList;
- s->m_spawnTrackList.setAutoDelete(false);
- m_spawnTrackList.setAutoDelete(true);
}
Spawn::~Spawn()
{
// clear out the spawn track list
+ qDeleteAll(m_spawnTrackList);
m_spawnTrackList.clear();
}
@@ -588,13 +577,13 @@
// only insert if the change includes either an x or y change, not just z
if ((count == 0) ||
- ((m_spawnTrackList.getLast()->x() != x) ||
- (m_spawnTrackList.getLast()->y() != y)))
+ ((m_spawnTrackList.last()->x() != x) ||
+ (m_spawnTrackList.last()->y() != y)))
{
// if the walk path length is limited, make sure not to exceed the limit
if ((walkpathlength > 0) &&
- (count > 2) && (count > walkpathlength))
- m_spawnTrackList.removeFirst();
+ (count > 2) && (count > walkpathlength))
+ delete m_spawnTrackList.takeFirst();
// append the new entry to the end of the list
m_spawnTrackList.append(new SpawnTrackPoint(x, y, z));
Modified: showeq/branches/pre_6_0_beta/src/spawn.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawn.h 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/spawn.h 2020-10-25 22:16:10 UTC (rev 1068)
@@ -41,7 +41,7 @@
#include <cmath>
#include <ctime>
-#include <Q3PtrList>
+#include <QList>
#include <QDateTime>
#include <QDataStream>
@@ -113,8 +113,8 @@
// type definitions
typedef Point3D<int16_t> EQPoint;
typedef EQPoint SpawnTrackPoint;
-typedef Q3PtrList<SpawnTrackPoint> SpawnTrackList;
-typedef Q3PtrListIterator<SpawnTrackPoint> SpawnTrackListIterator;
+typedef QList<SpawnTrackPoint*> SpawnTrackList;
+typedef QListIterator<SpawnTrackPoint*> SpawnTrackListIterator;
//----------------------------------------------------------------------
// constants
Modified: showeq/branches/pre_6_0_beta/src/spawnlist.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist.cpp 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/spawnlist.cpp 2020-10-25 22:16:10 UTC (rev 1068)
@@ -381,9 +381,12 @@
SpawnListItem* catlitem;
// iterate over all the categories
- for(cat = cit.toFirst(); cat != NULL; cat = ++cit)
- {
- // skip filtered spawns, if this isn't a filtered filter category
+ while(cit.hasNext())
+ {
+ cat = cit.next();
+ if (!cat)
+ break;
+
if ((item->filterFlags() & FILTER_FLAG_FILTERED) &&
!cat->isFilteredFilter())
{
@@ -435,18 +438,11 @@
SpawnListItem *j = NULL;
// create a list of items to be deleted
- Q3PtrList<Q3ListViewItem>* delList = new Q3PtrList<Q3ListViewItem>();
+ QList<Q3ListViewItem*>* delList = new QList<Q3ListViewItem*>();
- // set the list to automatically delete the items placed in it when it is
- // cleared/deleted...
- delList->setAutoDelete(true);
-
// create a list of categories to be updated
- Q3PtrList<const Category> catUpdateList;
+ QList<const Category*> catUpdateList;
- // make sure it doesn't attempt to delete the category
- catUpdateList.setAutoDelete(false);
-
const Category* cat;
// start at the top of the list
@@ -491,11 +487,15 @@
} while (j);
// delete the list of items to be deleted, which auto-deletes the items
+ qDeleteAll(*delList);
+ delList->clear();
delete delList;
// now iterate over the updated categories and update them
- for (cat = catUpdateList.first(); cat != 0; cat = catUpdateList.next())
+ QList<const Category*>::iterator cit;
+ for (cit = catUpdateList.begin(); cit != catUpdateList.end() && *cit != NULL; ++cit)
{
+ cat = *cit;
// retrieve the category list item
SpawnListItem* catlitem = m_categoryListItems.value((void*)cat, nullptr);
@@ -725,8 +725,12 @@
CategoryListIterator it(m_categoryMgr->getCategories());
SpawnListItem* litem;
const Category* cat;
- for (cat = it.toFirst(); cat != NULL; cat = ++it)
+ while (it.hasNext())
{
+ cat = it.next();
+ if (!cat)
+ break;
+
// create the spawn list item
litem = new SpawnListItem(this);
@@ -976,52 +980,60 @@
while (it.hasNext())
{
it.next();
- // get the item from the list
- item = it.value();
- if (!item)
- break;
+ // get the item from the list
+ item = it.value();
+ if (!item)
+ break;
- // retrieve the filter string
- filterStr = filterString(item, flags);
+ // retrieve the filter string
+ filterStr = filterString(item, flags);
- // iterate over all the categories
- for(cat = cit.toFirst(); cat != NULL; cat = ++cit)
- {
- // skip filtered spawns
- if ((item->filterFlags() & FILTER_FLAG_FILTERED) &&
- !cat->isFilteredFilter())
- continue;
+ // iterate over all the categories
+ while (cit.hasNext())
+ {
+ cat = cit.next();
+ if (!cat)
+ break;
- // if item is a spawn, get its level
- if ((item->type() == tSpawn) || (item->type() == tPlayer))
- level = ((Spawn*)item)->level();
+ // skip filtered spawns
+ if ((item->filterFlags() & FILTER_FLAG_FILTERED) &&
+ !cat->isFilteredFilter())
+ continue;
- // does this spawn match the category
- if (cat->isFiltered(filterStr, level))
- {
- // retrieve the category list item
- catlitem = m_categoryListItems.value((void*)cat, nullptr);
+ // if item is a spawn, get its level
+ if ((item->type() == tSpawn) || (item->type() == tPlayer))
+ level = ((Spawn*)item)->level();
- // yes, add it
- litem = new SpawnListItem(catlitem);
+ // does this spawn match the category
+ if (cat->isFiltered(filterStr, level))
+ {
+ // retrieve the category list item
+ catlitem = m_categoryListItems.value((void*)cat, nullptr);
- // set up the list item
- litem->setShellItem(item);
- litem->update(m_player, tSpawnChangedALL);
-
- // color the spawn
- litem->pickTextColor(item, m_player, cat->color());
- }
- }
+ // yes, add it
+ litem = new SpawnListItem(catlitem);
+
+ // set up the list item
+ litem->setShellItem(item);
+ litem->update(m_player, tSpawnChangedALL);
+
+ // color the spawn
+ litem->pickTextColor(item, m_player, cat->color());
+ }
+ }
}
}
// done adding items, now iterate over all the categories and
// update the counts
- for(cat = cit.toFirst(); cat != NULL; cat = ++cit)
+ while (cit.hasNext())
{
- catlitem = m_categoryListItems.value((void*)cat, nullptr);
- catlitem->updateTitle(cat->name());
+ cat = cit.next();
+ if (!cat)
+ break;
+
+ catlitem = m_categoryListItems.value((void*)cat, nullptr);
+ catlitem->updateTitle(cat->name());
}
}
else
@@ -1038,18 +1050,18 @@
while (it.hasNext())
{
it.next();
- // get the item from the list
- item = it.value();
- if (!item)
- break;
+ // get the item from the list
+ item = it.value();
+ if (!item)
+ break;
- // just create a new SpawnListItem
- litem = new SpawnListItem(this);
- litem->setShellItem(item);
-
- // color spawn
- litem->pickTextColor(item, m_player);
- litem->update(m_player, tSpawnChangedALL);
+ // just create a new SpawnListItem
+ litem = new SpawnListItem(this);
+ litem->setShellItem(item);
+
+ // color spawn
+ litem->pickTextColor(item, m_player);
+ litem->update(m_player, tSpawnChangedALL);
}
}
}
Modified: showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-10-25 19:42:18 UTC (rev 1067)
+++ showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-10-25 22:16:10 UTC (rev 1068)
@@ -470,8 +470,14 @@
// fill in the category combo box
CategoryListIterator it(m_categoryMgr->getCategories());
const Category* cat;
- for (cat = it.toFirst(); cat != NULL; cat = ++it)
+ while(it.hasNext())
+ {
+ cat = it.next();
+ if (!cat)
+ break;
+
m_categoryCombo->insertItem(cat->name());
+ }
int n = pSEQPrefs->getPrefInt("CurrentCategory", preferenceName(), 0);
m_categoryCombo->setCurrentItem(n);
@@ -724,11 +730,13 @@
void SpawnListWindow2::categorySelected(int index)
{
CategoryListIterator it(m_categoryMgr->getCategories());
- Category* cat = it.toFirst();
+ Category* cat = nullptr;
int i = 0;
- while ((cat != NULL) && (i < index))
+ while (it.hasNext() && (i < index))
{
- cat = ++it;
+ cat = it.next();
+ if (!cat)
+ break;
++i;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|