Commit a7549dae authored by Robert Knight's avatar Robert Knight

Fix crash when browsing color schemes after closing a split view.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=666493
parent 4e6e820a
......@@ -64,9 +64,6 @@ Character Screen::defaultChar = Character(' ',CharacterColor(COLOR_SPACE_DEFAULT
//#define REVERSE_WRAPPED_LINES // for wrapped line debug
/*! creates a `Screen' of `lines' lines and `columns' columns.
*/
Screen::Screen(int l, int c)
: lines(l),
columns(c),
......@@ -528,11 +525,6 @@ void Screen::effectiveRendition()
ef_fg.toggleIntensive();
}
/**Character* Screen::image()
{
}**/
/*!
returns the image.
......
......@@ -456,13 +456,17 @@ void ViewManager::viewCloseRequest(QWidget* view)
{
// 1. detach view from session
// 2. if the session has no views left, close it
qDebug() << "Removing view.";
TerminalDisplay* display = (TerminalDisplay*)view;
Session* session = _sessionMap[ display ];
if ( session )
{
display->deleteLater();
_sessionMap.remove(display);
if ( session->views().count() == 0 )
session->close();
}
......@@ -555,14 +559,14 @@ void ViewManager::applyProfile(TerminalDisplay* view , const QString& profileKey
void ViewManager::profileChanged(const QString& key)
{
QHashIterator<TerminalDisplay*,Session*> iter(_sessionMap);
QHashIterator<QPointer<TerminalDisplay>,QPointer<Session> > iter(_sessionMap);
while ( iter.hasNext() )
{
iter.next();
// if session uses this profile, update the display
if ( iter.value() != 0 && iter.value()->profileKey() == key )
if ( iter.key() != 0 && iter.value() != 0 && iter.value()->profileKey() == key )
{
applyProfile(iter.key(),key);
}
......@@ -587,4 +591,9 @@ QList<ViewProperties*> ViewManager::viewProperties() const
return list;
}
uint qHash(QPointer<TerminalDisplay> display)
{
return qHash((TerminalDisplay*)display);
}
#include "ViewManager.moc"
......@@ -203,7 +203,7 @@ private:
private:
ViewSplitter* _viewSplitter;
QPointer<SessionController> _pluggedController;
QHash<TerminalDisplay*,Session*> _sessionMap;
QHash<QPointer<TerminalDisplay>,QPointer<Session> > _sessionMap;
KActionCollection* _actionCollection;
QSignalMapper* _containerSignalMapper;
};
......
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