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
wilder-portage
Luca Weiss 6 years ago committed by Kurt Hindenburg
parent a1b78079c5
commit eaef61e1c4
  1. 10
      src/ViewManager.cpp
  2. 4
      src/ViewManager.h

@ -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();

Loading…
Cancel
Save