From 8e591143a5fce58597a1597887b1730e24263224 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sat, 24 Oct 2020 20:54:22 +0200 Subject: Add IOrganizer::onProfileXXX callbacks. --- src/organizercore.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/organizercore.cpp') diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 2aaeb86c..7c975053 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -378,6 +378,22 @@ void OrganizerCore::userInterfaceInitialized() m_UserInterfaceInitialized(m_UserInterface->mainWindow()); } +void OrganizerCore::profileCreated(MOBase::IProfile* profile) +{ + m_ProfileCreated(profile); +} + +void OrganizerCore::profileRenamed(MOBase::IProfile* profile, QString const& oldName, QString const& newName) +{ + m_ProfileRenamed(profile, oldName, newName); +} + +void OrganizerCore::profileRemoved(QString const& profileName) +{ + m_ProfileRemoved(profileName); +} + + void OrganizerCore::externalMessage(const QString &message) { if (MOShortcut moshortcut{ message } ) { @@ -470,6 +486,7 @@ void OrganizerCore::createDefaultProfile() if (QDir(profilesPath).entryList(QDir::AllDirs | QDir::NoDotAndDotDot).size() == 0) { Profile newProf("Default", managedGame(), false); + m_ProfileCreated(&newProf); } } @@ -1144,6 +1161,21 @@ bool OrganizerCore::onUserInterfaceInitialized(std::function return m_UserInterfaceInitialized.connect(func).connected(); } +bool OrganizerCore::onProfileCreated(std::function const& func) +{ + return m_ProfileCreated.connect(func).connected(); +} + +bool OrganizerCore::onProfileRenamed(std::function const& func) +{ + return m_ProfileRenamed.connect(func).connected(); +} + +bool OrganizerCore::onProfileRemoved(std::function const& func) +{ + return m_ProfileRemoved.connect(func).connected(); +} + bool OrganizerCore::onProfileChanged(std::function const& func) { return m_ProfileChanged.connect(func).connected(); -- cgit v1.3.1