Some checks failed
CodeQL Code Scanning / CodeQL (push) Has been cancelled
Build Application / Build Debug (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (macos-13, x86_64-darwin) (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (macos-14, aarch64-darwin) (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (ubuntu-22.04, x86_64-linux) (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (ubuntu-22.04-arm, aarch64-linux) (push) Has been cancelled
Update Flake Lockfile / update-flake (push) Has been cancelled
34 lines
702 B
C++
Executable File
34 lines
702 B
C++
Executable File
#pragma once
|
|
|
|
#include <QFile>
|
|
#include <QSet>
|
|
#include <QString>
|
|
|
|
namespace LegacyFTB {
|
|
|
|
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)
|
|
{
|
|
currentPacks.insert(code);
|
|
dirty = true;
|
|
}
|
|
void remove(const QString& code)
|
|
{
|
|
currentPacks.remove(code);
|
|
dirty = true;
|
|
}
|
|
|
|
private:
|
|
QSet<QString> currentPacks;
|
|
QString m_filename = "private_packs.txt";
|
|
mutable bool dirty = false;
|
|
};
|
|
|
|
} // namespace LegacyFTB
|