ViewManager.cpp 21.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*
    Copyright (C) 2006-2007 by Robert Knight <robertknight@gmail.com>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301  USA.
*/

20 21 22
// Own
#include "ViewManager.h"

23 24 25
// System
#include <assert.h>

26
// Qt
Dirk Mueller's avatar
Dirk Mueller committed
27
#include <QtCore/QSignalMapper>
28

29 30 31 32 33 34 35
// KDE
#include <kdebug.h>
#include <KLocale>
#include <KToggleAction>
#include <KXMLGUIFactory>

// Konsole
36
#include "BookmarkHandler.h"
37
#include "ColorScheme.h"
38
#include "Session.h"
39
#include "TerminalDisplay.h"
40 41 42 43 44
#include "SessionController.h"
#include "SessionManager.h"
#include "ViewContainer.h"
#include "ViewSplitter.h"

45 46
using namespace Konsole;

47 48
ViewManager::ViewManager(QObject* parent , KActionCollection* collection)
    : QObject(parent)
49
    , _viewSplitter(0)
50 51
    , _actionCollection(collection)
    , _containerSignalMapper(new QSignalMapper(this))
52
{
53 54 55 56 57 58 59 60 61 62
    // create main view area
    _viewSplitter = new ViewSplitter(0);   
    // the ViewSplitter class supports both recursive and non-recursive splitting,
    // in non-recursive mode, all containers are inserted into the same top-level splitter
    // widget, and all the divider lines between the containers have the same orientation
    //
    // the ViewManager class is not currently able to handle a ViewSplitter in recursive-splitting
    // mode 
    _viewSplitter->setRecursiveSplitting(false);

63 64 65 66 67 68
    // setup actions which relating to the view
    setupActions();

    // emit a signal when all of the views held by this view manager are destroyed
    connect( _viewSplitter , SIGNAL(allContainersEmpty()) , this , SIGNAL(empty()) );
    connect( _viewSplitter , SIGNAL(empty(ViewSplitter*)) , this , SIGNAL(empty()) );
69 70 71 72

    // listen for addition or removal of views from associated containers
    connect( _containerSignalMapper , SIGNAL(mapped(QObject*)) , this , 
            SLOT(containerViewsChanged(QObject*)) ); 
73 74 75 76

    // listen for profile changes
    connect( SessionManager::instance() , SIGNAL(profileChanged(const QString&)) , this,
            SLOT(profileChanged(const QString&)) );
77 78
    connect( SessionManager::instance() , SIGNAL(sessionUpdated(Session*)) , this,
            SLOT(updateViewsForSession(Session*)) );
79 80 81 82 83
}

ViewManager::~ViewManager()
{
}
84 85 86 87 88 89 90 91 92 93 94 95
QWidget* ViewManager::activeView() const
{
    ViewContainer* container = _viewSplitter->activeContainer();
    if ( container )
    {
        return container->activeView();
    }
    else
    {
        return 0;
    }
}
96

97 98 99 100 101
QWidget* ViewManager::widget() const
{
    return _viewSplitter;
}

102 103
void ViewManager::setupActions()
{
104
    KActionCollection* collection = _actionCollection;
105

106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
    KAction* nextViewAction = new KAction( i18n("Next View") , this );
    KAction* previousViewAction = new KAction( i18n("Previous View") , this );
    QAction* nextContainerAction = new QAction( i18n("Next View Container") , this);
    
    if ( collection )
    {
        KAction* splitLeftRightAction = new KAction( KIcon("view-left-right"),
                                                      i18n("Split View Left/Right"),
                                                      this );
        splitLeftRightAction->setShortcut( QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_L) );
        collection->addAction("split-view-left-right",splitLeftRightAction);
        connect( splitLeftRightAction , SIGNAL(triggered()) , this , SLOT(splitLeftRight()) );

        KAction* splitTopBottomAction = new KAction( KIcon("view-top-bottom") , 
                                             i18n("Split View Top/Bottom"),this);
        splitTopBottomAction->setShortcut( QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_T) );
        collection->addAction("split-view-top-bottom",splitTopBottomAction);
        connect( splitTopBottomAction , SIGNAL(triggered()) , this , SLOT(splitTopBottom()));

        KAction* closeActiveAction = new KAction( i18n("Close Active") , this );
126
        closeActiveAction->setIcon(KIcon("view-remove"));
127
        closeActiveAction->setShortcut( QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_S) );
128
        closeActiveAction->setEnabled(false);
129 130
        collection->addAction("close-active-view",closeActiveAction);
        connect( closeActiveAction , SIGNAL(triggered()) , this , SLOT(closeActiveView()) );
131 132
        connect( this , SIGNAL(splitViewToggle(bool)) , closeActiveAction , SLOT(setEnabled(bool)) );
        
133 134
        KAction* closeOtherAction = new KAction( i18n("Close Others") , this );
        closeOtherAction->setShortcut( QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_O) );
135
        closeOtherAction->setEnabled(false);
136 137
        collection->addAction("close-other-views",closeOtherAction);
        connect( closeOtherAction , SIGNAL(triggered()) , this , SLOT(closeOtherViews()) );
138
        connect( this , SIGNAL(splitViewToggle(bool)) , closeOtherAction , SLOT(setEnabled(bool)) );
139 140 141 142 143 144 145 146 147

        QAction* detachViewAction = collection->addAction("detach-view");
        detachViewAction->setIcon( KIcon("tab-breakoff") );
        detachViewAction->setText( i18n("&Detach View") );
        // Ctrl+Shift+D is not used as a shortcut by default because it is too close
        // to Ctrl+D - which will terminate the session in many cases
        detachViewAction->setShortcut( QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_H) );

        connect( detachViewAction , SIGNAL(triggered()) , this , SLOT(detachActiveView()) );
148 149 150 151 152 153 154 155 156 157 158 159 160
   
        // Expand & Shrink Active View
        KAction* expandActiveAction = new KAction( i18n("Expand View") , this );
        expandActiveAction->setShortcut( QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_BracketRight) );
        collection->addAction("expand-active-view",expandActiveAction);
        connect( expandActiveAction , SIGNAL(triggered()) , this , SLOT(expandActiveView()) );

        KAction* shrinkActiveAction = new KAction( i18n("Shrink View") , this );
        shrinkActiveAction->setShortcut( QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_BracketLeft) );
        collection->addAction("shrink-active-view",shrinkActiveAction);
        connect( shrinkActiveAction , SIGNAL(triggered()) , this , SLOT(shrinkActiveView()) );

        // Next / Previous View , Next Container
161 162 163
        collection->addAction("next-view",nextViewAction);
        collection->addAction("previous-view",previousViewAction);
        collection->addAction("next-container",nextContainerAction);
Robert Knight's avatar
 
Robert Knight committed
164

165
    }
Robert Knight's avatar
 
Robert Knight committed
166

167
    KShortcut nextViewShortcut = nextViewAction->shortcut();
168 169
    nextViewShortcut.setPrimary( QKeySequence(Qt::SHIFT+Qt::Key_Right) );
    nextViewShortcut.setAlternate( QKeySequence(Qt::CTRL+Qt::Key_PageUp) );
170
    nextViewAction->setShortcut(nextViewShortcut); 
Robert Knight's avatar
 
Robert Knight committed
171
    connect( nextViewAction, SIGNAL(triggered()) , this , SLOT(nextView()) );
172
    _viewSplitter->addAction(nextViewAction);
Robert Knight's avatar
 
Robert Knight committed
173

174 175 176 177
    KShortcut previousViewShortcut = previousViewAction->shortcut();
    previousViewShortcut.setPrimary( QKeySequence(Qt::SHIFT+Qt::Key_Left) );
    previousViewShortcut.setAlternate( QKeySequence(Qt::CTRL+Qt::Key_PageDown) );
    previousViewAction->setShortcut(previousViewShortcut);
Robert Knight's avatar
 
Robert Knight committed
178
    connect( previousViewAction, SIGNAL(triggered()) , this , SLOT(previousView()) );
179
    _viewSplitter->addAction(previousViewAction);
Robert Knight's avatar
 
Robert Knight committed
180 181 182

    nextContainerAction->setShortcut( QKeySequence(Qt::SHIFT+Qt::Key_Tab) );
    connect( nextContainerAction , SIGNAL(triggered()) , this , SLOT(nextContainer()) );
183
    _viewSplitter->addAction(nextContainerAction);
Robert Knight's avatar
 
Robert Knight committed
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
}

void ViewManager::nextContainer()
{
    _viewSplitter->activateNextContainer();
}

void ViewManager::nextView()
{
    ViewContainer* container = _viewSplitter->activeContainer();

    Q_ASSERT( container );

    container->activateNextView();
}

void ViewManager::previousView()
{
    ViewContainer* container = _viewSplitter->activeContainer();

    Q_ASSERT( container );

    container->activatePreviousView();
207 208 209 210 211
}
void ViewManager::detachActiveView()
{
    // find the currently active view and remove it from its container 
    ViewContainer* container = _viewSplitter->activeContainer();
212
    TerminalDisplay* activeView = dynamic_cast<TerminalDisplay*>(container->activeView());
213 214 215 216 217 218 219 220 221 222

    if (!activeView)
        return;

    emit viewDetached(_sessionMap[activeView]);
    
    _sessionMap.remove(activeView);

    // remove the view from this window
    container->removeView(activeView);
223
    activeView->deleteLater();
224 225 226 227 228 229 230

    // if the container from which the view was removed is now empty then it can be deleted,
    // unless it is the only container in the window, in which case it is left empty
    // so that there is always an active container
    if ( _viewSplitter->containers().count() > 1 && 
         container->views().count() == 0 )
    {
231
        removeContainer(container);
232 233 234

        // this will need to be removed if Konsole is modified so the menu item to
        // split the view is no longer one toggle-able item
235
        //_splitViewAction->setChecked(false);
236 237 238 239
    }

}

240
void ViewManager::sessionFinished()
241
{
242 243
    previousView();

244 245 246 247
    Session* session = qobject_cast<Session*>(sender());

    Q_ASSERT(session);

248
    QList<TerminalDisplay*> children = _viewSplitter->findChildren<TerminalDisplay*>();
249

250
    foreach ( TerminalDisplay* view , children )
251 252 253 254
    {
        if ( _sessionMap[view] == session )
        {
            _sessionMap.remove(view);
255
            view->deleteLater();
256
        }
Robert Knight's avatar
 
Robert Knight committed
257 258 259 260 261
    }
}

void ViewManager::focusActiveView()
{
Robert Knight's avatar
Robert Knight committed
262 263 264 265 266 267
    // give the active view in a container the focus.  this ensures 
    // that controller associated with that view is activated and the session-specific
    // menu items are replaced with the ones for the newly focused view

    // see the viewFocused() method

Robert Knight's avatar
 
Robert Knight committed
268 269 270 271 272 273 274 275 276
    ViewContainer* container = _viewSplitter->activeContainer(); 
    if ( container )
    {
        QWidget* activeView = container->activeView();
        if ( activeView )
        {
            activeView->setFocus(Qt::MouseFocusReason);
        }
    }
277 278
}

279

280 281
void ViewManager::viewActivated( QWidget* view )
{
282 283 284 285 286 287
    Q_ASSERT( view != 0 );

    // focus the activated view, this will cause the SessionController
    // to notify the world that the view has been focused and the appropriate UI
    // actions will be plugged in.
    view->setFocus(Qt::OtherFocusReason);
288 289
}

290
void ViewManager::splitLeftRight()
291
{
292
    splitView(Qt::Horizontal);
293
}
294
void ViewManager::splitTopBottom()
295
{
296
    splitView(Qt::Vertical);
297 298
}

299
void ViewManager::splitView(Qt::Orientation orientation)
300
{
301 302 303 304 305 306 307
    // iterate over each session which has a view in the current active
    // container and create a new view for that session in a new container 
    QListIterator<QWidget*> existingViewIter(_viewSplitter->activeContainer()->views());
    
    ViewContainer* container = createContainer(); 

    while (existingViewIter.hasNext())
308
    {
309 310
        Session* session = _sessionMap[(TerminalDisplay*)existingViewIter.next()];
        TerminalDisplay* display = createTerminalDisplay();
311
        applyProfile(display,session->profileKey()); 
312
        ViewProperties* properties = createController(session,display);
313

314
        _sessionMap[display] = session;
315

316 317 318
        container->addView(display,properties);
        session->addView( display );
    }
319

320 321
    _viewSplitter->addContainer(container,orientation);
    emit splitViewToggle(_viewSplitter->containers().count() > 0);
322

323 324
    // focus the new container
    container->containerWidget()->setFocus();
325 326

    // ensure that the active view is focused after the split / unsplit
327 328 329 330 331
    ViewContainer* activeContainer = _viewSplitter->activeContainer();
    QWidget* activeView = activeContainer ? activeContainer->activeView() : 0;

    if ( activeView )
        activeView->setFocus(Qt::OtherFocusReason);
332
}
333
void ViewManager::removeContainer(ViewContainer* container)
334
{
335
    container->deleteLater();
336 337
    emit splitViewToggle(_viewSplitter->containers().count() > 1);
}
338 339 340 341 342 343 344 345
void ViewManager::expandActiveView()
{
    _viewSplitter->adjustContainerSize(_viewSplitter->activeContainer(),10);
}
void ViewManager::shrinkActiveView()
{
    _viewSplitter->adjustContainerSize(_viewSplitter->activeContainer(),-10);
}
346 347 348 349 350 351 352 353
void ViewManager::closeActiveView()
{
    // only do something if there is more than one container active
    if ( _viewSplitter->containers().count() > 1 )
    {
        ViewContainer* container = _viewSplitter->activeContainer();

        removeContainer(container);
354

355 356 357 358
        // focus next container so that user can continue typing 
        // without having to manually focus it themselves
        nextContainer();
    }
359 360 361 362 363 364 365 366 367 368 369 370 371 372
}
void ViewManager::closeOtherViews()
{
    ViewContainer* active = _viewSplitter->activeContainer();

    QListIterator<ViewContainer*> iter(_viewSplitter->containers());
    while ( iter.hasNext() )
    {
        ViewContainer* next = iter.next();
        if ( next != active )
            delete next;
    }
}

373
SessionController* ViewManager::createController(Session* session , TerminalDisplay* view)
374
{
Robert Knight's avatar
Robert Knight committed
375 376
    // create a new controller for the session, and ensure that this view manager
    // is notified when the view gains the focus
377
    SessionController* controller = new SessionController(session,view,this);
378
    connect( controller , SIGNAL(focused(SessionController*)) , this , SIGNAL(activeViewChanged(SessionController*)) );
379 380 381
    connect( session , SIGNAL(destroyed()) , controller , SLOT(deleteLater()) );
    connect( view , SIGNAL(destroyed()) , controller , SLOT(deleteLater()) );
    
382 383 384
    return controller;
}

385
void ViewManager::createView(Session* session)
386
{
387 388 389 390
    // create the default container
    if (_viewSplitter->containers().count() == 0)
    {
        _viewSplitter->addContainer( createContainer() , Qt::Vertical );
391
        emit splitViewToggle(false);
392 393
    }

Robert Knight's avatar
Robert Knight committed
394 395
    // notify this view manager when the session finishes so that its view
    // can be deleted
396
    connect( session , SIGNAL(finished()) , this , SLOT(sessionFinished()) );
Robert Knight's avatar
Robert Knight committed
397 398 399 400
   
    // iterate over the view containers owned by this view manager
    // and create a new terminal display for the session in each of them, along with
    // a controller for the session/display pair 
401 402 403 404 405 406
    ViewContainer* const activeContainer = _viewSplitter->activeContainer();
    QListIterator<ViewContainer*> containerIter(_viewSplitter->containers());

    while ( containerIter.hasNext() )
    {
        ViewContainer* container = containerIter.next();
407
        TerminalDisplay* display = createTerminalDisplay();
408
        applyProfile(display,session->profileKey());
409 410 411 412 413 414
        
        // set initial size
        // temporary default used for now
        display->setSize(80,40);

        
Robert Knight's avatar
 
Robert Knight committed
415
        ViewProperties* properties = createController(session,display);
416 417

        _sessionMap[display] = session; 
Robert Knight's avatar
 
Robert Knight committed
418
        container->addView(display,properties);
419 420
        session->addView(display);

421 422
        if ( container == activeContainer ) 
        {
423
            container->setActiveView(display);
424 425
            display->setFocus( Qt::OtherFocusReason );
        }
426 427 428 429 430
    }
}

ViewContainer* ViewManager::createContainer()
{
431
    ViewContainer* container = new TabbedViewContainerV2(ViewContainer::NavigationPositionBottom,_viewSplitter);
432

433
    // connect signals and slots
434 435 436 437 438 439
    connect( container , SIGNAL(viewAdded(QWidget*,ViewProperties*)) , _containerSignalMapper ,
           SLOT(map()) );
    connect( container , SIGNAL(viewRemoved(QWidget*)) , _containerSignalMapper ,
           SLOT(map()) ); 
    _containerSignalMapper->setMapping(container,container);

440
    connect( container , SIGNAL(viewRemoved(QWidget*)) , this , SLOT(viewCloseRequest(QWidget*)) );
441
    connect( container , SIGNAL(closeRequest(QWidget*)) , this , SLOT(viewCloseRequest(QWidget*)) );
442
    connect( container , SIGNAL(activeViewChanged(QWidget*)) , this , SLOT(viewActivated(QWidget*)));
443
    
444
    return container;
445 446
}

447 448 449 450 451 452 453 454 455 456
void ViewManager::containerViewsChanged(QObject* container)
{
    qDebug() << "Container views changed";

    if ( container == _viewSplitter->activeContainer() )
    {
        emit viewPropertiesChanged( viewProperties() );
    } 
}

457 458 459 460
void ViewManager::viewCloseRequest(QWidget* view)
{
    // 1. detach view from session
    // 2. if the session has no views left, close it
461 462 463
   
    qDebug() << "Removing view.";

464
    TerminalDisplay* display = (TerminalDisplay*)view;
465
    Session* session = _sessionMap[ display ];
466 467
    if ( session )
    {
468
        display->deleteLater();
469 470 471

        _sessionMap.remove(display);

472
        if ( session->views().count() == 0 )
473
            session->close();
474
    }
475
        
476
    focusActiveView();
477 478
}

479
TerminalDisplay* ViewManager::createTerminalDisplay()
480
{
481
   TerminalDisplay* display = new TerminalDisplay(0);
482 483 484 485 486 487

   //TODO Temporary settings used here
   display->setBellMode(0);
   display->setTerminalSizeHint(false);
   display->setCutToBeginningOfLine(true);
   display->setTerminalSizeStartup(false);
488
   display->setScrollBarLocation(TerminalDisplay::SCROLLBAR_RIGHT);
489
   
490 491 492
   return display;
}

493
void ViewManager::applyProfile(TerminalDisplay* view , const QString& profileKey)
494
{
495 496
    Profile* info = SessionManager::instance()->profile(profileKey);

497 498 499 500
    Q_ASSERT( info );

    const ColorScheme* colorScheme = ColorSchemeManager::instance()->
                                            findColorScheme(info->colorScheme());
501 502
    if ( !colorScheme )
       colorScheme = ColorSchemeManager::instance()->defaultColorScheme(); 
503 504
    Q_ASSERT( colorScheme );

505 506 507 508 509 510 511 512 513 514 515 516 517
    // menu bar visibility
    emit setMenuBarVisible( info->property(Profile::ShowMenuBar).value<bool>() );

    // tab bar visibility
    ViewContainer* container = _viewSplitter->activeContainer();
    int tabBarMode = info->property(Profile::TabBarMode).value<int>();
    if ( tabBarMode == Profile::AlwaysHideTabBar )
        container->setNavigationDisplayMode(ViewContainer::AlwaysHideNavigation);
    else if ( tabBarMode == Profile::AlwaysShowTabBar )
        container->setNavigationDisplayMode(ViewContainer::AlwaysShowNavigation);
    else if ( tabBarMode == Profile::ShowTabBarAsNeeded )
        container->setNavigationDisplayMode(ViewContainer::ShowNavigationAsNeeded);

518
    // load colour scheme
519
    view->setColorTable(colorScheme->colorTable());
520
    view->setOpacity(colorScheme->opacity());
521
    
522
    // load font 
523
    view->setVTFont(info->font());
524 525 526 527 528 529 530 531 532 533

    // set scroll-bar position
    int scrollBarPosition = info->property(Profile::ScrollBarPosition).value<int>();

    if ( scrollBarPosition == Profile::ScrollBarHidden )
       view->setScrollBarLocation(TerminalDisplay::SCROLLBAR_NONE);
    else if ( scrollBarPosition == Profile::ScrollBarLeft )
       view->setScrollBarLocation(TerminalDisplay::SCROLLBAR_LEFT);
    else if ( scrollBarPosition == Profile::ScrollBarRight )
       view->setScrollBarLocation(TerminalDisplay::SCROLLBAR_RIGHT);
534 535 536 537 538 539

    // terminal features
    //bool blinkingText = info->property(Profile::BlinkingTextEnabled).value<bool>();
    //TODO - Add a method in TerminalDisplay to allow this to be turned on or off 

    bool blinkingCursor = info->property(Profile::BlinkingCursorEnabled).value<bool>();
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559
    view->setBlinkingCursor(blinkingCursor);  

    // cursor shape
    int cursorShape = info->property(Profile::CursorShape).value<int>();

    if ( cursorShape == Profile::BlockCursor )
        view->setKeyboardCursorShape(TerminalDisplay::BlockCursor);  
    else if ( cursorShape == Profile::IBeamCursor )
        view->setKeyboardCursorShape(TerminalDisplay::IBeamCursor);
    else if ( cursorShape == Profile::UnderlineCursor )
        view->setKeyboardCursorShape(TerminalDisplay::UnderlineCursor);

    // cursor color
    bool useCustomColor = info->property(Profile::UseCustomCursorColor).value<bool>();
    const QColor& cursorColor = info->property(Profile::CustomCursorColor).value<QColor>();
        
    view->setKeyboardCursorColor(!useCustomColor,cursorColor);

    // word characters
    view->setWordCharacters( info->property(Profile::WordCharacters).value<QString>() );
560 561
}

562 563 564 565 566 567 568 569 570
void ViewManager::updateViewsForSession(Session* session)
{
    QListIterator<QPointer<TerminalDisplay> > iter(_sessionMap.keys(session));
    while ( iter.hasNext() )
    {
        applyProfile(iter.next(),session->profileKey());
    }
}

571 572
void ViewManager::profileChanged(const QString& key)
{
573
    QHashIterator<QPointer<TerminalDisplay>,QPointer<Session> > iter(_sessionMap);
574 575 576 577 578 579

    while ( iter.hasNext() )
    {
        iter.next();

        // if session uses this profile, update the display
580
        if ( iter.key() != 0 && iter.value() != 0 && iter.value()->profileKey() == key )
581
        {
582
            applyProfile(iter.key(),key);
583 584
        }
    }
585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600
}

QList<ViewProperties*> ViewManager::viewProperties() const
{
    QList<ViewProperties*> list;

    ViewContainer* container = _viewSplitter->activeContainer();

    Q_ASSERT( container );

    QListIterator<QWidget*> viewIter(container->views());
    while ( viewIter.hasNext() )
    {
        ViewProperties* properties = container->viewProperties(viewIter.next());        Q_ASSERT( properties );
        list << properties; 
    } 
601

602
    return list;
603 604
}

605 606 607 608 609
uint qHash(QPointer<TerminalDisplay> display)
{
    return qHash((TerminalDisplay*)display);
}

610
#include "ViewManager.moc"