Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c5992426 authored by Kurt Hindenburg's avatar Kurt Hindenburg

Add new DBus method sessionList

DBus slot that returns the unique ids of the sessions in the
current view.  The returned list is not sorted.

Differential Revision: https://phabricator.kde.org/D7067
parent e7d8bb4d
......@@ -1083,6 +1083,18 @@ int ViewManager::sessionCount()
return this->_sessionMap.size();
}
QStringList ViewManager::sessionList()
{
QStringList ids;
QHash<TerminalDisplay *, Session *>::const_iterator i;
for (i = _sessionMap.constBegin(); i != _sessionMap.constEnd(); ++i) {
ids.append(QString::number(i.value()->sessionId()));
}
return ids;
}
int ViewManager::currentSession()
{
QHash<TerminalDisplay *, Session *>::iterator i;
......
......@@ -231,6 +231,13 @@ public Q_SLOTS:
/** DBus slot that returns the number of sessions in the current view. */
Q_SCRIPTABLE int sessionCount();
/**
* DBus slot that returns the unique ids of the sessions in the
* current view. The returned list is not sorted.
* QList<int> is not printable by qdbus so we use QStringList
*/
Q_SCRIPTABLE QStringList sessionList();
/** DBus slot that returns the current (active) session window */
Q_SCRIPTABLE int currentSession();
......
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