diff options
| author | Jonathan Feenstra <26406078+JonathanFeenstra@users.noreply.github.com> | 2026-01-11 12:36:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-11 12:36:07 +0100 |
| commit | 717b5ac389ea15350d32f813a3f03d908de0ab06 (patch) | |
| tree | c698d35614132823507d6226ed8d4a2d291ab21c /src/organizercore.cpp | |
| parent | 1505519ecd03e47c1c046c5c985aa947e06ff5ba (diff) | |
Add instanceName and profiles methods to plugin API (#2321)
Diffstat (limited to 'src/organizercore.cpp')
| -rw-r--r-- | src/organizercore.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 88f68805..a8fc67c2 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -70,6 +70,7 @@ #include <string> //for wstring #include <tuple> #include <utility> +#include <vector> #include <libbsarch/bs_archive.h> @@ -613,6 +614,24 @@ void OrganizerCore::setCurrentProfile(const QString& profileName) m_ProfileChanged(oldProfile.get(), m_CurrentProfile.get()); } +QStringList OrganizerCore::profileNames() const +{ + QDir profilesDir(m_Settings.paths().profiles()); + return profilesDir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); +} + +std::shared_ptr<const MOBase::IProfile> +OrganizerCore::getProfile(const QString& profileName) const +{ + QDir profileDir(m_Settings.paths().profiles()); + profileDir.cd(profileName); + if (!profileDir.exists()) { + return nullptr; + } + + return std::make_shared<Profile>(profileDir, managedGame(), gameFeatures()); +} + MOBase::IModRepositoryBridge* OrganizerCore::createNexusBridge() const { return new NexusBridge(m_PluginContainer); |
