fixed Database memory leaks, add getPlayers to ProfileDatabase
This commit is contained in:
parent
704337bab6
commit
c9eea52af7
3 changed files with 8 additions and 0 deletions
|
@ -41,6 +41,7 @@ CrewDatabase::CrewDatabase(QObject *parent) : QObject(parent)
|
||||||
CrewDatabase::~CrewDatabase()
|
CrewDatabase::~CrewDatabase()
|
||||||
{
|
{
|
||||||
crewDB->endGroup();
|
crewDB->endGroup();
|
||||||
|
delete crewDB;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList CrewDatabase::getCrews()
|
QStringList CrewDatabase::getCrews()
|
||||||
|
|
|
@ -41,6 +41,12 @@ ProfileDatabase::ProfileDatabase(QObject *parent) : QObject(parent)
|
||||||
ProfileDatabase::~ProfileDatabase()
|
ProfileDatabase::~ProfileDatabase()
|
||||||
{
|
{
|
||||||
profileDB->endGroup();
|
profileDB->endGroup();
|
||||||
|
delete profileDB;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList ProfileDatabase::getPlayers()
|
||||||
|
{
|
||||||
|
return profileDB->childKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ProfileDatabase::getPlayerName(int playerID)
|
QString ProfileDatabase::getPlayerName(int playerID)
|
||||||
|
|
|
@ -29,6 +29,7 @@ class ProfileDatabase : public QObject
|
||||||
public:
|
public:
|
||||||
explicit ProfileDatabase(QObject *parent = 0);
|
explicit ProfileDatabase(QObject *parent = 0);
|
||||||
QString getPlayerName(int playerID);
|
QString getPlayerName(int playerID);
|
||||||
|
QStringList getPlayers();
|
||||||
~ProfileDatabase();
|
~ProfileDatabase();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue