Add dbus profile() to return profile name of current session

Instead of relying on env variable KONSOLE_PROFILE_NAME, which is
invalid upon switching profiles, use a dbus method profile().

qdbus $KONSOLE_DBUS_SERVICE $KONSOLE_DBUS_SESSION profile

CCBUG:406955
wilder-portage
Kurt Hindenburg 7 years ago
parent 962776796e
commit 05f5663a90
  1. 4
      src/Session.cpp
  2. 5
      src/Session.h

@ -1594,6 +1594,10 @@ int Session::historySize() const
}
}
QString Session::profile()
{
return SessionManager::instance()->sessionProfile(this)->name();
}
void Session::setProfile(const QString &profileName)
{

@ -593,6 +593,11 @@ public Q_SLOTS:
*/
Q_SCRIPTABLE void setProfile(const QString &profileName);
/**
* Returns the current session's profile name
*/
Q_SCRIPTABLE QString profile();
Q_SIGNALS:
/** Emitted when the terminal process starts. */

Loading…
Cancel
Save