Commit eaef61e1 authored by Luca Weiss's avatar Luca Weiss Committed by Kurt Hindenburg
Browse files

Add DBus call setDefaultProfile() to ViewManager

This allows the user to set the default Konsole profile via D-Bus.

Differential Revision: https://phabricator.kde.org/D29236
parent a1b78079
......@@ -1081,6 +1081,16 @@ QString ViewManager::defaultProfile()
return ProfileManager::instance()->defaultProfile()->name();
}
void ViewManager::setDefaultProfile(const QString &profileName)
{
const QList<Profile::Ptr> 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();
......
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment