chore: add helper function for copying managed pack data between insts.

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow 2022-07-31 19:48:38 -03:00
parent c6bcb6228b
commit ec9ddc4f22
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469
2 changed files with 11 additions and 0 deletions

View File

@ -154,6 +154,16 @@ void BaseInstance::setManagedPack(const QString& type, const QString& id, const
settings()->set("ManagedPackVersionName", version);
}
void BaseInstance::copyManagedPack(BaseInstance& other)
{
settings()->set("ManagedPack", other.isManagedPack());
settings()->set("ManagedPackType", other.getManagedPackType());
settings()->set("ManagedPackID", other.getManagedPackID());
settings()->set("ManagedPackName", other.getManagedPackName());
settings()->set("ManagedPackVersionID", other.getManagedPackVersionID());
settings()->set("ManagedPackVersionName", other.getManagedPackVersionName());
}
int BaseInstance::getConsoleMaxLines() const
{
auto lineSetting = m_settings->getSetting("ConsoleMaxLines");

View File

@ -147,6 +147,7 @@ public:
QString getManagedPackVersionID();
QString getManagedPackVersionName();
void setManagedPack(const QString& type, const QString& id, const QString& name, const QString& versionId, const QString& version);
void copyManagedPack(BaseInstance& other);
/// guess log level from a line of game log
virtual MessageLevel::Enum guessLevel(const QString &line, MessageLevel::Enum level)