Browse Source

fixed Database memory leaks, add getPlayers to ProfileDatabase

1.3.x
Rafael 6 years ago
parent
commit
c9eea52af7
  1. 1
      CrewDatabase.cpp
  2. 6
      ProfileDatabase.cpp
  3. 1
      ProfileDatabase.h

1
CrewDatabase.cpp

@ -41,6 +41,7 @@ CrewDatabase::CrewDatabase(QObject *parent) : QObject(parent)
CrewDatabase::~CrewDatabase()
{
crewDB->endGroup();
delete crewDB;
}
QStringList CrewDatabase::getCrews()

6
ProfileDatabase.cpp

@ -41,6 +41,12 @@ ProfileDatabase::ProfileDatabase(QObject *parent) : QObject(parent)
ProfileDatabase::~ProfileDatabase()
{
profileDB->endGroup();
delete profileDB;
}
QStringList ProfileDatabase::getPlayers()
{
return profileDB->childKeys();
}
QString ProfileDatabase::getPlayerName(int playerID)

1
ProfileDatabase.h

@ -29,6 +29,7 @@ class ProfileDatabase : public QObject
public:
explicit ProfileDatabase(QObject *parent = 0);
QString getPlayerName(int playerID);
QStringList getPlayers();
~ProfileDatabase();
private:

Loading…
Cancel
Save