| 58 | Q_DECLARE_METATYPE(QList<double>); |
| 59 | |
| 60 | ViewManager::ViewManager(QObject *parent, KActionCollection *collection) |
| 61 | : QObject(parent) |
| 62 | , _viewContainer(nullptr) |
| 63 | , _pluggedController(nullptr) |
| 64 | , _sessionMap(QHash<TerminalDisplay *, Session *>()) |
| 65 | , _actionCollection(collection) |
| 66 | , _navigationMethod(TabbedNavigation) |
| 67 | , _navigationVisibility(NavigationNotSet) |
| 68 | , _managerId(0) |
| 69 | , _terminalDisplayHistoryIndex(-1) |
| 70 | , contextMenuAdditionalActions({}) |
| 71 | { |
| 72 | #if HAVE_DBUS |
| 73 | qDBusRegisterMetaType<QList<double>>(); |
| 74 | #endif |
| 75 | |
| 76 | _viewContainer = createContainer(); |
| 77 | // setup actions which are related to the views |
| 78 | setupActions(); |
| 79 | |
| 80 | /* TODO: Reconnect |
| 81 | // emit a signal when all of the views held by this view manager are destroyed |
| 82 | */ |
| 83 | connect(_viewContainer.data(), &Konsole::TabbedViewContainer::empty, this, &Konsole::ViewManager::empty); |
| 84 | |
| 85 | // listen for profile changes |
| 86 | connect(ProfileManager::instance(), &Konsole::ProfileManager::profileChanged, this, &Konsole::ViewManager::profileChanged); |
| 87 | connect(SessionManager::instance(), &Konsole::SessionManager::sessionUpdated, this, &Konsole::ViewManager::updateViewsForSession); |
| 88 | |
| 89 | _managerId = ++lastManagerId; |
| 90 | |
| 91 | #if HAVE_DBUS |
| 92 | // prepare DBus communication |
| 93 | new WindowAdaptor(this); |
| 94 | QDBusConnection::sessionBus().registerObject(QLatin1String("/Windows/") + QString::number(_managerId), this); |
| 95 | #endif |
| 96 | } |
| 97 | |
| 98 | ViewManager::~ViewManager() = default; |
| 99 | |