Create dbus object for each Konsole window respectively

Its naming scheme is "/Windows/N", similar to "/Sessions/N" for
sessions. That is not the final decision and might change before next
major release.

The old "/Konsole" dbus object is still available at this moment, but
it might disappear or be used for something different in the future, so
it is better to use "/Windows/N" from now on.

For convenience, $KONSOLE_DBUS_WINDOW can be used to refer to the dbus
object corresponding to the Konsole window containing current session.
Note, that environment variable does not work well with detaching and
draging. Maybe it should not be added at all.

CCBUG:276912
CCBUG:281513
CCBUG:292309

REVIEW:103790
This commit is contained in:
Jekyll Wu
2012-02-09 01:49:35 +08:00
parent 39a857b037
commit 07cddfe302
5 changed files with 25 additions and 0 deletions

View File

@@ -50,6 +50,8 @@
using namespace Konsole;
int ViewManager::lastManagerId = 0;
ViewManager::ViewManager(QObject* parent , KActionCollection* collection)
: QObject(parent)
, _viewSplitter(0)
@@ -61,6 +63,7 @@ ViewManager::ViewManager(QObject* parent , KActionCollection* collection)
, _navigationPosition(ViewContainer::NavigationPositionTop)
, _showQuickButtons(false)
, _newTabBehavior(PutNewTabAtTheEnd)
, _managerId(0)
{
// create main view area
_viewSplitter = new ViewSplitter(0);
@@ -96,12 +99,20 @@ ViewManager::ViewManager(QObject* parent , KActionCollection* collection)
new KonsoleAdaptor(this);
QDBusConnection::sessionBus().registerObject(QLatin1String("/Konsole"), this);
_managerId = ++lastManagerId;
QDBusConnection::sessionBus().registerObject(QLatin1String("/Windows/") + QString::number(_managerId), this);
}
ViewManager::~ViewManager()
{
delete _newViewMenu;
}
int ViewManager::managerId() const
{
return _managerId;
}
QMenu* ViewManager::createNewViewMenu()
{
if (_newViewMenu)