diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp index a91a415c..376c2ad6 100644 --- a/src/ViewManager.cpp +++ b/src/ViewManager.cpp @@ -1081,6 +1081,16 @@ QString ViewManager::defaultProfile() return ProfileManager::instance()->defaultProfile()->name(); } +void ViewManager::setDefaultProfile(const QString &profileName) +{ + const QList profiles = ProfileManager::instance()->allProfiles(); + for (const Profile::Ptr &profile : profiles) { + if (profile->name() == profileName) { + ProfileManager::instance()->setDefaultProfile(profile); + } + } +} + QStringList ViewManager::profileList() { return ProfileManager::instance()->availableProfileNames(); diff --git a/src/ViewManager.h b/src/ViewManager.h index 2f8a2331..43a7c51f 100644 --- a/src/ViewManager.h +++ b/src/ViewManager.h @@ -284,6 +284,10 @@ public Q_SLOTS: // DBus slot that returns the name of default profile Q_SCRIPTABLE QString defaultProfile(); + // TODO: its semantic is application-wide. Move it to more appropriate place + // DBus slot that sets the default profile + Q_SCRIPTABLE void setDefaultProfile(const QString &profile); + // TODO: its semantic is application-wide. Move it to more appropriate place // DBus slot that returns a string list of defined (known) profiles Q_SCRIPTABLE QStringList profileList();