@ -1,43 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include <QFile>
|
||||
#include <QSet>
|
||||
#include <QString>
|
||||
#include <QFile>
|
||||
|
||||
namespace LegacyFTB {
|
||||
|
||||
class PrivatePackManager
|
||||
{
|
||||
public:
|
||||
~PrivatePackManager()
|
||||
{
|
||||
save();
|
||||
}
|
||||
class PrivatePackManager {
|
||||
public:
|
||||
~PrivatePackManager() { save(); }
|
||||
void load();
|
||||
void save() const;
|
||||
bool empty() const
|
||||
{
|
||||
return currentPacks.empty();
|
||||
}
|
||||
const QSet<QString> &getCurrentPackCodes() const
|
||||
{
|
||||
return currentPacks;
|
||||
}
|
||||
void add(const QString &code)
|
||||
bool empty() const { return currentPacks.empty(); }
|
||||
const QSet<QString>& getCurrentPackCodes() const { return currentPacks; }
|
||||
void add(const QString& code)
|
||||
{
|
||||
currentPacks.insert(code);
|
||||
dirty = true;
|
||||
}
|
||||
void remove(const QString &code)
|
||||
void remove(const QString& code)
|
||||
{
|
||||
currentPacks.remove(code);
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
QSet<QString> currentPacks;
|
||||
QString m_filename = "private_packs.txt";
|
||||
mutable bool dirty = false;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace LegacyFTB
|
||||
|
Reference in New Issue
Block a user