summaryrefslogtreecommitdiff
path: root/src/organizercore.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2020-10-24 20:54:22 +0200
committerMikaël Capelle <capelle.mikael@gmail.com>2020-10-24 20:54:22 +0200
commit8e591143a5fce58597a1597887b1730e24263224 (patch)
tree2314392a167e4cc1ca63207468130abfe8062e92 /src/organizercore.cpp
parent52cfb8e8a7609c8b763652e1575a769dd5fe1b02 (diff)
Add IOrganizer::onProfileXXX callbacks.
Diffstat (limited to 'src/organizercore.cpp')
-rw-r--r--src/organizercore.cpp32
1 files changed, 32 insertions, 0 deletions
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<void(QMainWindow*)>
return m_UserInterfaceInitialized.connect(func).connected();
}
+bool OrganizerCore::onProfileCreated(std::function<void(MOBase::IProfile*)> const& func)
+{
+ return m_ProfileCreated.connect(func).connected();
+}
+
+bool OrganizerCore::onProfileRenamed(std::function<void(MOBase::IProfile*, QString const&, QString const&)> const& func)
+{
+ return m_ProfileRenamed.connect(func).connected();
+}
+
+bool OrganizerCore::onProfileRemoved(std::function<void(QString const&)> const& func)
+{
+ return m_ProfileRemoved.connect(func).connected();
+}
+
bool OrganizerCore::onProfileChanged(std::function<void(IProfile*, IProfile*)> const& func)
{
return m_ProfileChanged.connect(func).connected();